Recover files from /data: does installing TWRP and Magisk reset my storage - Xiaomi Mi Mix 2S Questions & Answers

Trying to restore deleted files from /sdcard/Android/data/net.... which is not on an a real sdcard.
I have stock default Miui Global 10.3.5 on Android 9
The phone is unlocked.
I am on holiday, so if there is a risk it can go wrong I forget about the files...
I once rooted my Nexus 5, and used adb to obtain data from another phone.
Can I install TWRP without loosing data?
Subsequently can I install Magisk to install su, without reinstalling Miui?
Or does one has another method? (Undelete apps require root to undelete in data as well)
Thanx in advance!

I have the same problem, i cant root my Xioami mi Mix 2s

Related

Is there a safe root on stock 5.1.1 that doesn't wipe data?

I desperately need more storage on this phone.. :crying: The only way I have found to gain extra storage is to have root and use StickMount. I have a lot of info and game saves that I don't want to lose to a data wipe though. Is there a safe root method on stock 5.1.1 that doesn't wipe data?
The reason rooting with ChainFire's root tool wipes your data is becuase it boots to a custom one-time-use recovery (different from flashing twrp or cwm) to install the SU binaries. However, to do this an unlocked bootloader is needed. When the "oem unlock" command (what unlocks the bootloader) is run, it wipes all user data (the /data partition) as a security precaution, because one could flash something like twrp and then use adb commands to pull your personal files or remove the password on your lockscreen.
I cant verify if his works right now, i just got CyanogenMod 12.1 (pre-rooted) up and running, but you could try this: ROOTMaster
I used that to root my KFHD and my old LG Optimus G, both on older versions of android though. Let me know if it works for you
https://play.google.com/store/apps/details?id=com.rerware.android.MyBackup
https://play.google.com/store/apps/details?id=com.koushikdutta.backup
Try these 2 apps to backup your stuff, you should be able to backup your stuff without root, and then when you have root you could restore it. Just make sure to move the data from the phone because i believe oem unlock deletes everything from it.
My issue with those backup apps is this "* Users with root access can backup APKs AND DATA!". I have tried using backup apps in the past without root and the apps were backed up but I lost my game saves. Which, is really all I am worried about because I know how to back everything else up without root. I have lost games saves a few times switching from phone to phone without root and it sux. Also, with no data wipe I can avoid the hefty amount of time installing and setting up my phone environment. I do very much so understand the importance of a clean wipe and fresh environment though. With no data wipe and root I could back up app data and then do a fresh install.
It all depend on if you have already unlocked bootloader or not. If yes, just install custom recovery (TWRP) and install SuperSU. If not, there is no way to backup data without wiping your data, beside adb backup command.
http://forum.xda-developers.com/galaxy-nexus/general/guide-phone-backup-unlock-root-t1420351
So how do people transfer their game stuff to a new device? Does the adb backup command allow you to back up a device and transfer it onto another device? or will their be complications like file placement since it is a different device?

FlashFire with HTC One A9?

