KuhakuPixel / AceTheGame

open source security auditing tools for games on android and linux. Containing memory scanner/editor, apk GUI, value freezer, android non root support and many more!
GNU Affero General Public License v3.0
289 stars 33 forks source link

Unable to patch Unity based Apps #83

Open DeltaPy opened 9 months ago

DeltaPy commented 9 months ago

Hello, I'm trying to patch a Unity 3D VR app for the Meta Quest, but after executing .\modder.bat patch -m .\downloaded-app-folder the script responds with "Cannot find launchable activity from apk".

I tried modifying the Patcher.kt code and setting val launchableActivity = "com.unity3d.player.UnityPlayerActivity" after building the project and running the patcher again, it runs into a NullPointerException (output below).

Output: I: Using Apktool v2.9.0-22-bea15e6f-SNAPSHOT on base.apk I: Copying raw resources... I: Copying raw manifest... I: Baksmaling classes.dex... I: Baksmaling classes2.dex... I: Copying assets and libs... I: Copying unknown files... I: Copying original files... INFO : decompiled at C:\Users\test\AppData\Local\Temp\ModderDecompiledApk13937601818461560685 java.lang.NullPointerException at modder.Resource.CopyResourceFile(Resource.kt:25) at modder.Patcher$AddMemScannerLib$1.invoke(Patcher.kt:193) at modder.Patcher$AddMemScannerLib$1.invoke(Patcher.kt:177) at modder.Patcher.IterateNativeLibArchDir(Patcher.kt:142) at modder.Patcher.AddMemScannerLib(Patcher.kt:177) at modder.Patcher.AddMemScanner(Patcher.kt:267) at modder.ModderMainCmd.Patch(ModderMainCmd.kt:116) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:580) at picocli.CommandLine.executeUserObject(CommandLine.java:2066) at picocli.CommandLine.access$1500(CommandLine.java:148) at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461) at picocli.CommandLine$RunLast.handle(CommandLine.java:2453) at picocli.CommandLine$RunLast.handle(CommandLine.java:2415) at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273) at picocli.CommandLine$RunLast.execute(CommandLine.java:2417) at picocli.CommandLine.execute(CommandLine.java:2170) at modder.Main$Companion.cliInit(Main.kt:24) at modder.Main$Companion.main(Main.kt:38) at modder.Main.main(Main.kt).

The launchableActivity that I setted is probably wrong. If someone can please explain to me what is the expected output of the LaunchableActivityToSmaliRelativePath() function in Patcher.kt, I can try to make it work as I can't find enough information online.

Thank you!

KuhakuPixel commented 9 months ago

thanks for the report

can you tell me the apk name? so I can reproduce