• Re: PSA: A python script to clone your phone exactly, over Wi-Fi or USB

    From Maria Sophia@mariasophia@comprehension.com to comp.sys.mac.system,alt.os.linux,alt.msdos.batch,alt.comp.os.windows-11,alt.privacy on Friday, August 21, 2026 00:30:21
    From Newsgroup: alt.privacy

    Maria Sophia wrote:
    Updates will go into the aforementioned thread, but I wanted those on
    these related operating system newsgroups to be able to benefit also.

    As far as I'm aware, this functionality exists nowhere else on earth, so
    it's worth summarizing what it does, for those who didn't read the code.

    Imagine you want to take a snapshot of your exact home screen setup, which exactly reproduces every single pane/page in the same order, the folders
    you've organized your app icons into, and in the same order including the
    names and locations of any loose app icons, and then it reproduces the
    actual app installers (APKs) themselves, in that order onto your PC.
    a. Same homescreen panels
    b. Same homescreen folders
    c. Same app icons
    d. Same versions too
    e. All over your local LAN (or connected via USB to your PC)
    f. Without any need for any mothership or cloud or Internet account

    That would be a pretty neat APK archival & restoral process, right?

    That is what this Python script (apkhome.py) does, in addition to creating
    an adb batch script (which can run on any platform) to re-install the apps, such that the script allows a perfect clone of the original visual setup.

    Note that the script does not back up every single app on the phone.

    While that would be so trivial as to not need this much coding to do, the
    focus of this script is on replicating the home screen look and feel,
    including bringing over every single app subversion to the new phone.

    Specifically, if a package is installed on the phone, but if there is no
    app launcher icon sitting on the home screen, then it's not replicated.

    An overarching goal of this script is to require nothing on the net.

    Instead of relying on cloud backups (like Google Drive) or proprietary manufacturer software, this script uses a home screen app backup
    (specifically from TeslaCoils' last known good version of Nova Launcher)
    and a developer tool called ADB (Android Debug Bridge) to copy everything locally over your Wi-Fi network or a USB cable onto your desktop PC.

    The first thing it does is read your homescreen layout from the nova db.
    That layout includes everything needed to exactly replicate the homescreen. Then adb finds every app installer on your phone for every app icon.
    The script re-creates the exact folder hierarchy on your PC with the APK. Lastly, it generates a restoration script to restore on a new phone.

    Optionally, the script features a debug mode to test in shorter time.
    And the script has smart APK handling for the modern split APK structure.
    The script handles visual version tracking and it keeps a detailed log.
    Since it could take a while to run, a Control+C was gracefully added.

    The only prerequisites (other than the phone being on the LAN) are:
    a. A nova backup file
    b. ADB on a PC
    c. Python

    As far as I'm aware, this functionality exists nowhere else on earth.
    However, I only tested it with my phone and my PC, which are:
    Android 13, Samsung Galaxy A32-5G, locked bootloader, de-googled
    (i.e., there is no account for any OEM, not Google, not Samsung)
    Windows 10, Python 3.14.1

    Of course, the major disadvantage of this methodology is the requirement
    for the Nova Launcher (which is free) but at this point in time, I know of
    no other way to programmatically obtain the exact homescreen layout without being rooted, than to access the internal database of 'some' launcher app.

    Therefore, a major obvious possible improvement in this replication process would be for us to collectively figure out HOW to obtain the names, targets
    and positions of the panes, folders and app-launcher icons WITHOUT having
    to use any specific launcher on the phone (& without needing to be rooted).
    --- Synchronet 3.21e-Win32 NewsLink 1.2
  • From Kerr-Mudd, John@admin@127.0.0.1 to comp.sys.mac.system,alt.os.linux,alt.msdos.batch,alt.comp.os.windows-11,alt.privacy on Friday, August 21, 2026 17:42:40
    From Newsgroup: alt.privacy

    On Fri, 21 Aug 2026 00:30:21 -0800
    Maria Sophia <mariasophia@comprehension.com> wrote:

    Maria Sophia wrote:

    I see you're still at it. Please only post code that applies to relevant
    groups once it's been thoroughly tested, TIA.
    --
    Bah, and indeed Humbug.
    --- Synchronet 3.21e-Win32 NewsLink 1.2