[Q] Move authenticator data from non rooted nexus4 to rooted nexus5 - Nexus 4 Q&A, Help & Troubleshooting

Hi,
I have been using a nexus4 and I just got a nexus5.
The nexus 4 is not rooted and bootloader locked
The nexus 5 is rooted.
On my nexus 4 I have very critical 2factor keys that I want to put on my nexus 5 before wiping it.
Apparently the methods to retrieve the authenticator keys involve root.
Before trying anything I did a full adb backup of the data of the nexus4
./adb backup -apk -shared -all -f ~/Documents/backupfull.ab
What I tried so far is to extract the authenticator data manually
./adb backup -f gauth.ab -apk com.google.android.apps.autheticator2
dd if=gauth.ab bs=24 skip=1 | openssl zlib -d > gauth.tar
tar xvpf gauth.tar
Empty!
My next guess is to root the nexus 4 but apparently it seems like there is no way to root the nexus 4 without wiping it.
If I root the nexus 4 and wipe the data in the process, when I restore my backup will the authenticator data will be there?

Related

[Q] Soft Bricked Nexus 7 with Chainfire 3D, help?

Hey everyone decided to install chainfire 3D only to find out that it doesnt work and has been addressed before (stuck on nexus logo). Anyways i read the only way to fix is to re-flash it. is there any other way because i have so much data on it that i really do not want to loose. could i connect it to the computer some how and remove chainfire 3d files? it has been rooted and i have the nexus 7 toolkit installed on my computer.
also if not possible i will use the nexus toolkit to re-flash stock rom.
Have you backed up your files prior to using chainfire? If so, just restore it.
Try with
Code:
adb uninstall name.apk
Replace name.apk with that apk's name (if you don't know, what it is, type
Code:
adb shell
and navigate to /data/
Code:
cd /data/
and type
Code:
ls
to show all apk's installed on your N7.)
Thanks guys, but i found out i could use the Toolkit to install the original stock firmware, without deleting any of my data since i was unlocked.
This topic is now closed

[Q] How to backup Nexus 4 using adb?

