File tree Expand file tree Collapse file tree 1 file changed +41
-4
lines changed Expand file tree Collapse file tree 1 file changed +41
-4
lines changed Original file line number Diff line number Diff line change 6
6
1 . build.gradle配置,不再需要引用官方的MultiDex库
7
7
```
8
8
allprojects {
9
- repositories {
10
- ...
11
- maven { url 'https://jitpack.io' }
12
- }
9
+ repositories {
10
+ ...
11
+ maven { url 'https://jitpack.io' }
13
12
}
13
+ }
14
14
15
15
dependencies {
16
16
implementation 'com.github.zhuozp:ComPactMultiDex:v1.0.0'
@@ -73,7 +73,44 @@ public class DemoApplication extends Application {
73
73
MultiDex.install(this,?);
74
74
}
75
75
}
76
+
77
+ /**
78
+ * 不进行优化,同原来的
79
+ * */
80
+ public static final int FLAG_NOT_COMPACT = 0 ;
81
+
82
+ /**
83
+ * 并发抽取dex
84
+ * */
85
+ public static final int FLAG_EXTRACT_CONCURRENT = 1;
86
+
87
+ /**
88
+ * 并发加载opt dex以及dexopt
89
+ * */
90
+ public static final int FLAG_LOAD_OPT_AND_DEX_CONCURRENT = 1 << 1;
91
+
92
+ /**
93
+ * 解压抽取的class.dex不进行zip压缩,直接解压生成dex
94
+ * */
95
+ public static final int FLAG_EXTRACT_RAW_DEX_NOT_ZIP = 1 << 2;
96
+
97
+ /**
98
+ * 并发校验本地抽取出的dex的crc验证
99
+ * */
100
+ public static final int FLAG_EXTRACT_TO_RAW_DEX_CONCURRENT_CRC = 1 << 3;
101
+
102
+ /**
103
+ * 本地dex不做crc验证、只做apk验证
104
+ * */
105
+ public static final int FLAG_NOT_DEX_CRC = 1 << 4;
106
+
107
+ /**
108
+ * 所有优化点一起进行
109
+ * */
110
+ public static final int FLAG_ALL_OPT = FLAG_EXTRACT_CONCURRENT | FLAG_LOAD_OPT_AND_DEX_CONCURRENT | FLAG_EXTRACT_RAW_DEX_NOT_ZIP |
111
+ FLAG_EXTRACT_TO_RAW_DEX_CONCURRENT_CRC | FLAG_NOT_DEX_CRC;
76
112
```
113
+
77
114
或AndroidManifest.xml文件中修改application如下
78
115
```
79
116
<application
You can’t perform that action at this time.
0 commit comments