Skip to content

Commit bf7deac

Browse files
authored
Merge pull request #7 from StringCare/develop
Develop
2 parents 3af63af + 1e75bba commit bf7deac

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ root_project/build.gradle
1414
buildscript {
1515
1616
ext {
17-
stringcare_version = '0.6'
17+
stringcare_version = '0.7'
1818
}
1919
2020
repositories {

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ apply plugin: 'java'
2424
apply plugin: 'com.jfrog.bintray'
2525

2626
group 'com.stringcare'
27-
version '0.6'
27+
version '0.7'
2828

2929
sourceCompatibility = 1.8
3030

src/main/groovy/FileUtils.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,9 @@ public static String find(String module, String xmlO, String key, boolean debug)
230230
} else {
231231
encrypted = AES.encrypt(result, key);
232232
toShow = result;
233-
content = content.replaceAll(">" + result + "<", ">" + encrypted + "<");
233+
content = content.replace(">" + result + "<", ">" + encrypted + "<");
234234
}
235235

236-
237236
toShow = toShow.length() > maxToShow ? toShow.substring(0, maxToShow) + ".." : toShow;
238237
encrypted = encrypted.length() > maxToShow ? encrypted.substring(0, maxToShow) + ".." : encrypted;
239238
PrintUtils.print(module, "\t[" + toShow + "] - [" + encrypted + "]" + (hasExtra ? extra : ""), true);
@@ -242,12 +241,15 @@ public static String find(String module, String xmlO, String key, boolean debug)
242241
e.printStackTrace();
243242
}
244243

245-
246244
xml1 = toAnalyze.substring(toAnalyze.indexOf(result + "</string>"), (int)(toAnalyze.length()));
247245

248246
if (xml1.indexOf(toFind1) <= 0) break;
249247
}
250248

249+
if (debug) {
250+
PrintUtils.print(module, content, true);
251+
}
252+
251253
return content;
252254
}
253255

src/main/groovy/StringCarePlugin.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class StringCare implements Plugin<Project> {
7474
@Override
7575
void onMergeResourcesStarts(String module, String variant) {
7676
key = CredentialUtils.getKey(module, variant, debug);
77-
if (!"none".equals(key)) {
77+
if (!"none".equals(key) && key != null) {
7878
if (moduleMap.containsKey(module)) {
7979
PrintUtils.print(module, variant + ":" + key)
8080
PrintUtils.print(module, "backupStringResources")
@@ -103,7 +103,7 @@ class StringCare implements Plugin<Project> {
103103

104104
@Override
105105
void onMergeResourcesFinish(String module, String variant) {
106-
if (!"none".equals(key)) {
106+
if (!"none".equals(key)&& key != null) {
107107
if (moduleMap.containsKey(module)) {
108108
PrintUtils.print(module, "restoreStringResources")
109109
FileUtils.restoreStringResources(module, moduleMap.get(module), debug)

0 commit comments

Comments
 (0)