Skip to content

Commit 3022bde

Browse files
authored
Merge pull request #42 from StringCare/develop
Develop
2 parents f89e64c + a9eb670 commit 3022bde

File tree

17 files changed

+381
-73
lines changed

17 files changed

+381
-73
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,8 @@
33
.gradle/
44
build/
55
local.properties
6+
library/.externalNativeBuild
67
*.iml
8+
*.DS_Store
9+
.cxx/
10+
*.cpp

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,15 @@
1616

1717
#### [Limitations](https://github.com/StringCare/AndroidLibrary/wiki/Limitations)
1818

19+
#### [Migrate From 0.x To 1.x](https://github.com/StringCare/AndroidLibrary/wiki/Migrate-From-0.x-To-1.x)
20+
21+
#### [Compatibility](https://github.com/StringCare/GradlePlugin/wiki/Compatibility)
22+
1923
#### [Wiki Plugin](https://github.com/StringCare/GradlePlugin/wiki)
2024

2125
License
2226
-------
23-
Copyright 2018 StringCare [🐒 SpaceMonkeys]
27+
Copyright 2019 StringCare [🐒 SpaceMonkeys]
2428

2529
Licensed under the Apache License, Version 2.0 (the "License");
2630
you may not use this file except in compliance with the License.

app/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ android {
2020
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2121
}
2222
debug {
23+
minifyEnabled false
24+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2325
}
2426
}
2527
}
2628

27-
2829
repositories {
2930
jcenter()
3031
}
Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
package com.efraespada.stringobfuscator;
22

3-
import android.support.v7.app.AppCompatActivity;
43
import android.os.Bundle;
4+
import android.support.v7.app.AppCompatActivity;
5+
import android.text.Html;
6+
import android.view.View;
57
import android.widget.TextView;
68

79
import com.stringcare.library.SC;
10+
import com.stringcare.library.SCTextView;
811

912
public class MainActivity extends AppCompatActivity {
1013

@@ -14,24 +17,31 @@ protected void onCreate(Bundle savedInstanceState) {
1417
setContentView(R.layout.activity_main);
1518

1619
SC.init(getApplicationContext());
17-
// SC.initForLib(getApplicationContext(), this);
18-
19-
int stringId = R.string.hello;
20-
21-
String message = getString(stringId);
22-
message += " is ";
23-
message += SC.getString(stringId);
2420

2521
// secret var
26-
String mySecret = "lalilulelo";
22+
String password = "lalilulelo";
2723

28-
message += "\n\nFor Metal Gear lovers:\n\n\"Snake, the password is " + SC.encryptString(message)
29-
+ "\n\n.. or " + SC.decryptString(SC.encryptString(mySecret)) + "\"";
24+
String message = "\n\nFor Metal Gear lovers:\n\n\"Snake, the password is " + SC.obfuscate(password)
25+
+ "\n\n.. or " + SC.deobfuscate(SC.obfuscate(password)) + "\"";
3026

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

33-
String numbers = getString(R.string.test_a, "hi", 3) + " is " + SC.getString(R.string.test_a, "hi", 3);
29+
String numbers = getString(R.string.test_a, "hi", 3) + " is " + SC.deobfuscate(R.string.test_a, "hi", 3);
3430
((TextView) findViewById(R.id.example_b)).setText(numbers);
31+
final SCTextView tvAuto = findViewById(R.id.auto_tv);
32+
findViewById(R.id.btn_change).setOnClickListener(new View.OnClickListener() {
33+
@Override
34+
public void onClick(View v) {
35+
if (tvAuto.isHtmlEnabled()) {
36+
tvAuto.htmlEnabled(!tvAuto.isHtmlEnabled());
37+
} else if (tvAuto.isVisible()){
38+
tvAuto.visible(!tvAuto.isVisible());
39+
} else if (!tvAuto.isVisible()){
40+
tvAuto.visible(!tvAuto.isVisible());
41+
tvAuto.htmlEnabled(!tvAuto.isHtmlEnabled());
42+
}
43+
}
44+
});
3545

3646
}
3747
}
Lines changed: 51 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,66 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
34
xmlns:tools="http://schemas.android.com/tools"
45
android:id="@+id/activity_main"
56
android:layout_width="match_parent"
67
android:layout_height="match_parent"
7-
android:paddingBottom="@dimen/activity_vertical_margin"
8+
android:background="@android:color/background_light"
89
android:paddingLeft="@dimen/activity_horizontal_margin"
9-
android:paddingRight="@dimen/activity_horizontal_margin"
1010
android:paddingTop="@dimen/activity_vertical_margin"
11-
android:background="@android:color/background_light"
11+
android:paddingRight="@dimen/activity_horizontal_margin"
12+
android:paddingBottom="@dimen/activity_vertical_margin"
1213
tools:context="com.efraespada.stringobfuscator.MainActivity">
1314

