Skip to content

Commit

Permalink
[atlas-core] 支持推差量的dex
Browse files Browse the repository at this point in the history
  • Loading branch information
chenzhong.cz committed Jun 21, 2017
1 parent 4103c22 commit 93ec04a
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,12 @@ public static boolean checkLoadKernalDebugPatch(Application application){
if(patchFile.exists()){
loadKernalPatch = true;
KernalBundle bundle = new KernalBundle();
DexFile dexFile = (DexFile)KernalConstants.dexBooster.loadDex(KernalConstants.baseContext,patchFile.getAbsolutePath(),
DexFile dexFile = (DexFile)KernalConstants.dexBooster.loadDex(KernalConstants.baseContext,KernalConstants.baseContext.getApplicationInfo().sourceDir,
new File(patchFile.getParent(),"base.dex").getAbsolutePath(),0,true) ;

DexFile patchDexFile = (DexFile)KernalConstants.dexBooster.loadDex(KernalConstants.baseContext,patchFile.getAbsolutePath(),
new File(patchFile.getParent(),"patch.dex").getAbsolutePath(),0,true) ;
bundle.installKernalBundle(KernalConstants.baseContext.getClassLoader(), patchFile, new DexFile[]{dexFile}, null,
bundle.installKernalBundle(KernalConstants.baseContext.getClassLoader(), patchFile, new DexFile[]{patchDexFile,dexFile}, null,
true /*(app_info.flags & ApplicationInfo.FLAG_VM_SAFE_MODE) != 0*/);
bundle.replacePathClassLoaderIfNeed(application);
Class DelegateResourcesClazz = application.getClassLoader().loadClass("android.taobao.atlas.runtime.DelegateResources");
Expand Down

0 comments on commit 93ec04a

Please sign in to comment.