• GeneralSolved
  • How to extract the apk of a package (installed in a secondary profile) ?

Is there a way to make a copy (extract?) the apk of a package I have installed in a secondary profile?

Background: I have two GrapheneOS phones on build 2024040900. An older Pixel 5 I use as a testing/learning GrapheneOS phone on wifi and the newer one with my SIM. On the newer main phone I've moved over to using PlayStore in the primary profile to download apps and pass them on to the other profiles. A year or so ago on the testing phone, I used Aurora to install the Garmin Explore App in a secondary profile.

On the main phone the updated Garmin app does not work as well as the older version on the testing phone. So I would like to extract the apk from the testing phone. I prefer to avoid using apkmirror (or similar) to get hold of the older version I have on the testing phone.

I downloaded apk-extractor (quite an old app for earlier versions of Android) from f-droid but it doesn't obtain the storage permissions it wants - even if I use storage-scopes and give it a folder on an external usb stick.

If extracting an apk is no longer possible, please could someone recommend which apk mirror is most trustworthy to obtain an older apk version.

Thanks.

UndercoverBozo Thank you for the pointer - and I have Amaze file manager installed now. It has an App Manager with a 'backup' option which seems to extract the selected app's apks into an Amaze/APK folder.

In this case I get four apks - the main big one ...garmin.apps.explore.apk + ...garmin.apps.explore_arm64_v8.apk + two small _en.apk + _xxhdpi.apk

I think this is called split apks and I guess I require some sort of split apk installer. I've not yet found a way to use Amaze to do this. Just installing the largest apk doesn't give a functioning app - whether using Amaze or the default filemanager.

After a did around on the web, I've found a few likely split apk installer stuff including SAI; I have a suspicion that Android 14 will not like them.

