Skip to content

timscriptov/nmmp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ceb3417 · Jan 29, 2024

History

54 Commits
Jan 23, 2024
Sep 12, 2023
Jan 29, 2024
Jan 23, 2024
Jan 29, 2024
Sep 12, 2023
Sep 17, 2023
Jan 23, 2024
Sep 17, 2023
Jan 23, 2024
Sep 11, 2023
Jul 26, 2023
Oct 30, 2023
Jan 23, 2024

Repository files navigation

Original REPO:

https://github.com/maoabc/nmmp

Screenshots

Main

Add it in your root build.gradle at the end of repositories:

allprojects {
    repositories {
        maven { url 'https://jitpack.io' }
    }
}

Add the dependency:

dependencies {
    implementation("com.github.TimScriptov:nmmp:Tag")
    implementation("com.github.TimScriptov:preferences:Tag")
}

Init preferences:

 Preferences(File("path"), "name.json").init()

Environment path:

Prefs.setSdkPath("path") // ANDROID_SDK_HOME
Prefs.setCmakePath("path") // CMAKE_PATH
Prefs.setNdkPath("path") // ANDROID_NDK_HOME

Change lib name and class name:

Prefs.setRegisterNativesClassName("com/nmmedit/protect/NativeUtil")
Prefs.setVmName("nmmvm")
Prefs.setNmmpName("nmmp")

Protect APK:

val input = File("input.apk")
val output = File("output.apk")
val rules = File("rules.txt")
val simpleRules = SimpleRules().apply {
    parse(InputStreamReader(FileInputStream(rules), StandardCharsets.UTF_8))
}
val filterConfig = SimpleConvertConfig(BasicKeepConfig(), simpleRules)
ApkProtect.Builder(ApkFolders(input, output)).apply {
    setInstructionRewriter(RandomInstructionRewriter())
    setFilter(filterConfig)
    setLogger(null)
    setClassAnalyzer(ClassAnalyzer())
}.build().run()

Protect AAR:

val input = File("input.aar")
val output = File("output.aar")
val rules = File("rules.txt")
val simpleRules = SimpleRules().apply {
    parse(InputStreamReader(FileInputStream(rules), StandardCharsets.UTF_8))
}
val filterConfig = SimpleConvertConfig(BasicKeepConfig(), simpleRules)
AarProtect.Builder(AarFolders(input, output)).apply {
    setInstructionRewriter(RandomInstructionRewriter())
    setFilter(filterConfig)
    setLogger(null)
    setClassAnalyzer(ClassAnalyzer())
}.build().run()

Protect AAB:

val input = File("input.aab")
val output = File("output.aab")
val rules = File("rules.txt")
val simpleRules = SimpleRules().apply {
    parse(InputStreamReader(FileInputStream(rules), StandardCharsets.UTF_8))
}
val filterConfig = SimpleConvertConfig(BasicKeepConfig(), simpleRules)
AabProtect.Builder(AabFolders(input, output)).apply {
    setInstructionRewriter(RandomInstructionRewriter())
    setFilter(filterConfig)
    setLogger(null)
    setClassAnalyzer(ClassAnalyzer())
}.build().run()