├── ReadMe.md ├── imgs ├── Screenshot_1.png ├── Screenshot_2.png ├── Screenshot_3.png ├── Screenshot_4.png ├── Screenshot_5.png └── Screenshot_6.png └── protector ├── .gitignore ├── build.gradle ├── consumer-rules.pro ├── proguard-rules.pro └── src └── main ├── AndroidManifest.xml ├── cpp ├── CMakeLists.txt ├── data.h ├── helpers.h └── library.cpp └── java └── com └── ayoubfletcher └── protector ├── AppLib.kt └── Holder.kt /ReadMe.md: -------------------------------------------------------------------------------- 1 | # Android App Protector 2 | 3 | --- 4 | 5 | > Protect your android app from script kiddies of reverse engineering that use apktool with find and replace the package name and replace. Prevent that behavior and block those kiddies "Sorry mates :( .'! 6 | 7 | --- 8 | ## How to add the library into the project 9 | - Copy the folder of the library "protector" into the main directory of the project. 10 | 11 | 12 | 13 | - Add the library into the "settings.gradle" 14 | 15 | 16 | 17 | ```gradle 18 | include ':protector' 19 | include ':app' 20 | ``` 21 | 22 | - Include the library into the project on "app.gradle" and Sync the project: 23 | 24 | 25 | 26 | 27 | ```gradle 28 | dependencies { 29 | 30 | implementation project(':protector') 31 | 32 | } 33 | ``` 34 | - Replace the package name in the data.h and make it match the actual package name of your application. 35 | 36 | 37 | 38 | > BE AWARE MAKE SURE THE PACKAGE NAME IS CORRECT AND MATCH THE ACTUAL PACKAGE NAME OF YOUR APPLICATION OR YOUR APP WILL CRASH ON RUN. (WARNED YA :P). 39 | 40 | - Create new file and extend AppLib of the library 41 | 42 | 43 | 44 | - Add the App into the Manifest file 45 | 46 | 47 | 48 | - Build your app and release it and don't worry of those cheap reverse tricks. 49 | 50 | --- 51 | 52 | Made by Ayoub Fletcher with LOVE ❤️. -------------------------------------------------------------------------------- /imgs/Screenshot_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youbamj/Android-Protector/2a7f1bda4ef0049a44d43e5bee36b7c0fd0a4327/imgs/Screenshot_1.png -------------------------------------------------------------------------------- /imgs/Screenshot_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youbamj/Android-Protector/2a7f1bda4ef0049a44d43e5bee36b7c0fd0a4327/imgs/Screenshot_2.png -------------------------------------------------------------------------------- /imgs/Screenshot_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youbamj/Android-Protector/2a7f1bda4ef0049a44d43e5bee36b7c0fd0a4327/imgs/Screenshot_3.png -------------------------------------------------------------------------------- /imgs/Screenshot_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youbamj/Android-Protector/2a7f1bda4ef0049a44d43e5bee36b7c0fd0a4327/imgs/Screenshot_4.png -------------------------------------------------------------------------------- /imgs/Screenshot_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youbamj/Android-Protector/2a7f1bda4ef0049a44d43e5bee36b7c0fd0a4327/imgs/Screenshot_5.png -------------------------------------------------------------------------------- /imgs/Screenshot_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youbamj/Android-Protector/2a7f1bda4ef0049a44d43e5bee36b7c0fd0a4327/imgs/Screenshot_6.png -------------------------------------------------------------------------------- /protector/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /protector/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.android.library' 3 | id 'kotlin-android' 4 | } 5 | 6 | android { 7 | compileSdkVersion 30 8 | buildToolsVersion "30.0.2" 9 | 10 | defaultConfig { 11 | minSdkVersion 16 12 | targetSdkVersion 30 13 | versionCode 1 14 | versionName "1.0" 15 | 16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 17 | consumerProguardFiles "consumer-rules.pro" 18 | } 19 | 20 | buildTypes { 21 | release { 22 | minifyEnabled false 23 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 24 | } 25 | } 26 | compileOptions { 27 | sourceCompatibility JavaVersion.VERSION_1_8 28 | targetCompatibility JavaVersion.VERSION_1_8 29 | } 30 | kotlinOptions { 31 | jvmTarget = '1.8' 32 | } 33 | 34 | externalNativeBuild { 35 | cmake { 36 | path "src/main/cpp/CMakeLists.txt" 37 | version "3.10.2" 38 | } 39 | } 40 | } 41 | 42 | dependencies { 43 | implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" 44 | implementation 'androidx.core:core-ktx:1.3.2' 45 | implementation 'androidx.appcompat:appcompat:1.2.0' 46 | implementation 'com.google.android.material:material:1.2.1' 47 | } 48 | -------------------------------------------------------------------------------- /protector/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youbamj/Android-Protector/2a7f1bda4ef0049a44d43e5bee36b7c0fd0a4327/protector/consumer-rules.pro -------------------------------------------------------------------------------- /protector/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /protector/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /protector/src/main/cpp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # For more information about using CMake with Android Studio, read the 2 | # documentation: https://d.android.com/studio/projects/add-native-code.html 3 | 4 | # Sets the minimum version of CMake required to build the native library. 5 | 6 | cmake_minimum_required(VERSION 3.4.1) 7 | 8 | # Creates and names a library, sets it as either STATIC 9 | # or SHARED, and provides the relative paths to its source code. 10 | # You can define multiple libraries, and CMake builds them for you. 11 | # Gradle automatically packages shared libraries with your APK. 12 | 13 | add_library( # Sets the name of the library. 14 | library 15 | 16 | # Sets the library as a shared library. 17 | SHARED 18 | 19 | data.h 20 | 21 | helpers.h 22 | 23 | # Provides a relative path to your source file(s). 24 | library.cpp) 25 | 26 | -------------------------------------------------------------------------------- /protector/src/main/cpp/data.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Data { 7 | public: 8 | static string getPackageName() { 9 | return "com.ayoubfletcher.protector"; 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /protector/src/main/cpp/helpers.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | 5 | /** 6 | * Get Current Package Of Application 7 | * @param env 8 | * @param contextApp 9 | * @return currentPackage 10 | */ 11 | string getPackageName(JNIEnv *env, jobject contextApp) { 12 | jclass activity_class = env->GetObjectClass(contextApp); 13 | jmethodID mid = env->GetMethodID(activity_class, "getPackageName", "()Ljava/lang/String;"); 14 | jstring jPackageName = (jstring) env->CallObjectMethod(contextApp, mid); 15 | return env->GetStringUTFChars(jPackageName, 0); 16 | } -------------------------------------------------------------------------------- /protector/src/main/cpp/library.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "data.h" 4 | #include "helpers.h" 5 | 6 | using namespace std; 7 | 8 | 9 | extern "C" JNIEXPORT void JNICALL 10 | Java_com_ayoubfletcher_protector_Holder_init(JNIEnv *env, jobject calling_object, 11 | jobject contextApp) { 12 | string currentPackageName = getPackageName(env, contextApp); 13 | if (currentPackageName != Data::getPackageName()) { 14 | raise(SIGSEGV); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /protector/src/main/java/com/ayoubfletcher/protector/AppLib.kt: -------------------------------------------------------------------------------- 1 | package com.ayoubfletcher.protector 2 | 3 | import android.app.Application 4 | 5 | open class AppLib: Application() { 6 | override fun onCreate() { 7 | super.onCreate() 8 | 9 | Holder.Instance.init(this) 10 | } 11 | } -------------------------------------------------------------------------------- /protector/src/main/java/com/ayoubfletcher/protector/Holder.kt: -------------------------------------------------------------------------------- 1 | package com.ayoubfletcher.protector 2 | 3 | import android.content.Context 4 | 5 | class Holder { 6 | 7 | external fun init(context: Context) 8 | 9 | companion object { 10 | 11 | val Instance by lazy { 12 | Holder() 13 | } 14 | 15 | init { 16 | System.loadLibrary("library") 17 | } 18 | } 19 | } --------------------------------------------------------------------------------