Anyone used ChainFire's FlashFire with the One A9?
I've used it for backups successfully but have yet to restore anything with it (a little squeamish to do so :silly.
And I'll just add, if anyone has used it and could offer any tips or procedures that would be great.
FlashFire usage is straightforward, at least for me. I haven't flashed anything dangerous with it directly (bootloader, radio) yet.
It has handled flashing backups of system, boot, recovery, and even the 1.57.617.41 ota flawlessly.
Special thanks to @Chainfire!
Sent from my HTC One A9 using XDA Free mobile app
CSnowRules said:
FlashFire usage is straightforward, at least for me. I haven't flashed anything dangerous with it directly (bootloader, radio) yet.
It has handled flashing backups of system, boot, recovery, and even the 1.57.617.41 ota flawlessly.
Special thanks to @Chainfire!
Sent from my HTC One A9 using XDA Free mobile app
Click to expand...
Click to collapse
Were you already rooted? I'm rooted and xposed and want to update via flashfire. will it work?
theNdroid said:
Were you already rooted? I'm rooted and xposed and want to update via flashfire. will it work?
Click to expand...
Click to collapse
Of course. Root is required to use FlashFire. I use Xposed as well, and I've had no problems updating via FlashFire.
CSnowRules said:
FlashFire usage is straightforward, at least for me. I haven't flashed anything dangerous with it directly (bootloader, radio) yet.
It has handled flashing backups of system, boot, recovery, and even the 1.57.617.41 ota flawlessly.
Click to expand...
Click to collapse
Just for my edification, flashing a firmware update like 1.57.617.41 will wipe my data partition, correct?
eelpout said:
Just for my edification, flashing a firmware update like 1.57.617.41 will wipe my data partition, correct?
Click to expand...
Click to collapse
No not at all. Flashing the OTA will not wipe your data. I've done the .41 and .52 OTAs via FlashFire.
***Warning--if you're not currently encrypted, flashing the OTA will update your boot partition, so be sure to use the preserve recovery option in FlashFire and reboot to TWRP to patch your boot image, or your device will encrypt data on first boot.***
CSnowRules said:
No not at all. Flashing the OTA will not wipe your data. I've done the .41 and .52 OTAs via FlashFire.
***Warning--if you're not currently encrypted, flashing the OTA will update your boot partition, so be sure to use the preserve recovery option in FlashFire and reboot to TWRP to patch your boot image, or your device will encrypt data on first boot.***
Click to expand...
Click to collapse
meaning, flash this A9 boot image patcher from TWRP?
Or does using the EverRoot SuperSU option patch the boot image for us on the A9 (and then does one check "preserve recovery" using that or not)?
This can all get a bit confusing.
eelpout said:
meaning, flash this A9 boot image patcher from TWRP?
Or does using the EverRoot SuperSU option patch the boot image for us on the A9 (and then does one check "preserve recovery" using that or not)?
This can all get a bit confusing.
Click to expand...
Click to collapse
Yes, that's one way to disable forceencrypt. You could also flash the latest SuperSU or Magisk. Either one will disable forceencrypt by default. Of course, if your data is already encrypted, you won't have a problem, but I'd assume that you would like to have root, so I'd recommend SuperSU or Magisk+phh root.
CSnowRules said:
Yes, that's one way to disable forceencrypt. You could also flash the latest SuperSU or Magisk. Either one will disable forceencrypt by default. Of course, if your data is already encrypted, you won't have a problem, but I'd assume that you would like to have root, so I'd recommend SuperSU or Magisk+phh root.
Click to expand...
Click to collapse
i'm already unecrypted and rooted, but on firmware from last year. just trying to find the most efficient way to bring things up to date.
eelpout said:
i'm already unecrypted and rooted, but on firmware from last year. just trying to find the most efficient way to bring things up to date.
Click to expand...
Click to collapse
Ok, this post will go a bit off topic. That being said, I can offer two courses of action. I take no responsibility for anything in this post.
Safest--almost no risk (my personal preference)
1. Backup your data partition, including internal SD via TWRP to ext SD or USB OTG drive. Flash the latest RUU from HTC. Boot stock and apply OTAs until there are no more updates available. Fastboot flash the latest TWRP, and finally restore your data and flash the latest SuperSU via TWRP. Reboot your fully updated, rooted A9 with all your data still intact.
A little risky and untested to my knowledge--could result in a hard brick if something partially fails. FLASHING BOOTLOADERS IN FLASHFIRE IS STILL ALPHA FOR HTC DEVICES!!! This may work with s-on...but may require s-off.
Your system partition must have never been mounted r/w for this to work.
2. Download the OTA zips for your phone from the first update available to the latest and the latest SuperSU and TWRP. Use FlashFire to do everything in one shot. Select allow flashing bootloaders in FlashFire settings, select your OTAs for installation from oldest to newest (don't select restore boot and recovery), select TWRP and SuperSU for installation, disable everroot and preserve recovery. Cross your fingers and timidly press flash... If all is successful, you should have the same end result as option 1.
I STRONGLY recommend the first method, but if you're feeling lucky and decide to try the second method, please share how it goes, since this post is FlashFire related and this would be the ultimate test of FlashFire for our devices.
For me, I've found that though TWRP backups take more time, and DON'T preserve internal storage, it's still the most reliable and consistent way to backup especially for OTAs.
I've previously tried FlashFire restore but it doesn't seem to restore internal storage as claimed; deal-breaker.
The real problem is we want OTA automation to:
1) disable lock-screen (pattern or fingerprint) so emergency restore of /data don't fail to unlock after boot
2) restore OEM recovery
3) flash OTA and let it do its things of updating /system, /boot, etc
4) reflash SuperSU before normal system boot so /boot doesn't try to re-encrypt /data
5) restore whatever the original recovery was
6) boot
The problem always is catching the step between 3 -> 4 in some automated way. If the OTA goes all the way through, /data is encrypted and so time is wasted to go back to recovery after full-boot, wipe /data, restore /data, lost internal storage contents and PICTURES. If pattern-lock / finger-print lock is not disabled (1), you won't be able to get past the lock screen as it won't recognize the correct lock-pattern nor fingerprint. Solution is to adb shell in, and move/delete some files as root. PITA and I don't think FlashFire does this.
If you did manually restore /data, then /data is corrupted for some apps that use it such as Waze, LINE, KakaoTalk, Whatsapp, etc where they can't write to their data directories anymore. A reinstall of the app is the only way to fix it.
NuShrike said:
For me, I've found that though TWRP backups take more time, and DON'T preserve internal storage, it's still the most reliable and consistent way to backup especially for OTAs.
I've previously tried FlashFire restore but it doesn't seem to restore internal storage as claimed; deal-breaker.
The real problem is we want OTA automation to:
1) disable lock-screen (pattern or fingerprint) so emergency restore of /data don't fail to unlock after boot
2) restore OEM recovery
3) flash OTA and let it do its things of updating /system, /boot, etc
4) reflash SuperSU before normal system boot so /boot doesn't try to re-encrypt /data
5) restore whatever the original recovery was
6) boot
The problem always is catching the step between 3 -> 4 in some automated way. If the OTA goes all the way through, /data is encrypted and so time is wasted to go back to recovery after full-boot, wipe /data, restore /data, lost internal storage contents and PICTURES. If pattern-lock / finger-print lock is not disabled (1), you won't be able to get past the lock screen as it won't recognize the correct lock-pattern nor fingerprint. Solution is to adb shell in, and move/delete some files as root. PITA and I don't think FlashFire does this.
If you did manually restore /data, then /data is corrupted for some apps that use it such as Waze, LINE, KakaoTalk, Whatsapp, etc where they can't write to their data directories anymore. A reinstall of the app is the only way to fix it.
Click to expand...
Click to collapse
The solution for problem 1 can be handled in TWRP. The files can be deleted via TWRP's file manager or the built in terminal, which may be easier for some people.
Also, the solution for the corrupted data and internal SD is to create an image of the data partition (just like the system image backup option). This can be done via dd in TWRP or adb. It requires a large amount of storage and it takes longer, but I've had to do it, since I use VIP Access by Symantec for work. A normal file based backup in TWRP breaks that app. This also keeps the pin/fingerprint data intact.
If we could have that implemented in a user friendly manner, that would be great, but I'm sure CaptainThrowback and Chainfire both have bigger issues to deal with. I could probably figure out a solution, but the work wouldn't be worth it for my own benefit, since I'm fluent with the Linux command line.

