christopherney / enigma Goto Github PK
View Code? Open in Web Editor NEWGradle Plugin - Obfuscator String Encryption (Android/Java)
License: MIT License
Gradle Plugin - Obfuscator String Encryption (Android/Java)
License: MIT License
Looking at the source and tracing down what is happening, the Java Parser doesn't know to treat top-level enum classes as a ClassBlock. Since fake injection requires a class block in the array, it fails to pass and thus nothing is actually injected to the class.
I have a singleton handler for secrets in my test example in a class HiddenTreasure.java
This class starts as:
public enum HiddenTreasure {
INSTANCE;
public static final String key = "akfjakgjag";
public static final String iv = "akfkjakgthg";
This is a valid class to provide fake values on, but nothing is added since the parser does not think it can. I do wonder why there is a separate parser to determine things like classes or functions vs just using the reflection API, but this is still an issue regardless. I can address it locally by modifying the class I am 'enigmafying', but it is still a gap in the full solution.
Hi there,
I have initialised my app with Github in Android Studio by going to VCS / Import into Version Control / Share Project on GitHub.
I have never done that but I hope that this is ok.
After implementing the described information I get the following error:
Could not find gradle.plugin.chrisney:enigma:1.0.0.8.
Searched in the following locations:
Do you have an idea?
I am looking forward to your reply!
I have a number of android projects in one large repository. When I attempted to use enigma in one of these projects, I get the message:
?? The project has no Source Code Management. Please setup one (Git, SVN, Mercurial) before use Enigma plugin!
Android Studio clearly shows that I am using Git
and am on the androidx_enigma
branch.
Is there a way to get enigma to work in this case? Any help would be appreciated.
org.codehaus.groovy.ast.expr.TupleExpression cannot be cast to org.codehaus.groovy.ast.expr.ArgumentListExpression
org.codehaus.groovy.ast.expr.TupleExpression cannot be cast to org.codehaus.groovy.ast.expr.ArgumentListExpression
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)
The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)
Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
We try all possible solutions but it's not working, please help us to resolve this issue.
I have added this plugin to a project which has 2 modules, one app and another library type.
The plugin is only accessing app module, and not the library module, even though the plugin was added to library's build.gradle by specifying: apply plugin: 'com.chrisney.enigma'
and enigma.enabled = true
.
Project level build.gradle:
buildscript {
repositories {
google()
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.google.gms:google-services:4.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'gradle.plugin.chrisney:enigma:1.0.0.8'
}
}
library's module level build.gradle:
apply plugin: 'com.android.library'
apply plugin: 'com.chrisney.enigma'
enigma.enabled = true
android {
compileSdkVersion 29
defaultConfig {
minSdkVersion 21
targetSdkVersion 29
versionCode 6
versionName "3.3"
// testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
def room_version = "2.2.5"
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "androidx.work:work-runtime:2.4.0"
implementation "com.google.code.gson:gson:2.8.6"
//room
implementation "android.arch.persistence.room:runtime:$room_version"
annotationProcessor "android.arch.persistence.room:compiler:$room_version"
testImplementation "android.arch.persistence.room:testing:$room_version"
testImplementation 'junit:junit:4.13.1'
// androidTestImplementation 'androidx.test:runner:1.3.0-rc01'
// androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0-rc01'
}
app module's build.gradle was not changed.
When running assemble, I can see the app's java files getting encrypted but not the module's:
11:57:12: Executing task 'assemble'...
Executing tasks: [assemble] in project E:\xxxxxxx\xxxxxxxxx\xxxxx // masking personal info here
> Task :app:preBuild UP-TO-DATE
> Task :app:preDebugBuild UP-TO-DATE
> Task :<library module's name here>:backup // masking personal info here
? Backup: \app\src\main\java\xxx\xxx\xxx\MainActivity.java
? Backup: \app\src\main\java\xxx\xxx\xxx\MyFirebaseMessagingService.java
> Task :<library module's name here>:encrypt
? MainActivity.java encrypted
? MyFirebaseMessagingService.java encrypted
> Task :<library module's name here>:injectCode
?? Add Enigma code
> Task :<library module's name here>:preBuild
> Task :<library module's name here>:extractProguardFiles UP-TO-DATE
> Task :<library module's name here>:preDebugBuild
.
. // skipping generic tasks
.
> Task :<library module's name here>:verifyReleaseResources UP-TO-DATE
> Task :<library module's name here>:assembleRelease UP-TO-DATE
> Task :<library module's name here>:restore
?? Restore: \app\src\main\java\xxx\xxx\xxx\MainActivity.java
?? Restore: \app\src\main\java\xxx\xxx\xxx\MyFirebaseMessagingService.java
? Remove Enigma code: E:\xxxxxxxxxx\xxxxxxxx\xxxxxxxx\app\src\main\java\com\chrisney\enigma
> Task :<library module's name here>:assemble UP-TO-DATE
> Task :app:mergeReleaseJavaResource
> Task :app:transformClassesAndResourcesWithR8ForRelease
> Task :app:packageRelease
> Task :app:assembleRelease
> Task :app:assemble
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 1m 19s
115 actionable tasks: 61 executed, 54 up-to-date
11:58:32: Task execution finished 'assemble'.
project's settings.gradle:
include ':app', ':<library module name here>'
Can you check if this plugin can only support app module and not additional modules in same project?
So if my compilation ends with error (for example error in my code like syntax etc) encrypted file does not restore, so i have to use git to restore it or my app just crash if try to access such string. Fix it please.
Is this plugin supports multi module? I see it's creates package in app
but i don't have app
in multi module and don't get my values encrypted.
kotlin please =(
I have already setup git
but it showing this error
Can you please share a sample video?
Nothing happening in my project
i test this plugin to adding in my code to protect some Strings in Java class, but after Build apk and test to reverse it by JadX, i found same String values is not change or make a fake values...
Greetings! Sir, I'm sorry, probably my question is a bit dumb. The thing is that I don't know how to execute :app:resore task. Pls help, thanks in advance
If sign apk everything is works as it should but with sign bundle the code doesn't revert after bundle ready
Can you pls tell me the license of this lib? And can you add license type in description too? Thanks
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at com.chrisney.enigma.utils.Utils.insertInArray(Utils.java:88)
at com.chrisney.enigma.parser.JavaCode.addBlockAtFirst(JavaCode.java:297)
at com.chrisney.enigma.parser.JavaCode.addAttribute(JavaCode.java:215)
at com.chrisney.enigma.parser.JavaCode.addAttribute(JavaCode.java:189)
at com.chrisney.enigma.parser.JavaCode.injectFakeKeys(JavaCode.java:408)
at com.chrisney.enigma.parser.JavaCode.injectFakeKeys(JavaCode.java:388)
at com.chrisney.enigma.tasks.EnigmaTask.encryptJavaFile(EnigmaTask.java:102)
at com.chrisney.enigma.tasks.EnigmaTask.encrypt(EnigmaTask.java:54)
Greetings.
First off, great work! I started using enigma to obfuscate Strings and it worked perfectly so far, but when I use static initializer to load native library (NDK) it fails with the title's name.
Is there any way to prevent Enigma from obfuscate that static initializer without excluding the whole code, or obfuscate it as well?
Example error:
public class A {
static {
System.loadLibrary("somelib"); <- Illegal Forward Reference
}
}
Appreciate any guidance or help.
Thanks!
Amazing plugin!! I absolutely adore it and it's made my life leaps and bounds easier.
Now, is it possible to use this on a string resource file to encrypt the strings at build time like the rest? I'd rather not manage encrypted values in the Java code itself, and instead in xml. However, if that's just not doable no worries, I figured I'd check.
Thanks!
Greetings,
First of all, thanks for a great plugin! I started using it for almost all of my apps. In one of them I currently don`t need to use it. Before using the plugin my app size was about 3,5 Mb and after it increased to 10. So I tried removing it(removed from gradle). But the app size is still 10 mb. Can you please help me with an suggestion of how to remove all the files so app size can be 3,5Mb back :D. I would also appreciate any kind of guidance and hope for the quick answer!
Best regards!
i see define enigma.srcJava but i want build grade with multi version, hope update soon! thanks you !!
Could not find chrisney:enigma:1.0.0.5-SNAPSHOT.
Searched in the following locations:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Hi,
Implemented in react native 0.64.2
classpath 'gradle.plugin.chrisney:enigma:1.0.0.8'
inside app/build.gradle
enigma.enabled = true
enigma.injectFakeKeys = true
enigma.ignoredClasses = []
enigma.checkSCM = false
Could not set unknown property 'checkSCM' for extension 'enigma' of type com.chrisney.enigma.EnigmaPluginExtension.
Question is checkSCM is implemented or not ?
Is always necessary define source code ?
It happens from time to time.
I found out how to easy decrypt files please give me your private contacts for example email or telegram so i can whore you and not share this publicly
Love u so much, your package support for React Native app
For example
buildTypes {
release {
enigma.enabled = true
enigma.injectFakeKeys = true
}
debug {
enigma.enabled = false
enigma.injectFakeKeys = false
}
}
I tried it, but it still always encrypted
I tested with my project it not work, but with "hello world" create from Android Studio it work.
So that is why many user report it is not work. In my project create with android studio for both phone and watch it create name "mobile", "wear".
In the source code you hard code the source patch, so must have an option to change it or change the code.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.