Skip to content

Conversation

@prateek-who
Copy link

Automatically checks the file extension to see if it's apk or a split apkm. Incase it is split, automatically merges it and prepares an apk for patching.

@LisoUseInAIKyrios LisoUseInAIKyrios changed the title Automatic split apk merging feat: Split apk merging Jan 31, 2026
@LisoUseInAIKyrios
Copy link
Contributor

Please rebase off dev branch and resolve conflicts. There has been a few changes on dev that are not on main yet.

@LisoUseInAIKyrios
Copy link
Contributor

This may need a small tweak, or maybe this specific app isn't working right with ARSCLib. This app has issues with AntiSplit-M as well:

SEVERE: se.vidstige.jadb.JadbException: Could not install morphe.apk: Failure [INSTALL_FAILED_MISSING_SPLIT: Missing split for com.myfitnesspal.android]

If I run the same apkm thru APKEditor it then works with with CLI patching:
java -jar APKEditor-1.4.7.jar m -i myfitnesspal_25.50.0.apkm

@prateek-who
Copy link
Author

Did I do it properly. Or did I mess up. This is the first time I am rebasing anything

@LisoUseInAIKyrios
Copy link
Contributor

Yes this looks right.

If that MyFitness app can be figured out it would be good, but at a minimum only Reddit needs to work for this to be merged.

@prateek-who
Copy link
Author

will check both

@prateek-who
Copy link
Author

This may need a small tweak, or maybe this specific app isn't working right with ARSCLib. This app has issues with AntiSplit-M as well:

SEVERE: se.vidstige.jadb.JadbException: Could not install morphe.apk: Failure [INSTALL_FAILED_MISSING_SPLIT: Missing split for com.myfitnesspal.android]

If I run the same apkm thru APKEditor it then works with with CLI patching: java -jar APKEditor-1.4.7.jar m -i myfitnesspal_25.50.0.apkm

I just tried to run morphe-cli with this app along with the 1.9.0 patch.mpp file (assuming we are running ARSCLib so that would throw an issue) but it seems like the app was patched fine. Gradle built successfully. I even got the temp merged apk. If there was an error merging here, it should have thrown an error right?

@LisoUseInAIKyrios
Copy link
Contributor

If I first ran the apkm thru APKEditor, then patching/installing worked with the apk file.

But if I tried patching and installing (--install) using apkm it patches successfully but fails during installation.

@prateek-who
Copy link
Author

ah, I will have to check this

@prateek-who
Copy link
Author

Wait, there are some issues with my method. Don't merge this yet. I'll have to further test it.

@prateek-who
Copy link
Author

Currently there are issues with my method. I'll need to further test this. Will rework this.

@prateek-who prateek-who closed this Feb 1, 2026
@LisoUseInAIKyrios
Copy link
Contributor

See the commit for URV that I previously mentioned. It uses APKEditor and works for this fitness app without issues.

@prateek-who
Copy link
Author

Yup, will look into it

@prateek-who
Copy link
Author

Yup, things work with APKEditor, when I pull the jar to make it work. Is that the way ahead?

@LisoUseInAIKyrios
Copy link
Contributor

Apkeditor uses ARSCLib, and is made by the same developers.

Try looking what apkeditor is doing with ARS and if it's simple then maybe the same can be done here. If it's complicated, then pull in apkeditor and use it.

@prateek-who
Copy link
Author

sure thing

@prateek-who
Copy link
Author

Just by skimming thorough stuff with AI it seems like ARSC does like half the work. The other half of the merging work is done by a bunch of other packages that APKEditor also includes. Looks like adding the jar file as a dependency is the only option for now. I maybe be wrong on this but this is what I could find. Do I use this method and reopen the PR?

@LisoUseInAIKyrios
Copy link
Contributor

Ok if sounds like apkeditor jar should be used. See whatever apkeditor is doing in it's main method and it might be just a few lines of code to do the same. Or if that's undesirable and there's a way to turn off it's console output then could call it's main method using a string command m -i input.apk -o merged.apk

You can reopen this PR. If it won't let you then make a new PR.

@cyberboh
Copy link

cyberboh commented Feb 1, 2026

I usually add -clean-meta and -f while merging APKM to remove all redundant META-INF signature adn delete output path.

According to APKEditor -h
-clean-meta Cleans META-INF directory along with signature block.
-f Force delete output path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants