Skip to content

Commit 6fd9ed1

Browse files
authored
Merge pull request #83 from StringCare/develop
Develop
2 parents 776d6d3 + 71122f7 commit 6fd9ed1

File tree

11 files changed

+298
-411
lines changed

11 files changed

+298
-411
lines changed

Diff for: README.md

-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
[![version][badge]][link]
21

32
<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>
43

@@ -50,6 +49,3 @@ License
5049
See the License for the specific language governing permissions and
5150
limitations under the License.
5251

53-
54-
[link]: https://github.com/StringCare/AndroidLibrary
55-
[badge]: https://img.shields.io/bintray/v/efff/maven/StringCareAndroidLibrary.svg

Diff for: app/build.gradle

+7-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apply plugin: 'com.android.application'
22
apply plugin: 'kotlin-android'
3-
apply plugin: 'kotlin-android-extensions'
3+
44
apply plugin: StringCare
55

66
stringcare {
@@ -11,9 +11,6 @@ stringcare {
1111
}
1212

1313
android {
14-
signingConfigs {
15-
16-
}
1714
compileSdkVersion 30
1815

1916
defaultConfig {
@@ -23,7 +20,9 @@ android {
2320
versionCode 1
2421
versionName "1.0"
2522
}
23+
2624
flavorDimensions "type"
25+
2726
buildTypes {
2827
release {
2928
minifyEnabled false
@@ -34,6 +33,7 @@ android {
3433
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
3534
}
3635
}
36+
3737
productFlavors {
3838
prod {
3939
dimension "type"
@@ -54,22 +54,17 @@ android {
5454
}
5555
}
5656

57-
repositories {
58-
jcenter()
59-
}
60-
61-
6257
dependencies {
6358
implementation fileTree(include: ['*.jar'], dir: 'libs')
6459
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
6560
exclude group: 'com.android.support', module: 'support-annotations'
6661
})
67-
implementation 'androidx.appcompat:appcompat:1.2.0'
62+
implementation 'androidx.appcompat:appcompat:1.3.0'
6863
testImplementation 'junit:junit:4.12'
6964
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
7065
implementation 'commons-io:commons-io:2.5'
71-
// implementation project(path: ':library')
72-
implementation "com.stringcare:library:$stringcare_version"
66+
implementation project(path: ':library')
67+
// implementation "com.stringcare:library:$stringcare_version"
7368
}
7469

7570

Diff for: app/src/main/java/com/efraespada/stringobfuscator/MainActivity.java

-57
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
package com.efraespada.stringobfuscator
2+
3+
import android.os.Bundle
4+
import android.view.View
5+
import android.widget.TextView
6+
import androidx.appcompat.app.AppCompatActivity
7+
import com.stringcare.library.*
8+
import com.stringcare.library.SC.Companion.init
9+
import com.stringcare.library.SC.Companion.reveal
10+
11+
class MainActivity : AppCompatActivity() {
12+
override fun onCreate(savedInstanceState: Bundle?) {
13+
super.onCreate(savedInstanceState)
14+
setContentView(R.layout.activity_main)
15+
init(applicationContext)
16+
val password = getString(R.string.snake_msg_hidden)
17+
val original = reveal(password, Version.V3)
18+
val message = "Snake, the password is $password$original"
19+
(findViewById<View>(R.id.programmatically_obfuscation) as TextView).text = message
20+
val numbers =
21+
getString(R.string.pattern, "hi", 3) + " is " + reveal(R.string.pattern, "hi", 3)
22+
(findViewById<View>(R.id.pattern) as TextView).text = numbers
23+
val tvAuto = findViewById<SCTextView>(R.id.auto_tv)
24+
findViewById<View>(R.id.btn_change).setOnClickListener { v: View? ->
25+
if (tvAuto.isHtmlEnabled) {
26+
tvAuto.setHtmlSupport(!tvAuto.isHtmlEnabled)
27+
} else if (tvAuto.isRevealingValue) {
28+
tvAuto.setRevealed(!tvAuto.isRevealingValue)
29+
} else if (!tvAuto.isRevealingValue) {
30+
tvAuto.setRevealed(!tvAuto.isRevealingValue)
31+
tvAuto.setHtmlSupport(!tvAuto.isHtmlEnabled)
32+
}
33+
}
34+
val equals = reveal(R.string.hello_world_b) == getString(R.string.hello_world_a)
35+
val areEquals = "Same result: $equals"
36+
(findViewById<View>(R.id.same_value) as TextView).text = areEquals
37+
val jsonObjectName = R.string.asset_json_file.reveal()
38+
39+
40+
findViewById<TextView>(R.id.json_object).text = jsonObjectName.json().toString()
41+
findViewById<TextView>(R.id.json_object_original).text =
42+
String(jsonObjectName.bytes { false })
43+
44+
45+
val jsonArrayName = R.string.asset_json_raw_file.reveal()
46+
findViewById<TextView>(R.id.json_array).text = jsonArrayName.jsonArray().toString()
47+
findViewById<TextView>(R.id.json_array_original).text =
48+
jsonArrayName.bytes { false }.toString()
49+
50+
}
51+
}

Diff for: build.gradle

+5-12
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,28 @@
1-
21
buildscript {
3-
ext.kotlin_version = '1.4.0'
42

53
ext {
6-
stringcare_version = '4.0.1'
4+
kotlin_version = '1.5.10'
5+
stringcare_version = '4.2.1'
76
}
87

98
repositories {
10-
jcenter()
119
google()
12-
mavenCentral()
1310
maven {
1411
url "https://plugins.gradle.org/m2/"
1512
}
1613
}
1714

1815
dependencies {
19-
classpath "com.stringcare:plugin:$stringcare_version"
20-
// classpath files('../KotlinGradlePlugin/build/libs/plugin-4.0.0.jar')
21-
classpath 'com.android.tools.build:gradle:4.0.1'
22-
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5"
23-
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
16+
classpath "io.github.stringcare:plugin:$stringcare_version"
17+
// classpath files('../KotlinGradlePlugin/build/libs/plugin-4.0.6.jar')
18+
classpath 'com.android.tools.build:gradle:4.2.1'
2419
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
2520
}
2621

2722
}
2823

2924
allprojects {
3025
repositories {
31-
mavenCentral()
32-
jcenter()
3326
google()
3427
maven {
3528
url "https://plugins.gradle.org/m2/"

Diff for: gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip

Diff for: library/build.gradle

+59-61
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
apply plugin: 'com.android.library'
2-
apply plugin: 'kotlin-android'
3-
apply plugin: 'kotlin-android-extensions'
4-
apply plugin: 'com.github.dcendents.android-maven'
5-
apply plugin: 'com.jfrog.bintray'
6-
7-
version = "4.0.1"
1+
plugins {
2+
id 'com.android.library'
3+
id 'kotlin-android'
4+
id 'maven-publish'
5+
id 'signing'
6+
}
87

98
android {
109
compileSdkVersion 30
@@ -45,8 +44,7 @@ dependencies {
4544
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
4645
exclude group: 'com.android.support', module: 'support-annotations'
4746
})
48-
implementation 'androidx.appcompat:appcompat:1.2.0'
49-
implementation 'org.jetbrains.anko:anko:0.10.8'
47+
implementation 'androidx.appcompat:appcompat:1.3.0'
5048
implementation 'org.apache.commons:commons-lang3:3.9'
5149
testImplementation 'junit:junit:4.12'
5250
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
@@ -55,39 +53,11 @@ dependencies {
5553
def siteUrl = 'https://github.com/StringCare/AndroidLibrary'
5654
def gitUrl = 'https://github.com/StringCare/AndroidLibrary.git'
5755

58-
group = "com.stringcare"
56+
group = "io.github.stringcare"
57+
version = "4.2.1"
5958

60-
install {
61-
repositories.mavenInstaller {
62-
// This generates POM.xml with proper parameters
63-
pom {
64-
project {
65-
packaging 'aar'
66-
name 'StringCareAndroidLibrary'
67-
url siteUrl
68-
// Set your license
69-
licenses {
70-
license {
71-
name 'The Apache Software License, Version 2.0'
72-
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
73-
}
74-
}
75-
developers {
76-
developer {
77-
id 'efraespada'
78-
name 'efraespada'
79-
email 'efraespada@gmail.com'
80-
}
81-
}
82-
scm {
83-
connection gitUrl
84-
developerConnection gitUrl
85-
url siteUrl
86-
}
87-
}
88-
}
89-
}
90-
}
59+
Properties properties = new Properties()
60+
properties.load(project.rootProject.file('local.properties').newDataInputStream())
9161

9262
task sourcesJar(type: Jar) {
9363
classifier = 'sources'
@@ -106,26 +76,54 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
10676
from javadoc.destinationDir
10777
}
10878

109-
artifacts {
110-
archives javadocJar
111-
archives sourcesJar
112-
}
79+
afterEvaluate {
80+
publishing {
81+
publications {
82+
library(MavenPublication) {
83+
artifacts = [javadocJar, sourcesJar]
84+
from components.release
85+
artifactId = "library"
86+
pom {
87+
packaging = 'aar'
88+
name = 'StringCareAndroidLibrary'
89+
description = "Stringcare Android library"
90+
url = siteUrl
91+
scm {
92+
connection = gitUrl
93+
developerConnection = gitUrl
94+
url = siteUrl
95+
}
96+
licenses {
97+
license {
98+
name = 'The Apache License, Version 2.0'
99+
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
100+
}
101+
}
102+
developers {
103+
developer {
104+
id = 'efraespada'
105+
name = 'efraespada'
106+
email = 'efraespada@gmail.com'
107+
}
108+
}
109+
}
110+
}
111+
}
112+
repositories {
113+
maven {
114+
//def releaseRepo = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
115+
// def snapshotRepo = "https://oss.sonatype.org/content/repositories/snapshots/"
116+
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
117+
credentials {
118+
username = properties["nexusUsername"]
119+
password = properties["nexusPassword"]
120+
}
121+
}
122+
}
123+
}
113124

114-
Properties properties = new Properties()
115-
properties.load(project.rootProject.file('local.properties').newDataInputStream())
116-
bintray {
117-
user = properties.getProperty("bintrayUser")
118-
key = properties.getProperty("bintrayApiKey")
119-
configurations = ['archives']
120-
pkg {
121-
repo = "maven"
122-
name = "StringCareAndroidLibrary"
123-
websiteUrl = siteUrl
124-
vcsUrl = gitUrl
125-
licenses = ["Apache-2.0"]
126-
publish = true
125+
signing {
126+
useGpgCmd()
127+
sign publishing.publications.library
127128
}
128129
}
129-
repositories {
130-
mavenCentral()
131-
}

0 commit comments

Comments
 (0)