forked from Tencent/Shadow
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'Tencent#8' into 'master'
从Shadow中移除Multidex源码 fix Tencent#8 修改如下: 1. 从Shadow中移除Multidex源码 1. 将Demo-plugin改造为分Dex的apk 1. 使ShadowContext get到的ApplicationInfo中sourceDir指向插件的apk 测试中Multidex日志如下: ``` I/MultiDex: VM with version 1.6.0 does not have multidex support I/MultiDex: Installing application I/MultiDex: MultiDexExtractor.load(/data/data/com.tencent.shadow.demo_host/files/ShadowPluginManager/UnpackedPlugin/dynamic_demo/3e85789d91dd7d3c5504a7c0e27bdaad/plugin-debug.zip/demo-plugin-debug.apk, false, ) I/MultiDex: Blocking on lock /data/data/com.tencent.shadow.demo_host/code_cache/secondary-dexes/MultiDex.lock I/MultiDex: /data/data/com.tencent.shadow.demo_host/code_cache/secondary-dexes/MultiDex.lock locked I/MultiDex: Detected that extraction must be performed. I/MultiDex: Extraction is needed for file /data/data/com.tencent.shadow.demo_host/code_cache/secondary-dexes/demo-plugin-debug.apk.classes2.zip I/MultiDex: Extracting /data/data/com.tencent.shadow.demo_host/code_cache/secondary-dexes/tmp-demo-plugin-debug.apk.classes1505316161.zip I/MultiDex: Renaming to /data/data/com.tencent.shadow.demo_host/code_cache/secondary-dexes/demo-plugin-debug.apk.classes2.zip I/MultiDex: Extraction succeeded - length /data/data/com.tencent.shadow.demo_host/code_cache/secondary-dexes/demo-plugin-debug.apk.classes2.zip: 610363 - crc: 234747838 I/MultiDex: load found 1 secondary dex files I/MultiDex: install done ``` 可以看到Multidex使用data目录存储其余Dex,另外还会用宿主的SharePreference。这些东西可能会在插件升级时冲突。 待验证的问题: - [x] 插件直接使用宿主的Data目录是否会导致插件升级时Multidex认为已经处理过而出错。 - [x] demo-main使用的Multidex版本是1.0.2,应该至少再验证一下最新版本,或者现网业务。 See merge request !69
- Loading branch information
Showing
53 changed files
with
383 additions
and
1,143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
projects/demo/host-apk/src/androidTest/java/com/tencent/shadow/demo/host/DemoBaseTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.tencent.shadow.demo.host; | ||
|
||
import com.tencent.shadow.demo.testutil.Constant; | ||
|
||
abstract class DemoBaseTest extends BaseTest { | ||
@Override | ||
String getPartKey() { | ||
return Constant.PART_KEY_DEMO_MAIN; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 0 additions & 32 deletions
32
projects/demo/host-apk/src/main/res/layout/activity_main.xml
This file was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
projects/demo/host-apk/src/main/res/layout/part_key_adapter.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<TextView xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:textColor="@android:color/black" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<string name="main_activity_info"> | ||
这是一个全动态的demo,插件管理(dynamic-pluginmanager-apk), | ||
插件框架(dynamic-loader-apk及dynamic-runtime-apk), | ||
以及插件本身(demo-plugin),都是动态加载的 | ||
</string> | ||
|
||
<string name="start_plugin"> | ||
启动插件 | ||
</string> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.