home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.mobile.android      Discussion about Android-based devices      236,147 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 235,444 of 236,147   
   Maria Sophia to All   
   Tutorial: How to save and reinstall spli   
   05 Jan 26 15:23:00   
   
   From: mariasophia@comprehension.com   
      
   Happy New Year!   
      
      
   This is a first pass untested tutorial so it needs refinement!   
   I hope this is a team effort. Everyone can add value where it's needed.   
      
   It attempts to clarify...   
    1. Why split APKs exist.   
    2. What they are in practical terms.   
    3. Where the real installers live.   
    4. Why /data/app is not the installer.   
    5. How to save installers correctly.   
    6. How to reinstall them correctly.   
    7. Why you cannot merge split APKs.   
    8. Which tools handle which bundle formats.   
    9. How adb behaves for split apk installation (root vs non-root).   
   10. What are actionable steps for preservation & reuse.   
      
   ----------------------------------------------------------------------   
   PSA: How to save and reinstall split APK bundles across Android devices   
   ----------------------------------------------------------------------   
      
   Note: An "APK" is not necessarily an "installer" per se.   
      
   Most Android users assume that saving an app for later reuse means keeping   
   a single APK file on storage medium, and re-using that single APK when   
   populating a new device (or the same device after a factory reset).   
      
   That used to be true. But it is no longer true for most apps distributed   
   through Google Play obtained either by Google Play or by Aurora, or by any   
   service that uses modern Android App Bundles (AAB).   
      
   This PSA tries to explain what a split APK bundle is, why it exists, how   
   Android installs it, and how to save and reinstall these bundles across   
   devices regardless of where the app originally came from (Play Store,   
   Aurora, GitHub, F-Droid, etc).   
      
   This is not a backup guide. It is a preservation guide. A way of life.   
      
   The philosophical goal (always) is to save the installer at the moment of   
   installation so we can reinstall the app on any Android device tomorrow.   
      
   1. What is a split APK bundle?   
      A split APK bundle is a set of multiple APK files that together form a   
      complete Android app. A typical bundle looks like:   
          base.apk   
          split_config.arm64_v8a.apk   
          split_config.en.apk   
          split_config.xxhdpi.apk   
      
      The base.apk contains the core app code and manifest.   
      The other APKs contain architecture-specific code, language resources,   
      and screen-density resources.   
      
      Android merges these at install time. A   
      single base.apk is not a complete app for most modern packages.   
      
   2. Why Google moved to split APKs   
      Google Play now uses Android App Bundles (AAB).   
      Instead of shipping one APK containing every architecture, language,   
      and resource, Google generates only the pieces our device needs.   
      
      This doesn't help us so much as it reduces Google's storage needs.   
      a. smaller downloads   
      b. faster updates   
      c. less storage overhead   
      d. automatic per-device optimization   
      
      Benefits to users who want to archive installers: none.   
      Split APKs make long-term preservation harder than ever before.   
      
      That's why this tutorial is being written.   
      Because things aren't as simple as a single base APK anymore.   
      
   3. Where Android stores installed split APKs   
      Once installed, Android forever stores the installed app in:   
          /data/app//base.apk   
          /data/app//split_config.*.apk   
          (at least until the app is deleted from your system)   
      
      Note this is the installed app. Not the original installer!   
      We can think of them as the decompressed, processed, optimized   
      version of the app, but not the original installer package we   
      downloaded from Play, Aurora, GitHub, F-Droid, etc.   
      
      Accessing /data/app requires root or a specialized extractor.   
      
   4. Luckily, Aurora automatically saves downloaded split APKs in:   
          /Android/data/com.aurora.store/files/Downloads/   
      These *are* the original installer APKs!   
      
      This directory may contain multiple APKs for a single app.   
      These are the files we must preserve.   
      Note: Aurora Store 4.x no longer allows choosing a custom   
            download directory (due to Android 11 restrictions).   
      
      Note that adb cannot access /data/app unless the device is rooted.   
      Non-root APK extractors also cannot read /data/app and usually   
      extract only base.apk, which is incomplete for split apps.   
      
      Root-capable extractors can pull the installed base.apk and   
      split_config APKs, but these are not guaranteed to match the   
      original installer. Aurora saves the actual installer bundle   
      (base + splits) in its private Downloads directory so these   
      are the files to preserve for portable, future-proof reinstallation.   
      
      Note that, by default, Aurora does NOT save installers, so   
      we need to ensure Aurora is configured to keep downloaded APKs   
      after installation (i.e., not to delete them after installation).   
      
   5. Given we don't know offhand if an app installer is split, we   
      likely will need to treat every app as split unless proven otherwise.   
      
      Since our goal is to save installers for reuse on any device, assume:   
      a. every app may be split   
      b. base.apk alone is insufficient   
      c. we must save all APKs associated with the install   
      d. we must reinstall them using a split-APK installer   
      
      This applies regardless of source: Google Play, Aurora Store, F-Droid,   
      GitHub, or direct APK downloads.   
      
   6. That means we need to know how to save a split APK bundle.   
      At the moment of installation, we need to copy all APKs associated   
      with the app into a permanent archive.   
      
      A typical archive directory might look like:   
          MyApp_1.2.3/   
            base.apk   
            split_config.arm64_v8a.apk   
            split_config.en.apk   
            split_config.xxhdpi.apk   
      
      Do not rename the files. Their names encode important metadata. If using   
      Aurora, disable "Delete after installation" so that the installer files   
      are not deleted after Aurora downloads and runs the APK installers.   
      
   7. How to reinstall a split APK bundle on another device   
      Android cannot install multiple APKs by tapping them.   
      We must use a split-APK installer.   
      
      Recommended tools:   
      a. SAI (Split APKs Installer)   
            
      b. APKMirror Installer   
            
      c. adb install-multiple (advanced users)   
            
      
      Procedure using SAI:   
      i.   Install SAI on the target device.   
      ii.  Open SAI -> Install APKs.   
      iii. Select all APK files for the app (base + splits).   
      iv.  Install.   
      
      SAI will feed the entire bundle to Android's API aptly called   
      "PackageInstaller.Session API", which is the correct method   
      
   [continued in next message]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca