private String getPathFromThisClassLoader(
      ClassLoader classLoader, Class<?> pathClassLoaderClass) {
    // Prior to ICS, we can simply read the "path" field of the
    // PathClassLoader.
    try {
      Field pathField = pathClassLoaderClass.getDeclaredField("path");
      pathField.setAccessible(true);
      return (String) pathField.get(classLoader);
    } catch (NoSuchFieldException ignored) {
    } catch (IllegalAccessException ignored) {
    } catch (ClassCastException ignored) {
    }

    // Parsing toString() method: yuck.  But no other way to get the path.
    String result = classLoader.toString();
    return processClassLoaderString(result);
  }
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