Hi,
Thanks in advance for reading this.
Details:
Phone: Google Nexus 4
OS: Android 4.4.2
Android SDK OS: Windows 7x64 SP1
adb version: 1.0.31
Eventually I hope to unlock the bootloader and then root my phone, but right now I'm struggling with making a backup and until I get that accomplished I don't feel comfortable going any further. I hope that someone here more knowledgeable can point out what I'm doing wrong.
Long story short, I fully charged the Nexus 4, updated the existing Android SDK so I'm using the latest version of adb and installed the Google USB drivers by choosing to install "legacy" devices and selecting all three drivers (one at a time). I then removed the fake legacy devices and chose to leave the drivers installed.
I then connected the Nexus 4 in USB debugging mode and it was detected via
Code:
adb devices
. I read here about using
Code:
adb pull /sdcard/ /sdcard/
and translated that to:
Code:
adb pull /sdcard/ .\sdcard
since I am on a Windows box. That worked fine until a subfolder within /sdcard/Android for the Amazon Kindle app was encountered. The copy attempt was aborted due to a filename that I'm guessing the NTFS filesystem didn't care for.
I figured I would just move past that and come back to it later; maybe use ES File Explorer to create a zip file or copy/paste specific folders via Windows Explorer interface.
I then moved on to running adb backup and ran:
Code:
adb backup -apk -shared -all -f .\nexus4-backup-010114.ab
After a long while the command appeared to complete and control was returned to the command prompt. The resulting file was about 1 GB in size and no errors were shown on the phone or on the command prompt by adb.
Not one to trust just one run, I tried it a second time and the process hung. I cancelled the adb call and ran
Code:
adb reboot
to reboot the phone. I tried again and the process hung yet again.
I've tried all of the following and the process seem to hang (waited several hours one time):
*
Code:
adb backup -apk -shared -all -f .\nexus4-backup-010114.ab
*
Code:
adb backup -apk -shared -all -nosystem -f .\nexus4-backup-010114.ab
*
Code:
adb backup -apk -noshared -all -nosystem -f .\nexus4-backup-010114.ab
and based on the suggestion here I tried with and without an encryption password. The first attempt was without a password and later attempts was with providing a password at the time of the backup (when prompted on the phone).
Before posting this, I tried setting a password within the Developer options on the phone and had the same luck with running:
Code:
adb backup -apk -shared -all -nosystem -f .\nexus4-backup-010214.ab
By this point I'm ready to throw the phone against the wall (even if it doesn't deserve it). Any help would be appreciated.
Thanks!
I ended up giving up on this as I've spent three days and didn't want to wait any longer. I backed up the contents of /sdcard/ into a zip file (using ES File Explorer) and will restore contents manually as necessary.
I've since unlocked my phone, restored quite a bit of content, taken two Nandroid backups (before and after rooting the phone) and loaded all currently available versions of stock Android for the Nexus 4. What follows is some of my notes that I took while going through the process.
---
After unlocking my phone I restored contents from the zip file and a surprising amount of content was restored, but unfortunately not stuff like bookmarks and other personal settings. As I read before and after unlocking my phone a lot of that content is kept in /data where only root can get to it. Thankfully not all app developers follow that recommendation and I was able to retrieve some of my content.
However after I unlocked the bootloader and rooted the phone I was able to make a backup by running:
Code:
adb backup -apk -shared -all -f nexus4-backup-010414.ab
I'm not sure if it was just unlocking the bootloader that allowed it to work or that + rooting the phone or maybe something else entirely. Whatever the case that command completed successfully. I'm going to run several more backups with differing options and then will flash the phone back to stock and try restoring from that.
Just before that I'll try making a backup via TWRP (haven't really looked into the details yet) and also follow the codemink.com/backup-or-restore-android-through-adb/ guide to try and make a backup of the entire phone (OS, Recovery, etc).
I'm hoping I don't have to spend all of my time restoring the phone from scratch if this doesn't work, but it's worth trying this to find a reliable solution.
---
I picked another tool from the tool chest and tried using the Nexus Root Toolkit (NRT) v1.8.0 since others have recommended it. I know it's not good to rely on toolkits, but I wanted to see what it was capable of. It rebooted the phone into bootloader mode and then booted a custom recovery (TWRP) so it could run a Nandroid backup. It did and ended up with a 2.30 GB backup located at /sdcard/TWRP/BACKUPS/SerialNumberOfYourPhone/. From what I can tell the NRT automates what you can do manually, only when it finished the process and attempted to copy the backup to the PC it only grabbed about 40 MB worth and reported a successful backup.
Since I had been watching the process from the phone I saw that it reported the size of the data it was backing up as 2750 MB, so I knew that the NRT was wrong. It asked if I wanted to nuke the backup since it copied it over, and I told it No since I knew it was wrong.
* If I haven't mentioned it yet, I used Windows 7x64 for all steps.
---
I followed the directions on the www .android.gs/root-google-nexus-4-on-android-4-4-kitkat-krt16o-rom-using-twrp/ page and didn't have any problems. Well, the one problem I did have was not freaking out when my Nexus wasn't seen by either
Code:
adb devices
or
Code:
fastboot devices
.
I frequently made the mistake when experimenting on my own by using one or the other when it wasn't appropriate. I ended up learning that fastboot is used when interacting with the bootloader and adb is used when the phone is booted into the full Android OS or in Recovery mode.
After I had TWRP installed, the Android 4.4.2 installation rooted (again using the www .android.gs/root-google-nexus-4-on-android-4-4-kitkat-krt16o-rom-using-twrp/ page and my phone setup the way I wanted it, I took a final Nandroid backup using TWRP and then booted the phone back into the full OS.
I proceeded to copy the /sdcard/TWRP backup files to the PC as a precaution. I ended up using the developers.google.com/android/nexus/images#occam official factory images for the Nexus 4 to flash Android 4.2.2 all the way up to Android 4.4.2 "just to do it". Restoring my TWRP backup first required me to re-flash TWRP and then copy the TWRP backup folder back to /sdcard/TWRP. I booted back into Recovery mode via adb reboot recovery and used the menu system to drill down to the backup I was interested in and restore it. I then rebooted when prompted and my phone was restored to where I last made a Nandroid backup.
I took extensive pictures using a second phone and kept all output so I could have something to refer to if (uhm, when) I try this again in the future.
What I learned at the end is that I could have flashed just the OS by modifying the flash-all.bat file to remove the -w switch from the final fastboot command in the file. Here is what it looks like by default for the file included in the Android 4.2.2 factory image tarball:
Code:
fastboot -w update image-occam-jdq39.zip
and after removing the switch:
Code:
fastboot update image-occam-jdq39.zip
Using that approach I would likely be able to safely keep the /sdcard/TWRP files on the phone during the flashing of stock roms. I hope this helps someone. Unfortunately I never did find a way to use adb to make a successful backup prior to unlocking the bootloader, so if I had it to do all over again I would have unlocked the bootloader when I first received it. Lesson learned!

[Q] ZTE Open backing up user partition using ADB

I have a ZTE Open (US Ebay edition - with root permissions).
I am trying to use ADB to backup the user data partition from the device (either via dd in the shell or ADB "pull" commands). I have also stopped b2g before commencing a "pull" command, without any luck.
Each time I manage to get some data off the device but the user partition is incomplete (i.e. the YAFFS2 file system is corrupted). The size of the partition is accurate (as reported from the shell) but the header of the file system appears to be truncated with random bits of data.
Does anyone know of a way to back up these partitions using ADB or dd in the shell?
I don't want to install CWM.
Thanks

How do I adb pull root directories (like "/" or "/system"?)

Hi there, I'm trying to pull root directories like /system and /data without any luck. My purpose it to have them on my PC as a backup, and be able to browse them to pull out apps and pieces of data as necessary if it ever becomes necessary.
Device: Nexus 6P (North American version)
ROM: Stock 6.0.1 Rooted, using Wugfresh Nexus Root Toolkit and SuperSU
PC OS: Windows 7 PC (64 bit)
Adb is working properly and I can easily pull non-root directories like "/sdcard" and so on. I'd like to be able to backup the entire root directory ("/") or at least the child directories (like "/system" and "/data", etc.) Unfortunately, when I try
Code:
adb pull -p "/system" "C:\somewhere"
it skips a bunch of files, so I need to come up with a better method.
I've tried
Code:
adb root
and it tells me it's already running in root mode.
I try
Code:
adb remount
and it does this properly, but doesn't change the effects of all the commands I've tried.
When I run
Code:
adb shell
it enters shell and gives me # by default, so seemingly it is giving me su permission by default?
*** Oddly, when I enter "su" while in shell, it tells me "/sbin/sh: su: not found" which seems odd to me. I think it's possibly that SuperSU is installed as systemless root, or there's something else screwy here, so I guess I'm not sure how to proceed. Still, if that were case, why would adb already be running as root, and why would shell automatically give me the #?
Any help is appreciated!!
Thanks!
@Heisenberg I figured I'd tag you because of your extensive experience with the Nexus 6P in particular (and rooting.) Not sure if you may be able to shed some light on the issue here?

How to Recover Files After MSM?

Hi all,
I bricked my OP6T with a ROM update and had to run the MSM tool. Unfortunately, I seem to have lost all my photos. However, I have imaged the partition using the below shell commands and plan on using a recovery tool to get the images back. However, will the data be encrypted? Is there a way to retrieve the key or wrapped key for data decryption?
I also have a backup of modem files if that helps.
Code:
su
mkfifo /cache/fifo1
ftpput -v -u .. -p ... 10.0.0.2 /backup/sda.img /cache/fifo1 & dd if=/dev/block/platform/soc/1d84000.ufshc/sda of=/cache/fifo1

Categories

Resources