@RequiresApi(LOLLIPOP) @Override public File getCodeCacheDir() { return mBase.getCodeCacheDir(); }
@RequiresApi(LOLLIPOP) @Override public File getCodeCacheDir() { return mBase.getCodeCacheDir(); }
codeCacheDir = context.getCodeCacheDir(); } else { codeCacheDir = context.getCacheDir();
public static File getCodeCacheDir(Context context) { return context.getCodeCacheDir(); } }
public static File getCodeCacheDir(Context context) { return context.getCodeCacheDir(); } }
private static File getCodeCacheDir(Context context) { File parentDir; if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { parentDir = new File(context.getApplicationInfo().dataDir, "code_cache"); } else { parentDir = context.getCodeCacheDir(); } File cacheDir = new File(parentDir, "dexopener"); if (cacheDir.isDirectory() || cacheDir.mkdirs()) { FileUtils.delete(cacheDir.listFiles()); } return cacheDir; }
@Override public boolean init(@NonNull Context context, int fontsRes) { FontListParser.Config config = readFontConfig(context, fontsRes); if (config == null) return false; // this will also rewrite the Font#fontName to point to the extracted file(s) extractToCache(context.getAssets(), context.getCodeCacheDir(), config); if (BuildConfig.DEBUG) { Log.v(TAG, "Loading font configuration: " + config); Log.v(TAG, "Aliases=" + config.aliases); Log.v(TAG, "Families=" + config.families); } init(config); return true; }
DexClassLoader dexClassLoader = new DexClassLoader(dexPath,context.getCodeCacheDir().getAbsolutePath(),null,context.getClassLoader() ); for(GenedClassInfo genedClassInfo : genedClassInfos){ if( ! genedClassInfo.initGenedClass(dexClassLoader) ){
public static synchronized void hookMethod(Member hookMethod, BudCallBack callBack) { if( ! checkMember(hookMethod)) return; if( hookedInfo.containsKey(hookMethod)){ BudLog.v("already hook method:" + hookMethod.toString()); return; } HookedMethodInfo hookedMethodInfo = new HookedMethodInfo(hookMethod,callBack); GenedClassInfo genedClassInfo = new GenedClassInfo(prefix + suffix ++ + ";",hookedMethodInfo); byte[] dexbytes = GenClasses.genOneClassDexBytes(genedClassInfo); String dexFileName = "BudHook" + suffix + ".dex"; String dexPath = "/data/data/" + context.getPackageName() + "/files/" + dexFileName; FileOutputStream fos = null; try { fos = context.openFileOutput(dexFileName, Context.MODE_PRIVATE); fos.write(dexbytes); } catch (Exception e) { BudLog.e("error occur when write dex"); return; } DexClassLoader dexClassLoader = new DexClassLoader(dexPath,context.getCodeCacheDir().getAbsolutePath(),null,context.getClassLoader() ); if( ! genedClassInfo.initGenedClass(dexClassLoader) ){ BudLog.e("error occured while load class:" + genedClassInfo.toString()); return; } Method replace = genedClassInfo.getReplace(); Method backup = genedClassInfo.getBackup(); yahfaHook(hookMethod,replace,backup); hookedInfo.put(hookMethod,genedClassInfo); }
info.dataDir + "/app_tbs/", info.dataDir + "/files/xlog/", info.dataDir + "/tinker/", info.dataDir + "/files/ali-s/logRecord/", info.dataDir + "/files/logs/"), RootDirKiller); NativeEngine.redirectDirectory(info.dataDir + "/cache/", VirtualCore.get().getContext().getCacheDir().getAbsolutePath()); NativeEngine.redirectDirectory(info.dataDir + "/code_cache/", VirtualCore.get().getContext().getCodeCacheDir().getAbsolutePath()); RedirectSameDstPaths(Collections.singletonList(""), VEnvironment.getCacheDirectory().getAbsolutePath()); RedirectSameDstPaths(getProcPIDList(), RootDirKiller);
File codeCacheDir; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { codeCacheDir = context.getCodeCacheDir(); } else { codeCacheDir = context.getCacheDir();
codeCacheDir = context.getCodeCacheDir(); } else { codeCacheDir = context.getCacheDir();