Skip to content

Commit

Permalink
Support Gradle 8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
yujincheng08 committed Feb 17, 2023
1 parent 7030aea commit 68a0298
Show file tree
Hide file tree
Showing 88 changed files with 813 additions and 60,031 deletions.
5 changes: 3 additions & 2 deletions LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright 2021 Michael Rozumyanskiy
Copyright 2023 LSPosed

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -199,4 +200,4 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,31 @@ buildscript {
}
dependencies {
classpath 'io.michaelrocks:paranoid-gradle-plugin:0.3.7'
classpath 'org.lsposed.lsparanoid:gradle-plugin:0.4.0'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.michaelrocks.paranoid'
apply plugin: 'org.lsposed.lsparanoid'
```

Now you can just annotate classes with strings that need to be obfuscated with `@Obfuscate`.
After you project compiles every string in annotated classes will be obfuscated.

Configuration
-------------
Paranoid plugin can be configured using `paranoid` extension object:
Paranoid plugin can be configured using `lsparanoid` extension object:
```groovy
paranoid {
lsparanoid {
// ...
}
```

The extension object contains the following properties:
- `enabled``boolean`. Allows to disable obfuscation for the project. Default value is `true`.
- `cacheable``boolean`. Allows to enable caching for the transform. Default value is `false`.
- `includeSubprojects``boolean`. Allows to enable obfuscation for subprojects. Default value is `false`.
- `obfuscationSeed` - `Integer`. A seed that can be used to make obfuscation stable across builds. Default value is `null`, which means that the seed
- `includeDependencies``boolean`. Allows to enable obfuscation for subprojects. Default value is `false`.
- `seed` - `Integer`. A seed that can be used to make obfuscation stable across builds. Default value is `null`, which means that the seed
is computed from input files on each build.

How it works
Expand Down Expand Up @@ -97,6 +96,7 @@ public class MainActivity extends AppCompatActivity {
License
=======
Copyright 2021 Michael Rozumyanskiy
Copyright 2023 LSPosed

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
48 changes: 0 additions & 48 deletions build.gradle

This file was deleted.

47 changes: 47 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
allprojects {
group = "org.lsposed.lsparanoid"
version = "0.4.0"

val javaVersion by extra(JavaVersion.VERSION_11)
val kotlinVersion by extra("1.8.0")
val pabloVersion by extra("1.3.1")

val asmVersion by extra("9.2")
val gripVersion by extra("0.8.1")
val logbackVersion by extra("1.2.7")

val junitVersion by extra("4.13.2")

val androidToolsVersion by extra("7.4.1")
val androidxAppcompatVersion by extra("1.4.0")
val androidxAnnotationVersion by extra("1.3.0")

val androidxRulesVersion by extra("1.4.0")
val androidxRunnerVersion by extra("1.4.0")
val androidxTestExtJunitVersion by extra("1.1.3")
val androidxEspressoVersion by extra("3.4.0")

val androidBuildToolsVersion by extra("33.0.1")
val androidCompileSdkVersion by extra(33)
val androidMinSdkVersion by extra(16)
val androidTargetSdkVersion by extra(androidCompileSdkVersion)

buildscript {
repositories {
google()
mavenLocal()
mavenCentral()
}

dependencies {
classpath("com.android.tools.build:gradle:$androidToolsVersion")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
}
}

repositories {
google()
mavenLocal()
mavenCentral()
}
}
9 changes: 0 additions & 9 deletions core/build.gradle

This file was deleted.

70 changes: 70 additions & 0 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
plugins {
`java-library`
`maven-publish`
signing
}

val javaVersion: JavaVersion by extra

java {
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
}

publishing {
publications {
register<MavenPublication>("lsparanoid") {
artifactId = "core"
group = group
version = version
pom {
name.set("core")
description.set("String obfuscator for Android applications")
url.set("https://github.com/LSPosed/LSParanoid")
licenses {
license {
name.set("Apache License 2.0")
url.set("https://github.com/libxposed/service/blob/master/LICENSE")
}
}
developers {
developer {
name.set("LSPosed")
url.set("https://lsposed.org")
}
}
scm {
connection.set("scm:git:https://github.com/LSPosed/LSParanoid.git")
url.set("https://github.com/LSPosed/LSParanoid")
}
}
afterEvaluate {
from(components.getByName("java"))
}
}
}
repositories {
maven {
name = "ossrh"
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials(PasswordCredentials::class)
}
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/LSPosed/LSParanoid")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}

signing {
val signingKey = findProperty("signingKey") as String?
val signingPassword = findProperty("signingPassword") as String?
if (signingKey != null && signingPassword != null) {
useInMemoryPgpKeys(signingKey, signingPassword)
}
sign(publishing.publications)
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright 2020 Michael Rozumyanskiy
* Copyright 2023 LSPosed
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,7 +15,7 @@
* limitations under the License.
*/

package io.michaelrocks.paranoid;
package org.lsposed.lsparanoid;

public class DeobfuscatorHelper {
public static final int MAX_CHUNK_LENGTH = 0x1fff;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright 2018 Michael Rozumyanskiy
* Copyright 2023 LSPosed
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,7 +15,7 @@
* limitations under the License.
*/

package io.michaelrocks.paranoid;
package org.lsposed.lsparanoid;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright 2020 Michael Rozumyanskiy
* Copyright 2023 LSPosed
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,7 +15,7 @@
* limitations under the License.
*/

package io.michaelrocks.paranoid;
package org.lsposed.lsparanoid;

public class RandomHelper {
private RandomHelper() {
Expand Down
61 changes: 0 additions & 61 deletions gradle-plugin/build.gradle

This file was deleted.

Loading

0 comments on commit 68a0298

Please sign in to comment.