1- <p align =" center " ><img width =" 10% " vspace =" 20 " src =" https://raw.githubusercontent. com/StringCare/AndroidLibrary/develop/sample /src/main/res/mipmap-xxxhdpi/ic_launcher_round.png " ></p >
1+ <p align =" center " ><img width =" 10% " vspace =" 10 " src =" https://github. com/StringCare/AndroidLibrary/raw/ develop/app /src/main/res/mipmap-xxxhdpi/ic_launcher_round.png " ></p >
22
3+ <h3 align =" center " style =" margin-bottom :30px " vspace =" 20 " >StringCare Android Library</h3 >
34
5+ <p align =" center " ><img width =" 10% " vspace =" 20 " src =" https://github.com/StringCare/AndroidLibrary/raw/develop/white.png " ></p >
46
5- String Care Android Library
6- =========================
7+ #### [ Wiki Library] ( https://github.com/StringCare/AndroidLibrary/wiki )
78
8- Hide strings easily with that lib and plugin! It uses AES/ECB/PKCS5Padding transformation to convert strings with your app's SHA1 fingerprint.
9+ #### [ What is StringCare ] ( https://github.com/StringCare/AndroidLibrary/wiki/What-is-StringCare )
910
10- Gradle implementation
11- ------------
11+ #### [ Library Implementation] ( https://github.com/StringCare/AndroidLibrary/wiki/Library-Implementation )
1212
13- ``` groovy
14- // root_project/build.gradle
15-
16- buildscript {
17-
18- ext {
19- stringcare_version = '0.7'
20- }
21-
22- repositories {
23- jcenter()
24- }
25-
26- dependencies {
27- classpath "com.stringcare:plugin:$stringcare_version"
28- }
29-
30- }
31-
32- apply plugin: StringCare
33- ```
13+ #### [ Library Usage] ( https://github.com/StringCare/AndroidLibrary/wiki/Library-Usage )
3414
35- ``` groovy
36- // root_project/your_module/build.gradle
15+ #### [ Publish APK] ( https://github.com/StringCare/AndroidLibrary/wiki/Publish-APK )
3716
38- repositories {
39- jcenter()
40- }
41-
42- dependencies {
43- implementation "com.stringcare:library:$stringcare_version"
44- }
45- ```
17+ #### [ Limitations] ( https://github.com/StringCare/AndroidLibrary/wiki/Limitations )
4618
47- Setup
48- -----
49- Initialize the library:
50- ``` java
51- SC . init(getApplicationContext());
52- ```
53-
54-
55- #### Encrypt
56- The plugin will encrypt all string tags with ` hidden="true" ` as attribute.
57-
58- ``` xml
59- <resources >
60- <string name =" app_name" >StringObfuscator</string >
61- <string name =" hello" hidden =" true" >hello world!</string >
62- <string name =" test_a" hidden =" true" >%1$s (%2$d)</string >
63- </resources >
64- ```
65-
66- Or encrypt strings programmatically by doing:
67-
68- ``` java
69- String encrypted = SC . encryptString(string_var);
70- ```
71-
72- #### Decrypt
73- From resources:
74- ``` java
75- String decrypted = SC . getString(R . string. hello);
76- String decrypted = SC . getString(R . string. test_a, " hi" , 3 ); // hi (3)
77- ```
78- Or from encrypted variables:
79- ``` java
80- String decrypted = SC . decryptString(encrypted_var);
81- ```
82- Sample
83- ------
84-
85- ``` java
86- SC . init(getApplicationContext());
87-
88- // getting encrypted string resources
89- int stringId = R . string. hello;
90-
91- String message = getString(stringId);
92- message += " is " ;
93- message += SC . getString(stringId);
94-
95- // and secret
96- String mySecret = " lalilulelo" ;
97-
98- message += " \n\n For Metal Gear lovers:\n\n\" Snake, the password is " +
99- SC . encryptString(mySecret) +
100- " \n\n .. or " +
101- SC . decryptString(SC . encryptString(mySecret)) +
102- " \" " ;
103-
104- ((TextView ) findViewById(R . id. example)). setText(message);
105- ```
106-
107- <p align =" center " ><img width =" 40% " vspace =" 20 " src =" https://raw.githubusercontent.com/efraespada/AndroidStringObfuscator/master/sample.png " ></p >
108-
109-
110- Configuration
111- -----------------------------
112- By default the plugin will encrypt every ` strings.xml ` file inside ` src/main ` folder but you can choose a different configuration.
113- ``` groovy
114- // root_folder/build.gradle
115-
116- apply plugin: StringCare
117-
118- stringcare {
119-
120- debug true // prints details
121-
122- modules {
123-
124- sample {
125- stringFiles = ['strings.xml',"other_file.xml"]
126- srcFolders = ['src/main', "other_folder"]
127- }
128-
129- // root_folder/sample/src/main/res/.../strings.xml
130- // root_folder/sample/src/main/res/.../other_file.xml
131- // root_folder/sample/other_folder/res/.../strings.xml
132- // root_folder/sample/other_folder/res/.../other_file.xml
133-
134- other_module {
135- srcFolders = ['src/moduleB']
136- }
137-
138- // root_folder/other_module/src/moduleB/res/.../strings.xml
139-
140- other_module_ {} //
141-
142- // root_folder/other_module_/src/main/res/.../strings.xml
143-
144- }
145-
146- }
147- ```
148-
149- Gradle Console Output Example
150- -----------------------------
151- ```
152- ...
153- :sample:generateDebugResValues UP-TO-DATE
154- :sample:generateDebugResources UP-TO-DATE
155- :sample:mergeDebugResources
156- :sample:debug:B8:DC:47:58:9B:5F:2C:21:45:C4:04:37:0E:56:53:DC:24:6B:2C:66
157- :sample:backupStringResources
158- - values/strings.xml
159- :sample:encryptStringResources
160- - values/strings.xml
161- [hello world!] - [A8590C43DA85D67..]
162- :sample:mergeDebugResources UP-TO-DATE
163- :sample:restoreStringResources
164- - values/strings.xml
165- :sample:createDebugCompatibleScreenManifests UP-TO-DATE
166- ...
167- ```
168-
169- Plugin won't work if there is no config defined for the selected variant:
170- ``` bash
171- ...
172- :sample:mergeReleaseResources
173- 🤯 no config defined for variant release
174- :sample:createReleaseCompatibleScreenManifests
175- ...
176- ```
19+ #### [ Wiki Plugin] ( https://github.com/StringCare/GradlePlugin/wiki )
17720
17821License
17922-------
180- Copyright 2017 Efraín Espada
23+ Copyright 2018 StringCare [🐒 SpaceMonkeys]
18124
18225 Licensed under the Apache License, Version 2.0 (the "License");
18326 you may not use this file except in compliance with the License.
@@ -191,3 +34,4 @@ License
19134 See the License for the specific language governing permissions and
19235 limitations under the License.
19336
37+
0 commit comments