https://github.com/maoabc/nmmp
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation("com.github.TimScriptov:nmmp:Tag")
implementation("com.github.TimScriptov:preferences:Tag")
}
Preferences(File("path"), "name.json").init()
Prefs.setSdkPath("path") // ANDROID_SDK_HOME
Prefs.setCmakePath("path") // CMAKE_PATH
Prefs.setNdkPath("path") // ANDROID_NDK_HOME
Prefs.setRegisterNativesClassName("com/nmmedit/protect/NativeUtil")
Prefs.setVmName("nmmvm")
Prefs.setNmmpName("nmmp")
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()
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()
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()