Recently I got to know a thing called split apks, and found the slices as invalid apk files, only the base is. Unfortunately, this means the usual default package installer is unable to handle this, and as such I got to know another thing called SAI, a split apk installer, capable of working with or without root. However, being curious, I wondered how it all worked internally, and began to do a bit of research. I didn't get far, but I got to find out about pm install commands, and I happen to have root access which is apparently mandatory if I am to go this path, as the terminal won't let me run pm install-create without first running su.

The next step is pm install-write all the slices, and this is where I fall. The most obvious way for me was to cd to the directory of the slices and pm install-write them one at a time, which didn't allow me to do so, and it seems to be expecting an int rather than a directory string.

Questions (TL; DR):

  1. Can I install split apks without any extra apps (in my example, SAI)?

  2. Am I in the right direction with pm install commands?

  3. If the answer to question 2 is yes, what am I doing wrong, and what should I be doing instead (it seems to want an int instead of a directory string, not sure how to convert)?

  4. Are there any other methods I can explore (preferably rootless, but root is also fine)?

Thank you for your time.

  • 2
    Tested pm myself on Pie. Let's suppose that our package is called com.example.apk: you'd install it with pm install com.example.apk. Next, to install the split parts, you need to issue pm install -p com.example com.example.split.apk, where -p com.example refers to the package name of the base package, and com.example.split.apk is your split package. Let me know if it works for you. – Grimoire Apr 22 '19 at 16:50
  • @Salesman: I assume the question is about "App bundles" and if I remember correctly the different split-up APKs all have the same package name. Installing such a slit-aup app should be possible using bundletool. – Robert Apr 22 '19 at 17:38
  • 1
    @Robert Yes, seems like we're referring to the same thing. In that case, either bundletool from a computer or pm from a rooted device will do the job. – Grimoire Apr 22 '19 at 19:46
  • @Salesman I'm using a P2a42 rooted with magisk 18.1 running AEX 6.4, and the pm install command keeps failing, saying it can't read the file. I've tried chmod 777 on all the files and it still won't even install the base apk. I've yet to try the slices, but I assume they'll be unreadable as well. Anything I can do? – 404 Name Not Found Apr 23 '19 at 14:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.