Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
查郁 committed Mar 29, 2017
2 parents 987a622 + f43ebde commit 1f90bc9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,9 @@ public void init(Application application,boolean reset) throws AssertionArrayExc

Object gDefault = null;
if(Build.VERSION.SDK_INT<25) {
AtlasHacks.ActivityManagerNative_gDefault.get(AtlasHacks.ActivityManagerNative.getmClass());
gDefault=AtlasHacks.ActivityManagerNative_gDefault.get(AtlasHacks.ActivityManagerNative.getmClass());
}else{
AtlasHacks.ActivityManagerNative_getDefault.invoke(AtlasHacks.ActivityManagerNative.getmClass());
gDefault=AtlasHacks.ActivityManagerNative_getDefault.invoke(AtlasHacks.ActivityManagerNative.getmClass());
}
AtlasHacks.Singleton_mInstance.hijack(gDefault, activityManagerProxy);
}catch(Throwable e){}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,11 @@ protected Class<?> findClass(String className) throws ClassNotFoundException {
if (clazz != null)
return clazz;

if (clazz == null && className.contains("MsgProvider")) {
ComponentName comp = new ComponentName(RuntimeVariables.androidApplication.getPackageName(),className);
if (isProvider(comp)){
return Atlas.class.getClassLoader().loadClass("android.taobao.atlas.util.FakeProvider");
}else if(isReceiver(comp)){
return Atlas.class.getClassLoader().loadClass("android.taobao.atlas.util.FakeReceiver");
}

throw new ClassNotFoundException("Can't find class " + className + printExceptionInfo());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@
import com.taobao.android.utils.PathMatcher;
import com.taobao.android.utils.ZipUtils;

import com.taobao.common.dexpatcher.DexPatchApplier;
import com.taobao.common.dexpatcher.DexPatchGenerator;
import org.antlr.runtime.RecognitionException;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
Expand Down Expand Up @@ -314,11 +316,11 @@ public void setCreateAll(boolean createAll) {

private boolean hasMainBundle;

private List<BundleBO> noPatchBundles = Lists.newArrayList();
private List<String> noPatchBundles = Lists.newArrayList();

private Map<String, Map<String, ClassDef>> bundleClassMap = new ConcurrentHashMap<String, Map<String, ClassDef>>();

public void setNoPatchBundles(List<BundleBO>noPatchBundles) {
public void setNoPatchBundles(List<String>noPatchBundles) {
if (!noPatchBundles.isEmpty()) {
this.noPatchBundles.addAll(noPatchBundles);
}
Expand Down Expand Up @@ -1145,6 +1147,11 @@ private void downloadFile(String httpUrl, File saveFile) throws IOException {
}

public static void main(String[] args) throws Exception {
File baseDexFile = new File("/Users/lilong/Downloads/taobao-android-release-6.4.5.36/lib/armeabi/libcom_taobao_taobao_home/classes.dex");
File newDexFile = new File("/Users/lilong/Downloads/1.dex");
File patchFile = new File("/Users/lilong/Downloads/2.dex");
DexPatchGenerator dexPatchGenerator = new DexPatchGenerator(baseDexFile,newDexFile);
dexPatchGenerator.executeAndSaveTo(new File("/Users/lilong/Downloads/2.dex"));
//
// TPatchTool tPatchTool = new TPatchTool(new File("/Users/lilong/Downloads/taobao-android.apk"),
// new File("/Users/lilong/Downloads/tpatch-diff.apk"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.taobao.android.object.PatchBundleInfo;
import com.taobao.android.object.PatchInfo;
import com.taobao.android.task.ExecutorServicesHelper;
import com.taobao.android.tpatch.model.BundleBO;
import com.taobao.android.tpatch.utils.JarSplitUtils;
import com.taobao.android.tpatch.utils.MD5Util;
import com.taobao.android.tpatch.utils.PathUtils;
Expand Down

0 comments on commit 1f90bc9

Please sign in to comment.