Huawei Mate 9 Magisk v14.0 auf v15.X

Hello,
I own the Huawei Mate 9 with the firmware from fRomFuture B197.
Rooted with Magisk v14.0. For some time now I keep getting update messages, from v15.0, v15.1 or last from v15.2.
The Magisk app is the latest.
My problem: When I go to update, I can patch the boot image file or choose Install Directly. No matter what I do of both, it works so far that the phone starts and so on. But if I go into TWRP purely, the internal memory is encrypted, even after such an update, always the Google Account out, and I have to log in again.
does anyone know the problem? Where do I go best, so that the v15.2 is out, but synonymous all sorts of data, apps and so is retained? What do the advanced options in the Magisk app (maintaining Force encryption or maintaining AVB 2.0 / dm-verity) mean?
Thank you
laptop45307 said:
Hello,
I own the Huawei Mate 9 with the firmware from fRomFuture B197.
Rooted with Magisk v14.0. For some time now I keep getting update messages, from v15.0, v15.1 or last from v15.2.
The Magisk app is the latest.
My problem: When I go to update, I can patch the boot image file or choose Install Directly. No matter what I do of both, it works so far that the phone starts and so on. But if I go into TWRP purely, the internal memory is encrypted, even after such an update, always the Google Account out, and I have to log in again.
does anyone know the problem? Where do I go best, so that the v15.2 is out, but synonymous all sorts of data, apps and so is retained? What do the advanced options in the Magisk app (maintaining Force encryption or maintaining AVB 2.0 / dm-verity) mean?
Thank you
Click to expand...
Click to collapse
If you have a sdcard, use that and place Magisk15.2.zip on it, then install in TWRP.
You are encrypted, that's why you can't find it. Maintain force encrypt means it won't turn off encryption in fstab. Maintain AVB/dm-verity means it won't remove the verity/avb flags in fstab.
You don't really need to worry about encryption if you use an sdcard. Verity could be good to remove if you want to edit /vendor, /system or /product partitions.
If you flash through TWRP it will remove encryption and dm-verity. Though encryption is not removed on Mate 9 because it's not looking for File-encryption, only forceencrypt.
The reason being that the Pixel phones lose support when the File-encryption flag is removed, so the dev of magisk removed it.
And if you wanted to remove encryption you need to Wipe - Format Data in twrp, which wipes /data so you should back up before you do it.
Only benefit of decrypting is the ability to backup the /data partition. If you don't plan on doing that you can stay encrypted.
And being sd int decrypted, Magisk deletes the Google account and data, so after that you will have to install everything again ... it has happened to me like this 2 times
Health2
Enviado desde mi MHA-L29 mediante Tapatalk

