public File guess() {
    try {
      ClassLoader classLoader = guessSuitableClassLoader();
      // Check that we have an instance of the PathClassLoader.
      Class<?> clazz = Class.forName("dalvik.system.PathClassLoader");
      clazz.cast(classLoader);
      // Use the toString() method to calculate the data directory.
      String pathFromThisClassLoader = getPathFromThisClassLoader(classLoader, clazz);
      File[] results = guessPath(pathFromThisClassLoader);
      if (results.length > 0) {
        return results[0];
      }
    } catch (ClassCastException ignored) {
    } catch (ClassNotFoundException ignored) {
    }
    return null;
  }
Given the result of a ClassLoader.toString() call, process the result so that guessPath can use
it. There are currently two variants. For Android 4.3 and later, the string "DexPathList"
should be recognized and the array of dex path elements is parsed. for earlier versions, the
last nested array ('[' ... ']') is enclosing the string we are interested in.
android/android_framework/dex-maker/src/main/java/com/android/dx/AppDataDirGuesser.java