-
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #83 from StringCare/develop
Develop
- Loading branch information
Showing
11 changed files
with
298 additions
and
411 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 0 additions & 57 deletions
57
app/src/main/java/com/efraespada/stringobfuscator/MainActivity.java
This file was deleted.
Oops, something went wrong.
51 changes: 51 additions & 0 deletions
51
app/src/main/java/com/efraespada/stringobfuscator/MainActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
@@ -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" | ||
|
@@ -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 '[email protected]' | ||
} | ||
} | ||
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' | ||
|
@@ -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 = '[email protected]' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
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() | ||
} |
Oops, something went wrong.