Skip to content

Commit 260d383

Browse files
committed
Merge branch 'devs/custom_diff_rebase' into dev
2 parents 159f8e4 + 357dfe8 commit 260d383

File tree

5 files changed

+20
-1
lines changed

5 files changed

+20
-1
lines changed

tinker-build/tinker-patch-gradle-plugin/src/main/groovy/com/tencent/tinker/build/gradle/extension/TinkerPatchExtension.groovy

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ public class TinkerPatchExtension {
102102
*/
103103
String customPath
104104

105+
/**
106+
* customDiffPathArgs
107+
* default: null
108+
*/
109+
String customDiffPathArgs
110+
105111
public TinkerPatchExtension() {
106112
oldApk = ""
107113
outputFolder = ""
@@ -112,6 +118,7 @@ public class TinkerPatchExtension {
112118
useSign = true
113119
tinkerEnable = true
114120
customPath = null
121+
customDiffPathArgs = null
115122
}
116123

117124
void checkParameter() {

tinker-build/tinker-patch-gradle-plugin/src/main/groovy/com/tencent/tinker/build/gradle/task/TinkerPatchSchemaTask.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ public class TinkerPatchSchemaTask extends DefaultTask {
138138
.setIgnoreWarning(configuration.ignoreWarning)
139139
.setAllowLoaderInAnyDex(configuration.allowLoaderInAnyDex)
140140
.setCustomDiffPath(configuration.customPath)
141+
.setCustomDiffPathArgs(configuration.customDiffPathArgs)
141142
.setRemoveLoaderForAllDex(configuration.removeLoaderForAllDex)
142143
.setDexFilePattern(new ArrayList<String>(configuration.dex.pattern))
143144
.setIsProtectedApp(configuration.buildConfig.isProtectedApp)

tinker-build/tinker-patch-lib/src/main/java/com/tencent/tinker/build/patch/Configuration.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ public Configuration(InputParam param) throws IOException, TinkerPatchException
268268

269269
mUseSignAPk = param.useSign;
270270
mCustomDiffPath = param.customDiffPath;
271+
mCustomDiffPathArgs = param.customDiffPathArgs;
271272
setSignData(param.signFile, param.keypass, param.storealias, param.storepass);
272273

273274
FileOperation.cleanDir(new File(mOutFolder));

tinker-build/tinker-patch-lib/src/main/java/com/tencent/tinker/build/patch/InputParam.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public class InputParam {
3535
public final String storealias;
3636
public final String storepass;
3737
public final String customDiffPath;
38+
public final String customDiffPathArgs;
3839
public final boolean ignoreWarning;
3940
public final boolean allowLoaderInAnyDex;
4041
public final boolean removeLoaderForAllDex;
@@ -98,6 +99,7 @@ private InputParam(
9899
String storealias,
99100
String storepass,
100101
String customDiffPath,
102+
String customDiffPathArgs,
101103
boolean ignoreWarning,
102104
boolean allowLoaderInAnyDex,
103105
boolean removeLoaderForAllDex,
@@ -130,6 +132,7 @@ private InputParam(
130132
this.storealias = storealias;
131133
this.storepass = storepass;
132134
this.customDiffPath = customDiffPath;
135+
this.customDiffPathArgs = customDiffPathArgs;
133136
this.ignoreWarning = ignoreWarning;
134137
this.allowLoaderInAnyDex = allowLoaderInAnyDex;
135138
this.removeLoaderForAllDex = removeLoaderForAllDex;
@@ -168,6 +171,7 @@ public static class Builder {
168171
private String storealias;
169172
private String storepass;
170173
private String customDiffPath;
174+
private String customDiffPathArgs;
171175
private boolean ignoreWarning;
172176
private boolean allowLoaderInAnyDex;
173177
private boolean removeLoaderForAllDex;
@@ -311,6 +315,11 @@ public Builder setCustomDiffPath(String path) {
311315
return this;
312316
}
313317

318+
public Builder setCustomDiffPathArgs(String args) {
319+
this.customDiffPathArgs = args;
320+
return this;
321+
}
322+
314323
public Builder setRemoveLoaderForAllDex(boolean removeLoaderForAllDex){
315324
this.removeLoaderForAllDex = removeLoaderForAllDex;
316325
return this;
@@ -376,6 +385,7 @@ public InputParam create() {
376385
storealias,
377386
storepass,
378387
customDiffPath,
388+
customDiffPathArgs,
379389
ignoreWarning,
380390
allowLoaderInAnyDex,
381391
removeLoaderForAllDex,

tinker-build/tinker-patch-lib/src/main/java/com/tencent/tinker/build/util/CustomDiff.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
public class CustomDiff {
1616

1717
public static boolean checkHasCustomDiff(Configuration config) {
18-
return config.mCustomDiffPath != null && !config.mCustomDiffPath.trim().isEmpty();
18+
return config.mCustomDiffPath != null && !config.mCustomDiffPath.trim().isEmpty() && config.mCustomDiffPathArgs != null && !config.mCustomDiffPathArgs.isEmpty();
1919
}
2020

2121
public static void diffFile(String mCustomDiffPath,String mCustomDiffPathArgs, File oldFile, File newFile, File diffFile) throws IOException {

0 commit comments

Comments
 (0)