If anyone has any further helpful hints whilst I'm digging around, I'd be very grateful.

    === SOLVED === but how do I add a SOLVED TAG?

    UndercoverBozo On mine I have an APK folder under documents. On the left draw.

    Sorry, yes, that is where my Amaze/APK folder is too.

    d4f2 Kanade works for me.

    I will try this next, thank you. In the mean time:

    SOLVED - the good news is with the helpful pointer from @UndercoverBozo the split apks have been backed up and installed on the second GrapheneOS device.

    For future readers, this is what worked for me (all the detail is for anyone like me at my end of the ability spectrum; all the experts here are at the other end - sorry to them for the long detail :)

    My intention was to make a copy of an older app (free but commercial=Garmin), that was no longer available from the PlayStore, and install it on a second device and avoid using an apk mirror.

    • apk-extractor (from f-droid) did NOT work for me
    • Install Amaze file manager on device A (or may be Kanade or APK Explorer & Editor will work too, but I've not tested yet)
    • Use Amaze to backup the app to external USB storage
      (there's some hokey-pokey with storage permissions, but Amaze leads you through it)
    • On this occasion, the app was 4 apks (known as a split apk I think)
    • I did not find a way to install the split apks using Amaze or the default filemanager
    • On device B install APK Explorer & Editor
    • Using APK Explorer & Editor select all the split apks for the app (four in this instance) on the external USB storage and then you will find the install option

    There might be something else here of interest to some people. I read in the forum quite frequently that some GrapheneOS users don't want to use the sandboxed PlayStore and head off to the Aurora Store despite the risks. Maybe people in that situation could use a secondary device to obtain their apps/apks direct from the PlayStore and then use this app backup technique to move the app to their primary device. Catch would be no easy updates of course. For myself, I just enable the Sandboxed PlayStore/Services stuff in the primary profile to install or update an app, then Sandboxed PlayStore/Services is disabled again immediately afterwards and then push the app to the required secondary profile.

    This has been a great learning experience. Thank you for all your help.

      I shoud have said, Amaze file manager backs up the app to its own APK folder in the left draw, as @UndercoverBozo points out. I had to copy and paste the split apks into a folder in the external USB drive.

      15 days later

      tornsail Hey I know this issue was solved a couple of weeks ago, but it's actually regarding your last point where you say you keep GPlay Store + Services disabled, except when you install or update an app, after which you disable it again. As I'm sure you've found, an issue with keeping it disabled is the fact that you might not know when certain apps actually need to be updated, and they won't automatically be updated, except while GPlay Store is enabled.

      I have a small guide for an alternative way to keep them updated, if you're interested.

      You may find this makes it easier to keep the apps that were installed by Play Store updated, while also keeping Google Play Store + Services in your main profile disabled as much as possible.

      Make a new user profile and call it something like 'GApps Updater'. In this profile, install Google Play store + Services, then sign into it with the same account that's signed in on your Owner profile. After setting up this user profile, go to the Manage users / Multiple users menu on your Owner profile. Then make sure Allow running in background & App installs and updates are both enabled for your GApps Updater profile.

      Then, when you next install an app from the GPlay Store on your Owner profile, tap the little down arrow on the right side of the Install button, which gives you the option to install on more than one 'device' that you are signed in to. Make sure that, as well as 'This device', the other 'device' is ticked as well (it will appear as the same phone model you are using, this is the GApps Updater profile). Once ticked, some text will appear - Save app sync preferences. Tap that text, so in future you can just tap the install button as normal.

      From then onwards, every time you install an app using the GPlay Store in your Owner profile, it will automatically queue itself to be installed into the GApps Updater profile, next time you open that profile.

      Let's say, you just installed Spotify in the Owner profile. When you next open the GApps Updater profile, after a few seconds, a message will pop on screen, Spotify: Do you want to install this app? After you tap Install, and the app has finished installing, long press on the new Spotify icon that will have appeared on your homescreen, then tap App info. Now that you are in the App info settings menu for Spotify, tap Disable, as you don't want to actually use any apps on this profile (or have them running in the background at all), it will only be for updating your Play Store apps.

      Now once every 1 - 2 days, you can open this profile and it will update your Play Store installed apps automatically, in the background. Since an app updated in one profile, is updated across the entire device, you can pretty much just let it do it its thing while you switch back to whatever profile you were on before. I recommend turning on notification forwarding so you can still be notified about anything that might require your attention.

      Two quick things to add.

      One - you may want to / generally prefer installing an app from inside the GApps Updater profile, and then temporarily enabling GPlay Store in the Owner profile to let it install there. Just be aware you will have to tap the down arrow on the right side of the install button, tick both devices and save sync preferences on that profile as well, as it doesn't automatically work both ways.

      Two - for any apps that were already installed by Google Play Store before you made the GApps Updater profile, the best way to get these apps into the new profile and get them to update automatically, is to open GPlay Store on your Owner profile, tap your account's profile picture / initial in the top right —> tap Manage apps and device —> tap the Manage tab at the top (next to Overview) —> here you will see your installed apps. Tap on each app here. Underneath the uninstall button you will see the text Available on more devices and under that there will be your device model, with an Install button next to it. Tap each app in turn and tap that Install button. (There are multiple other ways of achieving this, including using the Manage users menu to install each app into the GApps Updater profile, but that will cause a very slight issue as the first time each of these apps needs to update, it will not be able to automatically, until you have tapped yes, whereas, this way, it means after waiting for each app to be installed in that profile by Google Play Store and tapping yes, they will then update automatically in future, whenever they happen to receive updates. It just gets that initial permission for GPlay Store to automatically update all apps in the background, out of the way).

      Anyway just thought I would share that method with you as it's one way of keeping stuff up to date with your configuration :)

        roamer4223 Make a new user profile and call it something like 'GApps Updater'.

        ...

        roamer4223 open this profile and it will update your Play Store installed apps automatically, in the background. Since an app updated in one profile, is updated across the entire device

        Hey, that is a very clever setup you have.

        Thank you very much for taking the time to share it with me and document it so comprehensively for everyone. Also the extra two tips to cover the implementation details - I really appreciate that extra advice.

        I'm going to implement this as you suggest because nothing I have in the Owner profile requires Google Play Services and, as you point out, your scheme will actually be easier to manage because all that is required is to log in to the PlayStore profile for updates and then end that session. Love it ... thank you :)

        roamer4223 As an aside, in my opinion your post deserves preservation in some way so that others can find it easily when they are deciding how to implement GrapheneOS for their use case. I use the posts in the forum and the search box as a form of wiki but stuff gets quite hard to find very quickly. It makes me sad to think that someone like you might spend forty-five (plus, plus) minutes documenting something beautifully for my benefit but that others might not find the same post in the future.

          tornsoul ohh wow these are some really genuinely nice messages to see when I log back in. I'm really glad to hear you found my method useful, I admit I was worried it just seemed useful to me but would seem more trouble than it was worth to everyone else.

          I think it's often severely overlooked how much it can mean to a person to let them know that something they put a lot of effort into is actually appreciated and genuinely helpful.

          I hope it doesn't seem like I'm exaggerating when I say you've made my week :)

          If you think more people would find this useful, I am happy to add to it or make it clearer if I can. And I'm here to answer any questions as well.

          Thanks mate