• PSA: How to perform an in-place replacement of an APK without losing data

    From Maria Sophia@mariasophia@comprehension.com to comp.mobile.android on Fri Jul 31 21:35:11 2026
    From Newsgroup: comp.mobile.android

    PSA:
    How to perform an in-place replacement of an APK without losing data

    I am testing how to lock down an app so it's never updated, and in
    doing so, I needed to test changing the installer on some apps.

    So this PSA below covers two different critically important concepts.
    a. How to seamlessly update an app to a newer or older version
    b. At the same time how to seamlessly change the installer field
    c. Which is intended to break google play store updating of that app

    If you have the Aurora Google Store replacement client, you can run this.

    1. Find a link to the latest Aurora Google Play Store replacement
    <https://github.com/AuroraOSS/AuroraStore>
    <https://auroraoss.com/files>
    <https://gitlab.com/AuroraOSS/AuroraStore>
    <https://f-droid.org/packages/com.aurora.store/>

    2. Download the latest APK
    wget https://auroraoss.com/downloads/AuroraStore/Release/AuroraStore-4.8.4.apk
    => 2026-07-31 (7.23 MB/s) - 'AuroraStore-4.8.4.apk' saved

    3. Find the official name of the package already installed on Android
    adb shell pm list packages | findstr aurora
    => package:com.aurora.store
    => package:com.aurora.adroid

    4. Check what the current "installer" is set to
    adb shell dumpsys package com.aurora.store | findstr installer
    => returned no installerPackageName line

    5. Check what the current "version" fields are set to
    adb shell dumpsys package com.aurora.store | findstr version
    => versionCode=76 minSdk=23 targetSdk=37
    => versionName=4.8.1

    6. Run both a seamless replacement & change of the installer setting
    adb install -r -d -i null AuroraStore-4.8.4.apk
    => Performing Streamed Install
    => Success
    (r=replace but keep data, d=allow downgrade, i=set installer name)

    Now that the old app was removed from /data/app/com.aurora.store-*/base.apk
    And replaced with the new app of the same name...

    7. Check the newly installed version is as desired
    adb shell dumpsys package com.aurora.store | findstr version
    => versionCode=76 minSdk=23 targetSdk=37
    => versionName=4.8.4

    8. Check that the installer was set as desired
    adb shell dumpsys package com.aurora.store | findstr installer
    => installerPackageName=null

    Note that another way to accomplish (almost) the same results would be:
    adb uninstall -k com.aurora.store
    adb install -i null AuroraStore-4.8.4.apk

    The difference is that in-place replacement (install -r) is seamless.
    The delete-and-reinstall (uninstall -k + install) acts like a new instance.
    a. the app will behave as if it were newly installed
    b. hence, the shortcut will be removed from its homescreen location
    c. although data is preserved but cache may be removed
    d. the app identity is removed & added (e.g., launcher-icon placement)
    e. permissions may need to be re-granted
    f. and some runtime state is lost (e.g., notification channels)
    The app is removed, then installed again, and Android reattaches the
    preserved data but the app behaves like a fresh install .

    In both cases, persistent what's in /data/data/com.aurora.store/ remained
    a. User settings
    b. Preferences
    c. Login/session data
    d. Account tokens
    e. Configuration files
    f. Databases
    g. Cached information
    h. Customizations
    i. SharedPreferences XML files
    j. Internal app state files
    k. App-generated JSON/YAML/XML config files
    l. App-generated metadata
    m. App-specific logs
    n. App-specific cache stored inside /data/data
    o. Any other persistent files Aurora Store writes

    The key difference in results is in installation behavior:
    install -r = seamless upgrade
    uninstall -k + install = fresh install with old data reattached
    But no persistent data is lost in either method.
    --
    Posted out of the goodness of my heart to help others & to learn from them.
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Maria Sophia@mariasophia@comprehension.com to comp.mobile.android on Sat Aug 1 12:47:11 2026
    From Newsgroup: comp.mobile.android

    Maria Sophia wrote:
    4. Check what the current "installer" is set to
    adb shell dumpsys package com.aurora.store | findstr installer
    => returned no installerPackageName line

    This is a better method of finding the package installer name:

    adb shell dumpsys package eu.faircode.netguard | findstr installerPackageName
    => installerPackageName=com.android.vending
    adb shell dumpsys package com.termux | findstr installerPackageName
    => installerPackageName=com.google.android.packageinstaller
    adb shell dumpsys package com.aurora.store | findstr installerPackageName
    => installerPackageName=null

    Below is a short list of possible package installers I've found on the net.

    Major Official App Stores
    com.android.vending - Google Play Store
    com.amazon.venezia - Amazon Appstore
    com.samsung.android.app.samsungapps - Samsung Galaxy Store
    com.huawei.appmarket - Huawei AppGallery
    com.xiaomi.mipicks - Xiaomi GetApps
    com.oppo.market - Oppo App Market
    com.heytap.market - Realme / Oppo unified store
    com.vivo.appstore - Vivo App Store
    com.tencent.android.qqdownloader - Tencent MyApp Store
    com.baidu.appsearch - Baidu Mobile Assistant
    com.qihoo.appstore - 360 Mobile Assistant

    Sideloading / Manual Installers
    null - manually sideloaded APK
    adb - installed via ADB directly
    com.android.packageinstaller - system package installer (tapping an APK)
    com.google.android.packageinstaller - older Android versions
    com.miui.packageinstaller - MIUI APK installer
    com.samsung.android.packageinstaller - Samsung APK installer

    Device Management / Enterprise Installers
    com.android.managedprovisioning - Android Enterprise provisioning
    com.afwsuite.installer - AFW (Android for Work) installer
    com.airwatch.androidagent - VMware AirWatch
    com.mobileiron - MobileIron MDM
    com.soti.mobicontrol.agent - SOTI MobiControl
    com.blackberry.enterprise.bes - BlackBerry UEM
    com.google.android.apps.work.store - Google Play for Work

    OEM / Carrier Installers
    com.verizon.vzwappinstaller - Verizon
    com.att.android.attsmartwifi - AT&T
    com.tmobile.pr.adapt - T-Mobile
    com.lge.appstore - LG SmartWorld
    com.htc.appupdater - HTC App Installer

    Developer / Debug Installers
    com.android.shell - installed via shell commands
    com.android.systemui - system-initiated install
    com.google.android.gms - Play Services installing modules
    com.google.android.gms.policy - policy-driven installs

    Special Cases
    packageinstaller - generic fallback
    installerPackageName="" - empty string (rare bug)
    installerPackageName not present - OEM hides the field

    Any others?
    --- Synchronet 3.22a-Linux NewsLink 1.2