Skip to content

Commit 9761028

Browse files
committed
working with proguard and HTML tags
1 parent 0936037 commit 9761028

File tree

6 files changed

+18
-9
lines changed

6 files changed

+18
-9
lines changed

app/build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,16 @@ android {
1616
}
1717
buildTypes {
1818
release {
19-
minifyEnabled false
19+
minifyEnabled true
2020
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2121
}
2222
debug {
23-
minifyEnabled false
23+
minifyEnabled true
2424
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2525
}
2626
}
2727
}
2828

29-
3029
repositories {
3130
jcenter()
3231
}

app/src/main/java/com/efraespada/stringobfuscator/MainActivity.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import android.os.Bundle;
44
import android.support.v7.app.AppCompatActivity;
5+
import android.text.Html;
56
import android.widget.TextView;
67

78
import com.stringcare.library.SC;
@@ -28,7 +29,7 @@ protected void onCreate(Bundle savedInstanceState) {
2829
message += "\n\nFor Metal Gear lovers:\n\n\"Snake, the password is " + SC.obfuscate(password)
2930
+ "\n\n.. or " + SC.deobfuscate(SC.obfuscate(password)) + "\"";
3031

31-
((TextView) findViewById(R.id.example_a)).setText(message);
32+
((TextView) findViewById(R.id.example_a)).setText(Html.fromHtml(message));
3233

3334
String numbers = getString(R.string.test_a, "hi", 3) + " is " + SC.deobfuscate(R.string.test_a, "hi", 3);
3435
((TextView) findViewById(R.id.example_b)).setText(numbers);

app/src/main/res/layout/activity_main.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
android:layout_height="wrap_content"
2424
android:layout_gravity="center_horizontal"
2525
android:textColor="@android:color/black"
26+
android:layout_marginTop="15dp"
2627
android:text="@string/automatic_decrypt"/>
2728

2829
<TextView
@@ -32,7 +33,7 @@
3233
android:layout_height="wrap_content"
3334
android:layout_gravity="center_horizontal"
3435
android:textColor="@android:color/black"
35-
android:text="" />
36+
android:layout_marginTop="15dp" />
3637

3738
<TextView
3839
android:padding="10dp"
@@ -41,7 +42,7 @@
4142
android:layout_height="wrap_content"
4243
android:layout_gravity="center_horizontal"
4344
android:textColor="@android:color/black"
44-
android:text="" />
45+
android:layout_marginTop="15dp" />
4546

4647
</LinearLayout>
4748

app/src/main/res/values/strings.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<resources>
2-
<string name="hello" hidden="true">hello world!</string>
2+
<string name="hello" hidden="true">
3+
<br><b>Hello <i>Mr O'Callaghan</i></b>
4+
<br>No, I'm talking with my father.
5+
<br>Yes yes, but <strong>take it easy</strong>.<br>
6+
</string>
37
<string name="automatic_decrypt" hidden="true">auto decrypted value</string>
48
<string name="app_name">String Obfuscator Sample</string>
59
<string name="test_a" hidden="true">%1$s (%2$d)</string>

library/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ android {
2222
}
2323
buildTypes {
2424
release {
25-
minifyEnabled false
25+
minifyEnabled true
2626
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2727
}
2828
debug {
29-
minifyEnabled false
29+
minifyEnabled true
3030
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
3131
}
3232
}

library/proguard-rules.pro

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,7 @@
1515
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
1616
# public *;
1717
#}
18+
19+
-keepclasseswithmembernames class * {
20+
native <methods>;
21+
}

0 commit comments

Comments
 (0)