• Re: Extracting WiFi Passwords - SOLVED AT LAST!

    From Java Jive@21:1/5 to All on Sat Nov 9 12:10:47 2024
    XPost: comp.mobile.android

    On 2024-11-09 01:01, Java Jive wrote:

    In response to Andrews' comments, I think I need to clarify these. In particular, the adb command given is probably wrong, because, after all
    the attempts to uninstall and reinstall Perl and Java the actual command
    I gave had fallen off the end of the DOSKey list, so I wrote it, late
    last night, from memory. However, I got it from here and can now tell
    that I must have misremembered it (312-314):

    https://gist.github.com/Pulimet/5013acf2cd5b28e55036c82c91bd56d8

    So the (corrected) full procedure is:

    1. <path>\adb backup -all -f backup.ab

    ... creates backup.ab in the current directory

    2. Install or update to the latest Java Runtime Environment,
    currently 1.8.0_431:

    https://www.java.com/en/download/help/download_options.html

    3. Download Nelenkov's abe*.jar file:

    https://github.com/nelenkov/android-backup-extractor https://github.com/nelenkov/android-backup-extractor/releases/download/latest/abe-3e9a273.jar

    4. Give the command (without the square brackets around the password,
    they are merely a convention signifying that it is an optional parameter):

    java -jar <path>\abe-3e9a273.jar unpack <path>\backup.ab
    <path>\backup.tar [password]

    5. The resulting tar file can be extracted by 7-zip.

    6. Search the contents of the extracted files for an SSID known to be
    on the device, mine were in:

    \apps\com.android.providers.settings\d_f\flattened-data

    --

    Fake news kills!

    I may be contacted via the contact address given on my website:
    www.macfh.co.uk

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andrews@21:1/5 to Andrews on Sat Nov 9 14:02:53 2024
    XPost: comp.mobile.android

    Andrews wrote on Sat, 9 Nov 2024 04:54:25 -0000 (UTC) :

    Single app backup (the app has to actually be installed already).
    C:\app\editor\android\scrcpy> adb restore myAndroidBackup.ab

    Bear in mind, for those who don't already know it, Android *never* deletes
    the actual installer that was used to install an app, so it's there.

    You just have to find it.

    Also, note it's far easier to manage Android from Windows than from the
    phone (for so many obvious reasons, I won't even list them for you).

    So let's assume we want a backup on Windows of osmand~ *and* its data.

    First you have to find the package name if you don't already know it.
    adb shell pm list packages | findStr /i "osmand"
    package:net.osmand.plus

    Then you have to find the location of the APK stored on your phone.
    adb shell pm path net.osmand.plus
    package:/data/app/~~k-jK7n2qHWcW_giNy6oVEA==/net.osmand.plus-6ws8wQWIkEi8vVgL5q3EdA==/base.apk

    Then you can copy that APK manually if that's what you really want to do.
    adb pull /data/app/~~k-jK7n2qHWcW_giNy6oVEA==/net.osmand.plus-6ws8wQWIkEi8vVgL5q3EdA==/base.apk

    Since *every* stored APK on Android is named, "base.apk", rename it:
    move base.apk net.osmand.plus_bck.apk

    But nobody would copy an apk that way (unless they're writing scripts).
    That's why they made all those free Android APK extraction tools.
    <https://play.google.com/store/apps/details?id=de.onyxbits.listmyapps>
    <https://play.google.com/store/apps/details?id=com.jenos.shareapkfile>
    <https://play.google.com/store/apps/details?id=sk.styk.martin.apkanalyzer>

    Now that you have the APK backed up, it's time to use adb's data backup:
    adb backup -f net.osmand.plus_bck.ab net.osmand.plus
    WARNING: adb backup is deprecated and may be removed in a future release
    Now unlock your device and confirm the backup operation...

    Now you have both the installer & the data on your Windows system:
    dir *osmand*
    11/09/2024 05:45 AM 146,644,539 net.osmand.plus_bck.apk
    11/09/2024 05:50 AM 47 net.osmand.plus_bck.ab

    Note that I'm not sure what is in that data ball of string since the help
    for adb backup says you need to copy over some things manually from your sdcard. I suspect that's the internal sdcard they were referring to since
    some people don't have an external sdcard.

    To find where sdcard information is installed, I will *guess* it's in the information that is spit out with a query using adb. Maybe this query?
    adb shell pm dump net.osmand.plus > net.osmand.plus_bck.txt

    That file is over eight thousand lines long, so I'm not sure if it tells us where the map data is stored & whether or not that's backed up.

    Anyone know how to find the map data for osmand if it's stored on your
    external sdcard? (Of course, you know where you put it - but this is for general use where the user is backing up a device so they might not know.)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Java Jive@21:1/5 to Java Jive on Sat Nov 9 01:01:04 2024
    XPost: comp.mobile.android

    On 2024-11-09 00:08, Java Jive wrote:

    There is a command ...
      <path>\adb backup
    ... which creates a backup of the phone or tablet on your computer.
    However, the backup so created, called backup.ab, is a unique tar file
    format that almost nothing else can read as is, though there are neat workarounds as long as it is not encrypted; however, because my tablet
    is encrypted, so is the backup, which means that the simple workarounds
    don't work.

    A whole Perl upgrade later, where the biggest problem was actually uninstalling the previous version, to run a Perl script to extract the contents resulted only in a message that it couldn't do anything with
    this version 4, a version later than that for which it was written.

    A whole Java upgrade later, where again the biggest problem was
    uninstalling the previous JDK and JRE, finally extracted it, but it
    seems to contain nothing useful that was not available already simply by connecting the phone to the PC in the normal way.

    Actually they were there all along, which shows just how useless is
    Windows Search, by contrast Textpad's Find in Files option found them.

    So, the full procedure is:

    1. <path>\adb backup

    ... creates backup.ab in the current directory

    2. Install or update to the latest Java Runtime Environment,
    currently 1.8.0_431:

    https://www.java.com/en/download/help/download_options.html

    3. Download Nelenkov's abe*.jar file:

    https://github.com/nelenkov/android-backup-extractor https://github.com/nelenkov/android-backup-extractor/releases/download/latest/abe-3e9a273.jar

    Give the command (without the square brackets around the password, they
    are merely a convention signifying that it is an optional parameter):

    java -jar <path>\abe-3e9a273.jar unpack <path>\backup.ab
    <path>\backup.tar [password]

    The resulting tar file can be extracted by 7-zip. Search the extracted
    files' contents for an SSID known to be on the device, mine were in:

    \apps\com.android.providers.settings\d_f\flattened-data

    --

    Fake news kills!

    I may be contacted via the contact address given on my website:
    www.macfh.co.uk

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Java Jive@21:1/5 to Java Jive on Sat Nov 9 01:15:55 2024
    XPost: comp.mobile.android

    On 2024-11-09 01:01, Java Jive wrote:
    On 2024-11-09 00:08, Java Jive wrote:

    There is a command ...
       <path>\adb backup
    ... which creates a backup of the phone or tablet on your computer.
    However, the backup so created, called backup.ab, is a unique tar file
    format that almost nothing else can read as is, though there are neat
    workarounds as long as it is not encrypted; however, because my tablet
    is encrypted, so is the backup, which means that the simple
    workarounds don't work.

    A whole Perl upgrade later, where the biggest problem was actually
    uninstalling the previous version, to run a Perl script to extract the
    contents resulted only in a message that it couldn't do anything with
    this version 4, a version later than that for which it was written.

    A whole Java upgrade later, where again the biggest problem was
    uninstalling the previous JDK and JRE, finally extracted it, but it
    seems to contain nothing useful that was not available already simply
    by connecting the phone to the PC in the normal way.

    Actually they were there all along, which shows just how useless is
    Windows Search, by contrast Textpad's Find in Files option found them.

    So, the full procedure is:

    1.    <path>\adb backup

    ... creates backup.ab in the current directory

    2.    Install or update to the latest Java Runtime Environment,
    currently 1.8.0_431:

    https://www.java.com/en/download/help/download_options.html

    3.    Download Nelenkov's abe*.jar file:

    https://github.com/nelenkov/android-backup-extractor https://github.com/nelenkov/android-backup-extractor/releases/download/latest/abe-3e9a273.jar

    Give the command (without the square brackets around the password, they
    are merely a convention signifying that it is an optional parameter):

    java -jar <path>\abe-3e9a273.jar unpack <path>\backup.ab
    <path>\backup.tar [password]

    The resulting tar file can be extracted by 7-zip.  Search the extracted files' contents for an SSID known to be on the device, mine were in:

    \apps\com.android.providers.settings\d_f\flattened-data

    Should have added my thanks to all those who have helped along the way.

    --

    Fake news kills!

    I may be contacted via the contact address given on my website:
    www.macfh.co.uk

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andrews@21:1/5 to Java Jive on Sat Nov 9 04:54:25 2024
    XPost: comp.mobile.android

    Java Jive wrote on Sat, 9 Nov 2024 01:15:55 +0000 :

    Should have added my thanks to all those who have helped along the way.

    We're all here to help each other - and to give back to the team.
    We've been doing this for decades - as we're kind hearted helpful people.

    Helping you has taught me things as I've never used "adb backup" myself.
    Never even heard of it.

    It's GREAT that you resolved the question of extracting (and restoring?)
    Wi-Fi passwords on older Androids (which didn't lock WifiConfigStore.xml).

    I'm trying to reproduce steps but I'm not sure the sequence on Android 13.

    C:\app\editor\android\scrcpy> adb backup
    WARNING: adb backup is deprecated and may be removed in a future release
    adb.exe: backup either needs a list of packages or -all/-shared

    C:\app\editor\android\scrcpy> adb --version
    Android Debug Bridge version 1.0.41
    Version 33.0.3-8952118
    Installed as C:\app\editor\android\scrcpy\adb.exe

    Looking it up, I see there is an Android backup-and-restore guide.
    <https://github.com/eviabs/Android-Backup-and-Restore-Guide/blob/master/Android%20Backup%20and%20Restore%20Guide.md>
    "An *.ab backup contains all your personal and hidden data of your app.
    It doesn't necessary contain your local storage data (which is located in
    your sd card). Make sure you copy by yourself the sd card content."

    C:\app\editor\android\scrcpy> adb backup -f myAndroidBackup.ab com.grindrapp.android
    WARNING: adb backup is deprecated and may be removed in a future release
    Now unlock your device and confirm the backup operation...
    (My phone in another room popped up an unlock request, which I easily
    accepted from Windows since I operate my phone at home from the PC.)

    C:\app\editor\android\scrcpy> dir myAndroidBackup.ab
    11/08/2024 11:40 PM 47 myAndroidBackup.ab

    C:\app\editor\android\scrcpy> adb backup -apk -shared -all -f fullAndroidBackup.ab
    (again the monitor dedicated to Android popped up an unlock request which
    I accepted from the PC as I don't feel like looking for the phone)

    It's taking a while... so moving on, here's how to restore apparently.

    Single app backup (the app has to actually be installed already).
    C:\app\editor\android\scrcpy> adb restore myAndroidBackup.ab

    (I'm still waiting for the all-apps-and-their-data backup to finish.)
    The only thing is these are restoring "apps", not Wi-Fi settings, right?

    So I'm confused (although the "settings" app is just another app too).
    How does this backup/restore Wi-Fi configuration settings?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andrews@21:1/5 to Andrews on Sat Nov 9 04:57:08 2024
    XPost: comp.mobile.android

    Andrews wrote on Sat, 9 Nov 2024 04:54:25 -0000 (UTC) :

    How does this backup/restore Wi-Fi configuration settings?

    Oops. Didn't see the Java jar stuff. Gonna try again...

    But right now I'm waiting for the adb backup to finish.

    It's taking a looooooooooong time but I have over 900 apps installed on my phone (as I test apps against each other all the time) so it may take all night.

    Good think it's all being done from the PC while the phone is somewhere in
    the room charging on a night table as I operate the phone from the PC.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andrews@21:1/5 to Andrews on Sat Nov 9 05:32:53 2024
    XPost: comp.mobile.android

    Andrews wrote on Sat, 9 Nov 2024 04:57:08 -0000 (UTC) :

    It's taking a looooooooooong time but I have over 900 apps installed on my phone (as I test apps against each other all the time) so it may take all night.

    The adb full backup finished. It took around a half hour or so (I didn't
    time it though) but it's not a small backup file, that's for sure...

    C:\app\editor\android\scrcpy> adb backup -apk -shared -all -f fullAndroidBackup.ab
    C:\app\editor\android\scrcpy >dir *ab
    Directory of C:\app\editor\android\scrcpy
    11/08/2024 11:15 PM 10,589,970,522 fullAndroidBackup.ab
    11/08/2024 10:40 PM 47 myAndroidBackup.ab

    I have no idea (yet) what to do with that "full backup"; but it worked.
    Does anyone have a working process to use these adb full backups?

    And I still have to try the java stuff for the Wi-Fi passwords.

    But every time I touch java on Windows, I have to install tons of crapware.
    So I'm gun shy....

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)