Skip to content

Commit

Permalink
Remove global property, bump version to 0.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
mirfatif committed Oct 24, 2023
1 parent de62e85 commit 684b8d9
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ lsparanoid {

The extension object contains the following properties:
- `seed` - `Integer`. A seed that can be used to make obfuscation stable across builds. Default value is `null`. Set it to non-null can make the obfuscation task cacheable.
- `classFilter` - `(String) -> boolean`. If set, it allows to filter out classes that should be obfuscated. Use `classFilter = { true }`, to turn on global obfuscation i.e. obfuscate all classes, not only annotated ones. Default value is `null`.
- `classFilter` - `(String) -> boolean`. If set, it allows to filter out classes that should be obfuscated. Use `classFilter = { true }` to turn on global obfuscation i.e. obfuscate all classes, not only annotated ones. Or apply a filter like `classFilter = { it.startsWith("com.example.") }` or `classFilter = { it != "module-info" }`. Default value is `null`.
- `includeDependencies` - `boolean`. If `true`, the obfuscation will be applied to all dependencies. Default value is `false`.
- `variantFilter` - `(Variant) -> boolean`. Allows to filter out variants that should be obfuscated. Default value always returns `true`. Note that you can set `seed`, `classFilter` and `includeDependencies` dynamically for each variant in `variantFilter`. For example
```kotlin
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {

allprojects {
group = "org.lsposed.lsparanoid"
version = "0.5.2"
version = "0.5.3"

plugins.withType(JavaPlugin::class.java) {
extensions.configure(JavaPluginExtension::class.java) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import com.android.build.api.variant.Variant

open class LSParanoidExtension {
var seed: Int? = null
@Deprecated("Use 'classFilter: (String) -> Boolean'.")
var global: Boolean = false
var classFilter: ((className: String) -> Boolean)? = null
var includeDependencies: Boolean = false
var variantFilter: (Variant) -> Boolean = { true }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ class LSParanoidPlugin : Plugin<Project> {
it.bootClasspath.set(components.sdkComponents.bootClasspath)
it.classpath = variant.compileClasspath
it.seed.set(extension.seed ?: SecureRandom().nextInt())
@Suppress("DEPRECATION")
it.classFilter = extension.classFilter ?: if (extension.global) { _ -> true} else null
it.classFilter = extension.classFilter
it.projectName.set("${project.rootProject.name}\$${project.name}")
}
variant.artifacts.forScope(if (extension.includeDependencies) Scope.ALL else Scope.PROJECT).use(task)
Expand Down
2 changes: 1 addition & 1 deletion samples/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id("com.android.application") version "7.4.2" apply false
id("com.android.library") version "7.4.2" apply false
id("org.lsposed.lsparanoid") version "0.5.2" apply false
id("org.lsposed.lsparanoid") version "0.5.3" apply false
}

0 comments on commit 684b8d9

Please sign in to comment.