Skip to content

Develop #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[![version][badge]][link]

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

Expand Down Expand Up @@ -48,6 +47,3 @@ License
See the License for the specific language governing permissions and
limitations under the License.


[link]: https://github.com/StringCare/AndroidLibrary
[badge]: https://img.shields.io/bintray/v/efff/maven/StringCareAndroidLibrary.svg
19 changes: 7 additions & 12 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

apply plugin: StringCare

stringcare {
Expand All @@ -11,9 +11,6 @@ stringcare {
}

android {
signingConfigs {

}
compileSdkVersion 30

defaultConfig {
Expand All @@ -23,7 +20,9 @@ android {
versionCode 1
versionName "1.0"
}

flavorDimensions "type"

buildTypes {
release {
minifyEnabled false
Expand All @@ -34,6 +33,7 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

productFlavors {
prod {
dimension "type"
Expand All @@ -54,22 +54,17 @@ android {
}
}

repositories {
jcenter()
}


dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.appcompat:appcompat:1.3.0'
testImplementation 'junit:junit:4.12'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'commons-io:commons-io:2.5'
// implementation project(path: ':library')
implementation "com.stringcare:library:$stringcare_version"
implementation project(path: ':library')
// implementation "com.stringcare:library:$stringcare_version"
}


This file was deleted.

51 changes: 51 additions & 0 deletions app/src/main/java/com/efraespada/stringobfuscator/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package com.efraespada.stringobfuscator

import android.os.Bundle
import android.view.View
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import com.stringcare.library.*
import com.stringcare.library.SC.Companion.init
import com.stringcare.library.SC.Companion.reveal

class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
init(applicationContext)
val password = getString(R.string.snake_msg_hidden)
val original = reveal(password, Version.V3)
val message = "Snake, the password is $password$original"
(findViewById<View>(R.id.programmatically_obfuscation) as TextView).text = message
val numbers =
getString(R.string.pattern, "hi", 3) + " is " + reveal(R.string.pattern, "hi", 3)
(findViewById<View>(R.id.pattern) as TextView).text = numbers
val tvAuto = findViewById<SCTextView>(R.id.auto_tv)
findViewById<View>(R.id.btn_change).setOnClickListener { v: View? ->
if (tvAuto.isHtmlEnabled) {
tvAuto.setHtmlSupport(!tvAuto.isHtmlEnabled)
} else if (tvAuto.isRevealingValue) {
tvAuto.setRevealed(!tvAuto.isRevealingValue)
} else if (!tvAuto.isRevealingValue) {
tvAuto.setRevealed(!tvAuto.isRevealingValue)
tvAuto.setHtmlSupport(!tvAuto.isHtmlEnabled)
}
}
val equals = reveal(R.string.hello_world_b) == getString(R.string.hello_world_a)
val areEquals = "Same result: $equals"
(findViewById<View>(R.id.same_value) as TextView).text = areEquals
val jsonObjectName = R.string.asset_json_file.reveal()


findViewById<TextView>(R.id.json_object).text = jsonObjectName.json().toString()
findViewById<TextView>(R.id.json_object_original).text =
String(jsonObjectName.bytes { false })


val jsonArrayName = R.string.asset_json_raw_file.reveal()
findViewById<TextView>(R.id.json_array).text = jsonArrayName.jsonArray().toString()
findViewById<TextView>(R.id.json_array_original).text =
jsonArrayName.bytes { false }.toString()

}
}
17 changes: 5 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,35 +1,28 @@

buildscript {
ext.kotlin_version = '1.4.0'

ext {
stringcare_version = '4.0.1'
kotlin_version = '1.5.10'
stringcare_version = '4.2.1'
}

repositories {
jcenter()
google()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}

dependencies {
classpath "com.stringcare:plugin:$stringcare_version"
// classpath files('../KotlinGradlePlugin/build/libs/plugin-4.0.0.jar')
classpath 'com.android.tools.build:gradle:4.0.1'
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5"
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath "io.github.stringcare:plugin:$stringcare_version"
// classpath files('../KotlinGradlePlugin/build/libs/plugin-4.0.6.jar')
classpath 'com.android.tools.build:gradle:4.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}

}

allprojects {
repositories {
mavenCentral()
jcenter()
google()
maven {
url "https://plugins.gradle.org/m2/"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
120 changes: 59 additions & 61 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'

version = "4.0.1"
plugins {
id 'com.android.library'
id 'kotlin-android'
id 'maven-publish'
id 'signing'
}

android {
compileSdkVersion 30
Expand Down Expand Up @@ -45,8 +44,7 @@ dependencies {
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'org.jetbrains.anko:anko:0.10.8'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'org.apache.commons:commons-lang3:3.9'
testImplementation 'junit:junit:4.12'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
Expand All @@ -55,39 +53,11 @@ dependencies {
def siteUrl = 'https://github.com/StringCare/AndroidLibrary'
def gitUrl = 'https://github.com/StringCare/AndroidLibrary.git'

group = "com.stringcare"
group = "io.github.stringcare"
version = "4.2.1"

install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom {
project {
packaging 'aar'
name 'StringCareAndroidLibrary'
url siteUrl
// Set your license
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'efraespada'
name 'efraespada'
email 'efraespada@gmail.com'
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl
}
}
}
}
}
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())

task sourcesJar(type: Jar) {
classifier = 'sources'
Expand All @@ -106,26 +76,54 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
from javadoc.destinationDir
}

artifacts {
archives javadocJar
archives sourcesJar
}
afterEvaluate {
publishing {
publications {
library(MavenPublication) {
artifacts = [javadocJar, sourcesJar]
from components.release
artifactId = "library"
pom {
packaging = 'aar'
name = 'StringCareAndroidLibrary'
description = "Stringcare Android library"
url = siteUrl
scm {
connection = gitUrl
developerConnection = gitUrl
url = siteUrl
}
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'efraespada'
name = 'efraespada'
email = 'efraespada@gmail.com'
}
}
}
}
}
repositories {
maven {
//def releaseRepo = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
// def snapshotRepo = "https://oss.sonatype.org/content/repositories/snapshots/"
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username = properties["nexusUsername"]
password = properties["nexusPassword"]
}
}
}
}

Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
bintray {
user = properties.getProperty("bintrayUser")
key = properties.getProperty("bintrayApiKey")
configurations = ['archives']
pkg {
repo = "maven"
name = "StringCareAndroidLibrary"
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = ["Apache-2.0"]
publish = true
signing {
useGpgCmd()
sign publishing.publications.library
}
}
repositories {
mavenCentral()
}
Loading