Skip to content

Commit 7ee3e2f

Browse files
committed
...
1 parent fd81f47 commit 7ee3e2f

File tree

6 files changed

+23
-17
lines changed

6 files changed

+23
-17
lines changed

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Android String Obfuscator
22
=========================
33

4-
Hide strings easyly with that lib (and script)! It uses AES/ECB/PKCS5Padding transformation to convert strings with your app's SHA1 fingerprint.
4+
Hide strings easily with that lib (and script)! It uses AES/ECB/PKCS5Padding transformation to convert strings with your app's SHA1 fingerprint.
55

66
Installation
77
------------
@@ -37,9 +37,11 @@ android.applicationVariants.all{ variant ->
3737
]
3838
}
3939
def stringsFileObfus = file("string_obfuscation/strings.xml")
40-
stringsFile.write(stringsFileObfus.getText('UTF-8'))
41-
stringsFileObfus.delete()
42-
} else logger.error("strings.xml file couldn't be found: " + path)
40+
if (stringsFileObfus.isFile()) {
41+
stringsFile.write(stringsFileObfus.getText('UTF-8'))
42+
stringsFileObfus.delete()
43+
} else logger.error("string_obfuscation/strings.xml not found")
44+
} else logger.error("values.xml file couldn't be found: " + path)
4345
}
4446
}
4547
```
@@ -76,12 +78,11 @@ Gradle Console Output Example
7678
:sample:initStringObfuscator
7779
:sample:obfuscator-script - -----------------------------------------------------------------------------
7880
:sample:obfuscator-script - debug variant
79-
:sample:obfuscator-script - SHA1 fingerprint: E1:28:0C:3E:65:96:2E:21:E9:98:2B:58:80:9A:25:3A:F6:88:7D:FF
81+
:sample:obfuscator-script - SHA1 fingerprint: E1:28:0C:3E:65:91:2E:21:E9:98:2B:58:80:9A:25:3A:F6:88:7D:FF
8082
:sample:obfuscator-script - looking for string file on -> /Users/efrainespada/Desktop/AndroidStringObfuscator/sample/build/intermediates/res/merged/debug/values/values.xml
8183
:sample:obfuscator-script - [StringObfuscato..] - [7CFBFBEE31ABA92..]
8284
:sample:obfuscator-script - -----------------------------------------------------------------------------
83-
:sample:obfuscator-script - v0.4 --- bugs or improvements to https://github.com/efraespada/AndroidStringObfuscator/issues
84-
:sample:obfuscator-script - -----------------------------------------------------------------------------
85+
:sample:obfuscator-script - v0.4
8586
:sample:processDebugManifest UP-TO-DATE
8687
...
8788
```
0 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.jar

51.7 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Wed Jan 18 23:07:43 CET 2017
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-3.1-bin.zip

obfuscator-script/kjhfdjfhgdkfjgh/strings.xml

Whitespace-only changes.

obfuscator-script/src/main/Core.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ public class Core {
3030

3131
public static void main(String[] args) {
3232

33-
if (args.length != 3) {
34-
print("-> params [xml_file_name] [variant] [module]");
33+
if (args.length < 3) {
34+
print("-> params [xml_file_name] [variant] [module] [optional:sha1]");
3535
System.exit(0);
3636
return;
3737
}
@@ -51,11 +51,15 @@ else if (i == 3)
5151

5252
getKey();
5353

54+
if (key == null) {
55+
print("SHA1 fingerprint not detected; try params [xml_file_name] [variant] [module] [sha1_fingerprint]");
56+
System.exit(0);
57+
}
58+
5459
mainProcess();
5560

5661
print(SEPARATOR);
57-
print("v" + VERSION + " --- bugs or improvements to https://github.com/efraespada/AndroidStringObfuscator/issues");
58-
print(SEPARATOR);
62+
print("v" + VERSION);
5963
}
6064

6165
public static String getString(BufferedReader br) {
@@ -147,12 +151,6 @@ public static boolean isEncrypted(String value, String key) {
147151
public static String find(String xmlO) {
148152
String toFind1 = "hidden=\"true\"";
149153

150-
if (key == null) {
151-
print("SHA1 fingerprint not detected; try params [xml_file_name] [variant] [module] [sha1_fingerprint]");
152-
print("returning same values.xml");
153-
return xmlO;
154-
}
155-
156154
String xml1 = xmlO;
157155
while (xml1.indexOf(toFind1) > 0) {
158156
String toAnalyze = xml1.substring(xml1.indexOf(toFind1), (int)(xml1.length()));
@@ -219,6 +217,7 @@ public static void getKey() {
219217

220218
String line;
221219
while ((line = buff.readLine()) != null) {
220+
222221
parseTrace(line);
223222

224223
if (key != null) {

0 commit comments

Comments
 (0)