{"id":20507376,"url":"https://github.com/lsposed/lsparanoid","last_synced_at":"2025-05-16T08:04:24.077Z","repository":{"id":65970956,"uuid":"603130742","full_name":"LSPosed/LSParanoid","owner":"LSPosed","description":"String obfuscator for Android applications","archived":false,"fork":false,"pushed_at":"2025-04-07T21:52:51.000Z","size":1258,"stargazers_count":334,"open_issues_count":8,"forks_count":33,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-12T04:48:06.649Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LSPosed.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-02-17T17:20:35.000Z","updated_at":"2025-04-08T09:48:20.000Z","dependencies_parsed_at":"2024-03-22T16:27:26.828Z","dependency_job_id":"c5380b14-eb49-41ca-b3bc-e4b2848c0765","html_url":"https://github.com/LSPosed/LSParanoid","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LSPosed%2FLSParanoid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LSPosed%2FLSParanoid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LSPosed%2FLSParanoid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LSPosed%2FLSParanoid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LSPosed","download_url":"https://codeload.github.com/LSPosed/LSParanoid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254493378,"owners_count":22080126,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T20:13:44.568Z","updated_at":"2025-05-16T08:04:19.070Z","avatar_url":"https://github.com/LSPosed.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build](https://github.com/LSPosed/LSParanoid/actions/workflows/build.yml/badge.svg)](https://github.com/LSPosed/LSParanoid/actions/workflows/build.yml)\n[![Maven Central](https://img.shields.io/maven-central/v/org.lsposed.lsparanoid/org.lsposed.lsparanoid.gradle.plugin)](https://central.sonatype.com/namespace/org.lsposed.lsparanoid)\n\nLSParanoid\n========\n\nString obfuscator for Android applications. LSParanoid supports [configuration cache](https://docs.gradle.org/current/userguide/configuration_cache.html).\n\nUsage\n-----\nIn order to make LSParanoid work with your project you have to apply the LSParanoid Gradle plugin\nto the project.\n\nThe following is an example `settings.gradle.kts` to apply LSParanoid.\n```kotlin\npluginManagement {\n  repositories {\n    mavenCentral()\n  }\n  plugins {\n    id(\"org.lsposed.lsparanoid\") version \"......\"\n  }\n}\n```\n\nNow you can just annotate classes with strings that need to be obfuscated with `@Obfuscate`.\nAfter you project compiles every string in annotated classes will be obfuscated.\n\n**Note that you should use at least Java 17 to launch the gradle daemon for this plugin (this is also required by AGP 8+).**\nThe project that uses this plugin on the other hand does not necessarily to target Java 17.\n\nConfiguration\n-------------\nParanoid plugin can be configured using `lsparanoid` extension object.\n\nThe following is an example `build.gradle.kts` that configures `lsparanoid` extension object with default values.\n```kotlin\nplugins {\n    id(\"org.lsposed.lsparanoid\")\n    // other plugins...\n}\n\nlsparanoid {\n  seed = null\n  classFilter = null\n  includeDependencies = false\n  variantFilter = { true }\n}\n\n```\n\nThe extension object contains the following properties:\n- `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.\n- `classFilter` - `(String) -\u003e 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`.\n- `includeDependencies` - `boolean`. If `true`, the obfuscation will be applied to all dependencies. Default value is `false`.\n- `variantFilter` - `(Variant) -\u003e 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\n    ```kotlin\n    variantFilter = { variant -\u003e \n        // enable global obfuscate for globalObfuscate flavor release build\n        if (variant.flavorName == \"globalObfuscate\" \u0026\u0026 variant.buildType == \"release\") {\n            seed = 114514\n            classFilter = { true }\n            true\n        } else if (variant.buildType == \"release\") {\n            seed = 1919810\n            classFilter = null\n            true\n        } else {\n            false\n        }\n    }\n    ```\n\nHow it works\n------------\nLet's say you have an `Activity` that contains some string you want to be obfuscated.\n\n```java\n@Obfuscate\npublic class MainActivity extends AppCompatActivity {\n  private static final String QUESTION = \"Q: %s\";\n  private static final String ANSWER = \"A: %s\";\n\n  @Override\n  protected void onCreate(final Bundle savedInstanceState) {\n    super.onCreate(savedInstanceState);\n    setContentView(R.layout.main_activity);\n\n    final TextView questionTextView = (TextView) findViewById(R.id.questionTextView);\n    questionTextView.setText(String.format(QUESTION, \"Does it work?\"));\n\n    final TextView answerTextView = (TextView) findViewById(R.id.answerTextView);\n    answerTextView.setText(String.format(ANSWER, \"Sure it does!\"));\n  }\n}\n```\n\nThe class contains both string constants (`QUESTION` and `ANSWER`) and string literals.\nAfter compilation this class will be transformed to something like this.\n\n```java\n\n@Obfuscate\npublic class MainActivity extends AppCompatActivity {\n  private static final String QUESTION = Deobfuscator.getString(4);\n  private static final String ANSWER = Deobfuscator.getString(5);\n\n  protected void onCreate(final Bundle savedInstanceState) {\n    super.onCreate(savedInstanceState);\n    setContentView(R.layout.main_activity);\n\n    final TextView questionTextView = (TextView) findViewById(R.id.questionTextView);\n    questionTextView.setText(String.format(Deobfuscator.getString(0), Deobfuscator.getString(1)));\n\n    final TextView answerTextView = (TextView) findViewById(R.id.answerTextView);\n    answerTextView.setText(String.format(Deobfuscator.getString(2), Deobfuscator.getString(3)));\n  }\n}\n\n```\n\nCredit\n------\nLSParanoid was forked from https://github.com/MichaelRocks/paranoid. Credits to its original author Michael Rozumyanskiy.\n\nLicense\n=======\n    Copyright 2021 Michael Rozumyanskiy\n    Copyright 2023 LSPosed\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n        http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flsposed%2Flsparanoid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flsposed%2Flsparanoid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flsposed%2Flsparanoid/lists"}