14-
<LinearLayout
15+
<ScrollView
1516
android:layout_width="match_parent"
16-
android:layout_height="wrap_content"
17-
android:orientation="vertical"
18-
android:layout_centerInParent="true">
17+
android:layout_height="wrap_content">
1918

20-
<com.stringcare.library.SCTextView
21-
android:padding="10dp"
22-
android:layout_width="wrap_content"
19+
<LinearLayout
20+
android:layout_width="match_parent"
2321
android:layout_height="wrap_content"
24-
android:layout_gravity="center_horizontal"
25-
android:textColor="@android:color/black"
26-
android:text="@string/automatic_decrypt"/>
27-
28-
<TextView
29-
android:padding="10dp"
30-
android:id="@+id/example_a"
31-
android:layout_width="wrap_content"
32-
android:layout_height="wrap_content"
33-
android:layout_gravity="center_horizontal"
34-
android:textColor="@android:color/black"
35-
android:text="" />
36-
37-
<TextView
38-
android:padding="10dp"
39-
android:id="@+id/example_b"
40-
android:layout_width="wrap_content"
41-
android:layout_height="wrap_content"
42-
android:layout_gravity="center_horizontal"
43-
android:textColor="@android:color/black"
44-
android:text="" />
22+
android:orientation="vertical">
23+
24+
<com.stringcare.library.SCTextView
25+
android:id="@+id/auto_tv"
26+
android:layout_width="wrap_content"
27+
android:layout_height="wrap_content"
28+
android:layout_gravity="center_horizontal"
29+
android:layout_marginTop="15dp"
30+
android:padding="10dp"
31+
android:text="@string/hello"
32+
android:textColor="@android:color/black"
33+
app:html="false"
34+
app:visible="false" />
35+
36+
<Button
37+
android:id="@+id/btn_change"
38+
style="@style/Widget.AppCompat.Button.Borderless.Colored"
39+
android:layout_width="wrap_content"
40+
android:layout_height="wrap_content"
41+
android:layout_gravity="end"
42+
android:text="Change" />
43+
44+
<TextView
45+
android:id="@+id/example_a"
46+
android:layout_width="wrap_content"
47+
android:layout_height="wrap_content"
48+
android:layout_gravity="center_horizontal"
49+
android:layout_marginTop="15dp"
50+
android:padding="10dp"
51+
android:textColor="@android:color/black" />
52+
53+
<TextView
54+
android:id="@+id/example_b"
55+
android:layout_width="wrap_content"
56+
android:layout_height="wrap_content"
57+
android:layout_gravity="center_horizontal"
58+
android:layout_marginTop="15dp"
59+
android:padding="10dp"
60+
android:textColor="@android:color/black" />
4561

46-
</LinearLayout>
62+
</LinearLayout>
4763

64+
</ScrollView>
4865

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

build.gradle

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
buildscript {
33

44
ext {
5-
stringcare_version = '0.9'
5+
stringcare_version = '1.2'
66
}
77

88
repositories {
@@ -17,6 +17,7 @@ buildscript {
1717
dependencies {
1818
classpath "com.stringcare:plugin:$stringcare_version"
1919
// classpath files('../GradlePlugin/build/libs/plugin-0.9.jar')
20+
// classpath files('..\\GradlePlugin\\build\\libs\\plugin-0.9.jar')
2021
classpath 'com.android.tools.build:gradle:3.2.1'
2122
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.1"
2223
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
@@ -28,6 +29,9 @@ allprojects {
2829
mavenCentral()
2930
jcenter()
3031
google()
32+
maven {
33+
url "https://plugins.gradle.org/m2/"
34+
}
3135
}
3236
}
3337

@@ -38,5 +42,5 @@ task clean(type: Delete) {
3842
apply plugin: StringCare
3943

4044
stringcare {
41-
debug false
45+
debug true
4246
}

dynamic_feature_cell/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

dynamic_feature_cell/build.gradle

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
apply plugin: 'com.android.dynamic-feature'
2+
3+
android {
4+
compileSdkVersion 28
5+
6+
7+
8+
defaultConfig {
9+
minSdkVersion 15
10+
targetSdkVersion 28
11+
versionCode 1
12+
versionName "1.0"
13+
14+
15+
}
16+
17+
18+
}
19+
20+
dependencies {
21+
implementation fileTree(dir: 'libs', include: ['*.jar'])
22+
implementation project(':app')
23+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:dist="http://schemas.android.com/apk/distribution"
3+
package="com.efraespada.dynamic_feature_cell">
4+
5+
<dist:module
6+
dist:onDemand="true"
7+
dist:title="@string/title_dynamic_feature_cell">
8+
<dist:fusing dist:include="true" />
9+
</dist:module>
10+
</manifest>
11+

0 commit comments

Comments
 (0)