Finally time for root and possibly ROM: best way?

Hi there
I always used to have a rooted phone, and most of the time with LineageOS/Cyanogenmod. Rooting is usually the very first thing I do. But since the Mi Note has stupid unlock limitations, I could not do that right when I bought the phone 1.5 years ago. And I let that be til now since there weren't any ROMs for a long time anyway, and I was always scared to lose data since restoring my data without my root backup was kinda scary (as I never did that before). Now it's time and I wanted to ask for the best way to unlock the phone without losing anything.
Is this the way I should proceed? Any suggestion and improvements are very welcome.
1. Copy all internal storage to my computer
Backup all data using the system backup tool to my computer.
Also backup using the google backup.
To be sure create a backup of contacts, phone log etc with "super backup".
2a. download Xiaomi Drivers http://pcsuite.mi.com/
2.b Download the unlock tool from Xiaomi, and unlock it using https://en.miui.com/unlock/download_en.html
3. Install TWRP(+OF_avb_patcher_mauronofrio.zip) & Magisk (after booting into system rename the magisk zip to apk and install it again)
NOTE: to install avb patch I had to start adb and "adb sideload OF_avb_patcher_mauronofrio.zip"
4. Restore everything (whats the best to start with? the google one can only be restored on a fresh install, right? So use that, if anything is missing, use the system backup tool?)
I then might decide to install LineageOS 18.1 (is it the most stable custom rom out there?)
5. Backup again everything a) with nandroid and b) with a root backup tool (is Titanium Backup still recommended? it's the one I used for many years). "Migrate"
6a. Flash latest (21.4.14) Firmware
6b. Flash LinageOS & NikGapps
7. Restore backup and enjoy finally a good rom
If anything goes wrong I can restore original rom with this guide if nandroid restore fails? https://c.mi.com/oc/miuidownload/detail?guide=2
Personally i don't do nandroids so no advice there, but i'd use Migrate instead of TIBU. TIBU is old now. Also when flashing magisk just flash the zip, then after booting into system rename the magisk zip to apk and install it again that way. Their readme will tell you to do it in a more complicated way but in my experience they way i described works just fine.
Also, if it's your first time installing twrp don't forget to flash OF_avb_patcher_mauronofrio.zip afterwards. You can download it in the twrp thread. You will have bootloop or be stuck on logo if you don't.
Thank you very much for this valuable feedback.
Did update the post to reflect that, for anyone finding this topic helpful too.
To see the device in the unlock tool I had to install pcsuite.
I had to sideload the avb patch and magisk in TWRP as the device on windows was mounted but showed a lot of strange folders (98sdjbdpa089j89we) and copy files over did not work.
But now I have TWRP and Magisk on it
I might still did something wrong Used magisk from magisk.me (damn duckduckgo) instead from github. It works but I'm a little scared now. (At least is has the same checksum)
Also SafetyNet does not work (I know the current check does not work but also apps relying on it don't work).
Should I reflash TWRP and install the renamed .apk (as .zip) again?
Edit: just did it, used the canary version with the hope that SafetyNet works, but that didn't change.
And is there that TWRP does not show my internal storage correctly (it works without problems after boot)?
Edit: "fastboot oem reboot-recovery" does not ask for encryption password, "fastboot boot twrp-3.3.1-xx-xxxxxx-mauronofrio.img" does and shows the sdcard
dedors said:
I might still did something wrong Used magisk from magisk.me (damn duckduckgo) instead from github. It works but I'm a little scared now. (At least is has the same checksum)
Also SafetyNet does not work (I know the current check does not work but also apps relying on it don't work).
Should I reflash TWRP and install the renamed .apk (as .zip) again?
Edit: just did it, used the canary version with the hope that SafetyNet works, but that didn't change.
And is there that TWRP does not show my internal storage correctly (it works without problems after boot)?
Edit: "fastboot oem reboot-recovery" does not ask for encryption password, "fastboot boot twrp-3.3.1-xx-xxxxxx-mauronofrio.img" does and shows the sdcard
Click to expand...
Click to collapse
For safetynet test this
MAGISK MODULE ❯ Universal SafetyNet Fix 2.4.0
Universal SafetyNet Fix Magisk module Magisk module to work around Google's SafetyNet attestation. This module works around hardware attestation and recent updates to SafetyNet CTS profile checks. You must already be able to pass basic CTS...
forum.xda-developers.com
I couldn't resist and went ahead with LineageOS, so that problem got solved

insufficient storage

Hallo
I flashed lineage-172.1-0201231-UNOFFICIAL-hammerhealineage.zipd on Nexus 5 after factory reset and tried to flash open_gapps-arm-10.0-pico-20220215.zip by twrp -3.7.0_9-HH.R.17.
Flashing open_gapps without success because of insufficient storage.
After factory reset there is used only 33 MB in system_root, lineage builds there a backup file with 970 MB when flashed. Lineage is running well. I was able to root my device by magisk
By signing in my google account I can use gmail, google maps and so on out from browser.
Is there any possibility to read and delete android systemfiles by a software like windows explorer.
Many thanks in advance and greetings
Günther Postl
[email protected] said:
Hallo
I flashed lineage-172.1-0201231-UNOFFICIAL-hammerhealineage.zipd on Nexus 5 after factory reset and tried to flash open_gapps-arm-10.0-pico-20220215.zip by twrp -3.7.0_9-HH.R.17.
Flashing open_gapps without success because of insufficient storage.
After factory reset there is used only 33 MB in system_root, lineage builds there a backup file with 970 MB when flashed. Lineage is running well. I was able to root my device by magisk
By signing in my google account I can use gmail, google maps and so on out from browser.
Is there any possibility to read and delete android systemfiles by a software like windows explorer.
Many thanks in advance and greetings
Günther Postl
Click to expand...
Click to collapse
Since your device is rooted, you can use a file explorer app for Android that has a root explorer to uninstall/delete whatever you want.
[email protected] said:
Hallo
I flashed lineage-172.1-0201231-UNOFFICIAL-hammerhealineage.zipd on Nexus 5 after factory reset and tried to flash open_gapps-arm-10.0-pico-20220215.zip by twrp -3.7.0_9-HH.R.17.
Flashing open_gapps without success because of insufficient storage.
After factory reset there is used only 33 MB in system_root, lineage builds there a backup file with 970 MB when flashed. Lineage is running well. I was able to root my device by magisk
By signing in my google account I can use gmail, google maps and so on out from browser.
Is there any possibility to read and delete android systemfiles by a software like windows explorer.
Many thanks in advance and greetings
Günther Postl
Click to expand...
Click to collapse
Never delete files housed in /system partition because ( as it's name implies ) they are the Android's core files.

Categories

Resources