My phone is not yet 1 month old please help me - Xiaomi Mi 4i

i was trying to root my phone i done it and i am trying to install a rom to it
after that i twrp and delete all files.
i have files still in my pc can someone help me how to put some zip in the phone because my pc cant detect my phone anymore.
thanks guys

Try re-installing the proper drivers for the device and also try to boot to fastboot and check if it detected. And if it does so, try restoring to official firmware.

If you can buy an OTG cable and try a pendrive. An OTG cable is a life saver in case of Mi4i since it doesn't have an MicroSD. If you haven't bought it yet, today maybe the time
If you have installed the driver. The copying from TWRP only works sometimes.
If you rooted then you must have used Fastboot so the drivers are there.
As hunkerpunk1 said install default ROM via fastboot using MiFlash.
Also if you are going to install CM12.1 or any custom roms here. You're phone must have MIUI 6 installed before not MIUI 7. So flash MIUI 6. Then root it and flash TWRP. Then install the ROM. This time copy the files inside the phone before hand

Please check if you're able to go into recovery (TWRP, NOT Stock), if answer is yes, you can use the mount option to copy those files again into your phone.
You simply need to :
1. Boot into TWRP
2. Connect the phone with PC (With Proper drivers installed)
3. Select the MOUNT option on TWRP Recovery
4. You'll see the prompt on your PC that Mi4i (with some Chinese words prepends) detected.
5. Copy the ROM & Gapps in phone.
6. BOOM (now I'm assuming you know how to move further)

Related

[Q] Problem with META MODE and custom recovery

I have a Lenovo A536. My problem ISN'T device specific.
I installed a custom rom and after some time it started appearing this message "System UI has stopped working".
I downloaded the original rom to flash it.
I got into TWRP and first formated my internal sdcard. The problem is that I forgot to transfer the IMG to the external sdcard. Now it doesn't have anything to boot and also I can't get in TWRP again. I also can't get in fastboot. My only solution is to do it through META MODE. I have read that I need a special cable that fits in the headphone hole.
Can you tell me:
1. How is this cable called? (in order to buy it)
2. What programs do i need to use from the computer in order to execute commands in meta mode
3. What commands i need in order to transfer the official image to my phone and/or flash it.
Any answer is acceptible

[SOLVED] Nexus 5 stuck in boot loop animation (Lollipop) , partially working with 4.4

I have a Nexus 5 32GB that's about 14 month old. Was running Lollipop 5.1 which was installed through OTA updates (4.44 >5.0 >5.01>5.1). The device is stock and unrooted.
One day, after powering the device up, it went into the boot screen and never managed to finsih the boot (for hours).
After reading extensively on this and other forums , here are the steps I tired , without success:
1. Go to bootloader and press Start
2.Go to bootloader , erase cache
3.Go to bootloader erase user data (factory reset).
I then tried to flash the factory image back. I tried all Lollipop versions from the google developers page of factory images.
starting with 5.1.0 (LMY47I) and going down. All flashing was completed successfully, but the problem remains.
Then I tried 4.4.4 (KTU84P) and the device finally booted up, but it was crippled: Most times It only sees a storage of 16GB , the phone does not recognize any cellular carriers, google play crashes, camera crashes, gallery crashes. An error states that "no external memory is available". Basically it was useless.
I took the phone to an LG lab. They said I need to replace the motherboard. Costs about 200$ !!
I was about to get a new phone , but decided to try one more google search for a fix.
This guide is for any poor soul in the same state.
This issue can be solved without replacing the motherboard for 200$.
The problem in my case was that the /persist partition was degraded, and could not mount.
I found out by trying to follow this guide: http://android.stackexchange.com/qu...dots-lollipop-screen-after-hard-factory-reset
I got as far as activating ADB Sideload when I got the error "cannot mount /persist".
This is a software problem.
Her's how to fix it (It's a long and detailed guide - but worth the result):
First, you must enable USB debugging mode , if it was not enabled (if it is enabled you can skip the first step of this guide) . The way to do that is to flash a stock image that will load, even if not fully working. In my case I could flash version 4.4x and get the phone to load. I am not aware of any other way to enable USB debugging, other than from within a working OS. If someone knows a way - please post it.
The easiest way I found to flash my phone is using Julian OS' script. You can download the stock image5.0 and 5.01 with the script from here:
https://www.androidfilehost.com/?w=files&flid=22367
You will need to adapt the 4.4x firmware to have the script flash it, but it's very easy, just a couple of files to rename.
When you open Julian's zip file you will see that he uses a script that flashes the firmware's images one by one. What I did was download the stock images from Google https://developers.google.com/android/nexus/images , used winrar to extracrt all the files from the .tgz file to a folder, then unzip the only zip file there (image-hammerhead-xxxxx.zip) which contains 5 img files. I then renamed the radio-hammerhead-xxxxx.img to radio.img and bootloader-hammerhead-xxxx.img to bootloader.img. Now all the file names comply with Julian's script. From Julian's archive copy the files "From Bootloader.bat" and "fastboot.exe" to the folder where all the images you just renamed are.
Put the phone in bootloader mode (turn the phone off, press the Vol- and the power buttons). Once the the phone is in bootloader mode, connect it to the PC and run "From Bootloader.bat" and follow the onscreen instructions. In about 2 minutes, your phone will be flashed.
Turn the phone on, it should load the OS. Disregard all the error messages, and don't bother setting the phone up. If you skip wifi, and don't have a sim in the phone you can finish the basic setup quickly.
Next you need to get developer tools activated: Settings>about phone>Build number. Tap 7 times on the build number and this will unlock Developer tools. Go back to settings and the new Developer Tools and enable usb debugging. Approve any popups.
*** I am not aware of how to enable usb debugging if you cannot go into the settings. If non of the stock images loads for you, search for a way to get usb debugging working , or else you cannot continue. You need this for ADB to connect to the phone.****
Next, you need to have ADB on your PC, and it should be able to reach your phone. If you already have - then skip to the next step. If you don't - then here is how to get the latest version:
Go here and download the installer https://developer.android.com/sdk/index.html#Other
Install the file and when it's done run SDK manager. Choose only the first 2 tools (Android sdk tools and Platform tools), this will install the latest adb and fastboot tools. To make sure all is installed open a command prompt (Click Start, type cmd in the search and run cmd.exe) and type adb. You should see all the adb possible commands typed. Now you can test if your phone can be reached by adb: connect your phone (remember usb debugging must be on!) and type: adb devices. After a few seconds you should see something like this:
List of devices attached
024703f599cc8feb device
If you get this, it means you have usb debugging enabled and a proper usb driver installed and you can go to the next step . If there is no device in the list you need to install/update the USB driver:
You have to make sure that when you connect your phone with USB debugging on, you have 2 entries in Winodws Device manager:
Under Portable devices >Nexus 5 , and under Android device> Android composite ADB Interface.
If the second one is missing, ADB will not work and you can't continue. There are 2 ways to fix that :
1. You can install an Android driver called Universal Naked Driver 0.73 from here: http://forum.xda-developers.com/showthread.php?t=2386956. Unzip the file to a folder.
The author of that guide states you need to uninstall any driver that already exists. This proved tricky because Windows would not uninstall the Nexus 5 driver. I decided to install it on a PC that has no android driver.
When you connect the phone to a windows 7 pc for the first time it will search for a driver. I disconnected the internet and windows installed a generic driver. In device manager I saw Nexus 5 with a yellow triangle. I Right clicked on it > update driver software > Browse my computer for driver software and point to the folder you unzipped the driver. You will get a warning - allow the installation.
2. If that does not work or if you don't have another "virgin" PC try this:
Run SDK Manager, under Extras mark Google USB driver. You don't need anything else marked. Install the driver.
Now connect your phone to the PC in normal mode (not bootloader!) . Open device manager. You should have two entries: Portable devices >Nexus 5 and Android device > Android Composite ADB Interface
If the second one is missing, but the Nexus 5 is properly installed, Right click on the Nexus 5 device >Update driver software > Browse my computer for driver software >Let me pick from a list. Now make sure that "Show compatible Hardware" is ticked . You should now have an entry called "USB composite device". Choose that and let it install. When it's done, if you still have an an Unknown device >Nexus 5 and no Android Composite ADB Interface in device manager, then unplug the phone and reconnect it again . You should now have both devices installed.
If by chance this does not work, and you have a Nexus 5 with a yellow error , right click it>update software driver> Browse my computer.> and point it to the Universal Naked Driver folder or the SDK>Extras>Google USB driver folder and it should update so both devices appear (Nexus 5 and ADB).
Once adb can see your pohne go here, to read bitdomo's guide to fix the broken persist partition.
http://forum.xda-developers.com/google-nexus-5/general/guide-to-fix-persist-partition-t2821576
There are some prerequisites to getting this to work:
The first one is that the phone can be reached by ADB, this is why you needed the usb debugging mode to be turned on, and the proper usb driver installed.
Second, you need to install a custom recovery image. Don't worry, you will overwrite it later. The one I used is TWRP. Get the latest version from here:
http://techerrata.com/browse/twrp2/hammerhead
To install I recommend you copy Fastboot.exe and the TWRP file to an empty folder on your PC . Rename the TWRP file to "recovery.img". Open a command prompt in the folder (see here if you don't know how http://www.techsupportalert.com/content/how-open-windows-command-prompt-any-folder.htm) , in the black window type: fastboot flash recovery recovery.img and hit Enter. Wait a few seconds and it will finish.
Last, you need to root your device. There are many ways to do this. I did this very simply by downloading CF-Auto-Root from https://autoroot.chainfire.eu/ The file you need is this: https://download.chainfire.eu/363/CF-Root/CF-Auto-Root/CF-Auto-Root-hammerhead-hammerhead-nexus5.zip . Unzip it, put your phone in bootloader, run root-windows.bat.
Now you are prepaired... Follow the guide by bitdomo . Open a command prompt , and run the 2 commands bitdomo wrote. You will get a series of questions , type y followed by Enter until it's all done.
SInce you are still in bootloader mode, and a big START is at the top of the screen, click the power button to reboot. Now your oS 4.4x should load properly. Make sure everything is working.
I did not follow the steps for the wifi and BT fix , because they worked fine (and still do 4 months later) , but you can go ahead and do that too.
Now you can flash to the latest firmware 5.10 - download the file from the developer site I gave before, use Jason Os's script to flash the image, and lock the device. Done! Boot up the device and make sure it recognizes the right amount of RAM on your phone (16 or 32GB). If it does, then all is well .
When I first booted the device , I saw that it only recognized 16GB instead of 32GB. To solve this install TWRP again, go to Wipe>Format data . Then reboot the device and make sure you have 32GB.
If you like the stock recovery instead of TWRP you can use Fastboot to flash the original recovery.img.
Now you have a working Nexus 5 , v5.10.
Thanks to LyricWulf and bitdomo for their life saving guides. I hope this helps others in the same spot, and saves them 200$ .
stuck at unlock step
how u unlock nexus 5 when stuck booplop n cnt go to android screen?alrdy using ths step "fastboot oem unlock" when i reboot for unlock,stuck at bootloop n alrdy w8ing 24hr still bootloop cnt see android home screen...n i go to restart nexus5,n locked again... i just stuck on this place,cnt go to next step..pls help me
sry my englsh so bad
Thanks! Helped me to save my N5!
Do not need to exactly as it is posted but the directions is good!
Thanks again.
killian.1140 said:
how u unlock nexus 5 when stuck booplop n cnt go to android screen?alrdy using ths step "fastboot oem unlock" when i reboot for unlock,stuck at bootloop n alrdy w8ing 24hr still bootloop cnt see android home screen...n i go to restart nexus5,n locked again... i just stuck on this place,cnt go to next step..pls help me
sry my englsh so bad
Click to expand...
Click to collapse
Not sure what your problem is, but if you are stuck at the boot screen (with the colored dots spinning) you might have the smae problem I describe. You can try to go to bootloader and wipe the cache, if that does not help and you don't mind a wiping all your data do a factory reset. , Go to recovery mode (third option in bootloader), then press the powr and vol up buttons together several times until you get into recovery. Then choose what you want to wipe.
If that does not restore your phone you need to follow my guide. Probably your persist partion is degraded and needs to be fixed. If you follow my guide you will find out what your problem is.
Good luck
Or just read the stickies.
I had the same problem, and for me, simple NAND restore from TWRP recovery solved this issue. I recently made this NAND backup for no reason and it happens to be a very good move. Cheers
Thank you so much for this! You saved my phone!
volvoxxda said:
I had the same problem, and for me, simple NAND restore from TWRP recovery solved this issue. I recently made this NAND backup for no reason and it happens to be a very good move. Cheers
Click to expand...
Click to collapse
But for that you have had to install TWRP in the first place...
Mine was stock.
Where is the backup saved?
Mine was rooted + TWRP recovery and I saved my backup on flash drive with TWRP's backup option. I was able to boot into boot menu (pwr + vol-) and it would let me to enter into TWRP only. For me it was enough to initiate a restore process..
volvoxxda said:
Mine was rooted + TWRP recovery and I saved my backup on flash drive with TWRP's backup option. I was able to boot into boot menu (pwr + vol-) and it would let me to enter into TWRP only. For me it was enough to initiate a restore process..
Click to expand...
Click to collapse
Flash drive? Do you mean the Nexus internal memory?
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
External, like on this picture.
Final solution: power button micro tactile switch was faulty, causing boot loop from time to time. Replacing that little bastard solved this heartbreaking issue
volvoxxda said:
Final solution: power button micro tactile switch was faulty, causing boot loop from time to time. Replacing that little bastard solved this heartbreaking issue
Click to expand...
Click to collapse
Did you just replace the button or did you have to replace something more?
Thanks
Just the button. You can DIY, it's easy.
worked
worked great. confusing in the start but got it working. Thanks for a life saving guide for nexus 5
incredible
Hi eross,
I registered and logged in just to say thank you for this amazing tutorial. I've been trying to repair my N5 for about 12 hours, and I was about to give up when I saw this post. You saved my Nexus!!
Thanks again. :victory::highfive::good:
eross said:
Not sure what your problem is, but if you are stuck at the boot screen (with the colored dots spinning) you might have the smae problem I describe. You can try to go to bootloader and wipe the cache, if that does not help and you don't mind a wiping all your data do a factory reset. , Go to recovery mode (third option in bootloader), then press the powr and vol up buttons together several times until you get into recovery. Then choose what you want to wipe.
If that does not restore your phone you need to follow my guide. Probably your persist partion is degraded and needs to be fixed. If you follow my guide you will find out what your problem is.
Good luck
Click to expand...
Click to collapse
What if you cannot even get into recovery because it is missing?
Sent from my SM-G920T
ambervals6 said:
What if you cannot even get into recovery because it is missing?
Sent from my SM-G920T
Click to expand...
Click to collapse
You can try to download the stock firmware that's installed on your phone and flash the recovery img, or flash twrp recovery.
help
eross said:
This is a Nexus 5 32GB that's about 14 month old. Was running Lollipop 5.1 which was installed through OTA updates (4.44 >5.0 >5.01>5.1). The device is stock and unrooted.
Yesterday after powering the device up, it went into the boot screen and never managed to finsih the boot (for hours).
After reading extensively on this and other forums , here are the steps I tired , without success:
1. Go to bootloader and press Start
2.Go to bootloader , erase cache
3.Go to bootloader erase user data (factory reset).
I then tried to flash the factory image back. I tried all Lollipop versions from the google developers page of factory images. (can't post links yet...)
starting with 5.1.0 (LMY47I) and going down. All flashing was completed successfully, but the problem remains.
Then I tried 4.4.4 (KTU84P) and the device finally booted up, but it is crippled: Most times It only sees a storage of 16GB , the phone does not recognize any cellular carriers, google play crashes, camera crashes, gallery crashes. An error states that "no external memory is available". Basically it is useless.
I am wondering if it is a software or hardware problem. It appears as though part of the phone's memory is not functioning . Is there a way to check this? Is there a way to fix this?
Thanks
Edit: Just came back from an LG lab. Bad news. Need to replace the motherboard. Costs about 200$ !! Can't find anything cheaper on ebay. Guess it's time for a new phone
Edit #2 - SOLVED !!:laugh:
OK, this for any poor soul in the same state. This issue can be solved without replacing the motherboard for 200$.
The problem in my case was that the /persist partition was degraded, and could not mount. Here is how I found it out, and how I fixed it:
First, try to flash a stock image that will load, even if not fully working. You will need this later. In my case I could flash version 4.4x and get the phone to load.
The easiest way I found to flash my phone is using Julian OS' script. You can download the stock image5.0 and 5.01 with the script from here:
https://www.androidfilehost.com/?w=files&flid=22367
You will need to adapt the 4.4x firmware to have the script flash it, but it's very easy, just a couple of files to rename.
When you open Julian's zip file you will see that he uses a script that flashes the firmware's images one by one. What I did was download the stock images from Google https://developers.google.com/android/nexus/images , used winrar to extracrt all the files from the .tgz file to a folder, then unzip the only zip file there (image-hammerhead-xxxxx.zip) which contains 5 img files. I then renamed the radio-hammerhead-xxxxx.img to radio.img and bootloader-hammerhead-xxxx.img to bootloader.img. Now all the file names comply with Julian's script. From Julian's archive copy the files "From Bootloader.bat" and "fastboot.exe" to the folder where all the images you just renamed are.
Put the phone in bootloader mode (turn the phone off, press the Vol- and the power buttons). Once the the phone is in bootloader mode, connect it to the PC and run "From Bootloader.bat" and follow the onscreen instructions. In about 2 minutes, your phone will be flashed.
Turn the phone on, if you are lucky it will load the OS. Disregard all the error messages, and don't bother setting the phone up. If you skip wifi, and don't have a sim in the phone you can finish the basic setup quickly.
Next you need to get developer tools activated: Settings>about phone>Build number. Tap 7 times on the build number and this will unlock Developer tools. Go back to settings and the new developer tools and enable usb debugging. Approve any popups.
I am not aware of how to enable usb debugging if you cannot go into the settings. If non of the stock images loads for you, search for a way to get usb debugging working , or else you cannot continue. You need this for ADB to connect to the phone.
Once this is done , boot the phone into debugging mode.
Read the guide here http://android.stackexchange.com/qu...dots-lollipop-screen-after-hard-factory-reset
I got as far as activating ADB Sideload when I got the error "cannot mount /persist". I then understood what the problem was. If you get the same error - you are in luck!
Then go here, to learn how to fix the broken persist partition.
http://forum.xda-developers.com/google-nexus-5/general/guide-to-fix-persist-partition-t2821576
There are some prerequisites to getting this to work.
The first one is that the phone can be reached by ADB, this is why you needed the usb debugging mode.
Second, you need to install a custom recover image. Don't worry, you will overwrite it later. The one I used is TWRP. Get the latest version from here:
http://techerrata.com/browse/twrp2/hammerhead
To install I recommend you copy Fastboot.exe and the TWRP file to an empty folder on your PC . Rename the TWRP file to "recovery.img". Open a command prompt in the folder (see here if you don't know how http://www.techsupportalert.com/content/how-open-windows-command-prompt-any-folder.htm) , in the black window type: fastboot flash recovery recovery.img and hit Enter. Wait a few seconds and it will finish.
Third, you need to install an Android driver called Universal Naked Driver 0.73 from here: http://forum.xda-developers.com/showthread.php?t=2386956. Unzip the file to a folder.
Since the author of that guide states you need to uninstall any driver that already exists, I decided to install it on a PC that has no android driver. When you connect the phone to a windows 7 pc for the first time it will search for a driver. I disconnected the internet and windows installed a generic driver. In device manager I saw Nexus 5 with a yellow triangle. I Right clicked on it > update driver software > Browse my computer for driver software and point to the folder you unzipped the driver. You will get a warning - allow the installation.
Last, you need to root your device. (I think this can also be done from within TWRP , but I am not sure how...) I did this very simply by downloading CF-Auto-Root from https://autoroot.chainfire.eu/ The file you need is this: https://download.chainfire.eu/363/CF-Root/CF-Auto-Root/CF-Auto-Root-hammerhead-hammerhead-nexus5.zip . Unzip it, put your phone in bootloader, run root-windows.bat.
Now you are prepaired... Follow the guide by bitdomo . Open a command prompt where adb.exe is located , and run the 2 commands bitdomo wrote. You will get a series of questions , type y followed by Enter until it's all done.
SInce you are still in bootloader mode, and a big START is at the top of the screen, click the power button to reboot. Now your oS 4.4x should load properly. Make sure everything is working.
Now you can flash to the latest firmware 5.10 - download the file from the developer site I gave before, use Jason Os's script to flash the image, and lock the device.
When I first booted the device , I saw that it only recognized 16GB instead of 32GB. To solve this install TWRP again, go to Wipe>Format data . Then reboot the device and make sure you have 32GB.
If you like the stock recovery instead of TWRP you can use Fastboot to flash the original recovery.img.
Now you have a working Nexus 5 , v5.10.
Thanks to LyricWulf and bitdomo for their life saving guides. I hope this helps others in the same spot, and saves them 200$ .
Addendum: According to bitdomo, installing a custom recovery like TWRP enables USB debugging by default even if the phone does not boot. I have not tried this myself, but this means you can foergo installing os 4.4x , and go straight to ADB and run the command that fixes the persist partition.
Go ahead and try it. It will save you a lot of time!
Click to expand...
Click to collapse
My N5 has exact problem as yours even same errors of camera and playstorw crashing when i loaded older android version.. now im positive your instructions will help me but im having some trouble with your steps i do not know how to type comnands with ADB .. im truly novice and dont want to damage the phone more could you simplify the steps or make a video please? Thank you
Sorry, I can't make it any simpler than that. I can't make a video now because my phone is fixed. Adb is very simple, it's like an old DOS window where you type the text. I would follow Bitdomo's advice and start by installing TWRP. This will get you USB debugging, and you can run ADB and follow his instructions to fix the persist partition.

Phone stuck in Cyanogen boot logo after trying to flash CM12.0s

It's been a rough morning over here.
I've had a lot of issues with the latest update (12.1) so I decided to download the .zip for CM12s and install it from recover - the exact same way I updated it initially (before I got the 12.1 OTA update).
I used the same .zip file from before, builds.cyngn.com/cyanogen-os/bacon/12.0-YNG1TAS0YL-bacon/2263178b74/cm-12.0-YNG1TAS0YL-bacon-signed
After installing from internal storage from the menu, it seems to install fine, and then it takes me back to the menu and I select Restart System.
After 20 minutes looking at the Cyanogen boot logo, I'm assuming it's stuck.
When I plug the phone into the computer, it says it's charging but neither Windows or my Chromebook recognize the device to allow file transfer.
If I press down+power, I can still get to the Cyanogen menu, but without a new .zip file I'm not sure what else to try.
Any advice? I'm pretty worried!
nagem145 said:
It's been a rough morning over here.
I've had a lot of issues with the latest update (12.1) so I decided to download the .zip for CM12s and install it from recover - the exact same way I updated it initially (before I got the 12.1 OTA update).
I used the same .zip file from before, builds.cyngn.com/cyanogen-os/bacon/12.0-YNG1TAS0YL-bacon/2263178b74/cm-12.0-YNG1TAS0YL-bacon-signed
After installing from internal storage from the menu, it seems to install fine, and then it takes me back to the menu and I select Restart System.
After 20 minutes looking at the Cyanogen boot logo, I'm assuming it's stuck.
When I plug the phone into the computer, it says it's charging but neither Windows or my Chromebook recognize the device to allow file transfer.
If I press down+power, I can still get to the Cyanogen menu, but without a new .zip file I'm not sure what else to try.
Any advice? I'm pretty worried!
Click to expand...
Click to collapse
Have you tried using fastboot to flash the stock images?
Are you using twrp?
1.I suggest installing twrp vor any recovery you like.
2. Than redownload rom and gapps (just to be sure)
3. Mount your device as mtp storage in twrp and put Rom and gapps in it
4. Than wipe /system /data /cache
(data wipe will delete all apps, your internal storage will be untouched)
5. flash rom and gapps
6. reboot your phone
If that does not help try Heisenbergs solution.

TWRP modded to work now with Unihertz Atom

Below you will find a download for my modification of a ported Team Hovatek TWRP file as their TWRP did not support OTG. Thanks to Team Hovatek for making a nice porting tool. Unfortunately it took some days and late nights of work to get the ported TWRP to actually be useful as this phone needs OTG support to use TWRP.
When I recently got the Unihertz Atom I didn't realize that it had no micro SD card slot for an external SD card like the Unihertz Jelly Pro had. However it does have OTG support unlike the Jelly Pro but I could not find any TWRP versions for the Atom. So I found a TWRP porting tool from Hovatek and I was able to create a TWRP version but USELESS unfortunately as that version of TWRP did not have OTG support for the Atom.
To make matters worse that TWRP can't deal with the encrypted internal storage of the Atom so there was no way to do a backup of your system. It was possible to format data in TWRP and do a backup to it but upon reboot all that data was gone and reset by the Atom as an essentially new phone being setup for the first time.
I needed a way to modify the ported TWRP so it would recognize an OTG flash drive or USB flash with an OTG cable. I used Image Kitchen to disassemble the original Atom Recovery image and also the modded TWRP recovery image so I could find what was missing from TWRP that was there in the original setup. After a whole lot of reassembling and reflashing various attempts to fix the OTG problem I finally got it. Had to add different lines of code to 3 different files within the unpacked TWRP recovery for it to finally recognize an OTG attached flash drive.
A couple notes on using your external flash drive with TWRP. First you want to insert the flash drive with an appropriate USB type C OTG adapter or cable. Or I see Sandisk (and possibly other brands) are now making a flash drive with USB and Type C dual setup for OTG use.
Bootup your regular phones Android system and look in the pull down notifications - it will ask if you want to use the flash drive as storage. Answer yes and it will then Format it to FAT32 0x0C type which is different than what it was fresh out of the package as most will be FAT32 0x0B type. Once formatted the way the Atom wants it you can use it. However if you put the drive back in your Windows computer it may not see the drive at all. The solution is to open Windows Disk Management and Assign it a drive letter. Once that is done you can read and write to it from both Android and Windows or Linux.
Once that is done you can turn off your phone (IMPORTANT). Do not use any apps that reboot into recovery after installing this TWRP or you will likely just get a black screen and it won't boot up until you reflash the preloader, boot and recovery.
To get into recovery hold down the Volume UP button and the Power button at the same time until you see Unihertz then release both. This is of course after you have flashed TWRP. More on that below. Once your are in TWRP you may have to remove your Flash drive if you had it plugged in during recovery boot up - then reinsert it for TWRP to see it. You can then see it when you mount storage or select storage and it should show the size of your flash drive.
You can then backup your Boot, Recovery, EMMC, System and cache. However the data on the Atom seems to be encrypted in a way that this TWRP does not see it so it will be best to use something like Titanium backup for your Apps and their data. The TWRP though will ensure a complete backup of your system and it's settings as well as the other items mentioned above. I am still looking into why it can't see the encrypted data part of the phone but for now it's nice to have an image of all the rest of the phone. If anyone can help with that I would appreciate it. So far I've tried several 'no encrypt scripts' and ones to turn off DM verity I found on XDA but none of them worked on this phone.
Here is the download of my modded TWRP and also a link for the SHA-256 of it:
TWRP mod: TWRP mod by droidzer1
SHA-256 for file above: SHA-256 for TWRP mod Love the Atom - fast Octacore 4GB Ram - 64GB Internal storage, rugged and tiny as an underfed mouse. :silly: Enjoy !
Notes on Installing this TWRP on your Atom
There are two ways I have used to install this TWRP onto the Atom. One way (and the best way IMO) is to use the SP Flash tool version 5.1828. The other is to use Fastboot. I believe for both methods you need to enable developer options on your phone and turn on OEM unlocking. But if you use Fastboot you also have run the line: "fastboot oem unlock" to install TWRP and that will wipe your phone to a new reset condition plus you will see the 5 second "Orange State" pause screen every time you turn on the phone. To eliminate the "Orange State you can run : "fastboot oem lock" but that will once again totally reset your phone wiping everything including apps and settings. So I prefer using SP Flash tool to avoid all that.
When installing with SP Flash tool I always flash the preloader, boot and recovery (the TWRP modded one) and of course the scatter file. It seems if you don't flash all of those it sometimes doesn't want to boot up.
Also this mod is for the official Unihertz 11-30-2018 ROM version which is the latest update I've seen as of a week ago. I don't know if it will work for other versions. You will want to download that ROM to get the scatter file that is needed by SP Flash tool and it's always good to have an original ROM just in case. Link for the new 11-30-2018 Atom ROM here: 11-30-2018 Atom ROM If you are not on that version you could backup your apps and data with Titanium backup and then install the new ROM while flashing my modded TWRP all at the same time. Just make sure the TWRP you download is named "recovery-verified.img" when you replace the stock one in the SP Flash tool list on the Download page. Also make sure on the tools 'Connections' setting that you check 'Battery installed'.
IMPORTANT!!! - Every version of SP Flash tool I've used shows up as having a virus or trojan and although it may probably be a False positive to be safe I always run Shadow Defender before starting the SP Flash tool. There may be other similar programs but I found this to be one of the best as it totally freezes your computer and hard drive(s) so nothing can be changed or written permanently to them while in Shadow mode. Once you reboot everything is back to a normal state and any changes that may have been made are gone. SP Flash tool available here: SP Flash tool v5.1828 I strongly suggest you use this latest version as previous ones had some issues in completing this project.
A couple quick notes on using the SP Flash tool: It is best to start the tool, have all your items in the check boxes loaded (select scatter file location first) check and locate preloader, boot and recovery - the preloader and boot are from the original ROM you downloaded from the above link. Unzip it and you'll see the needed files inside along with the scatter file.
Once that is ready turn OFF your phone and hook it up with the original USB-C cable to your computer. Wait for it to show the battery charging screen and wait till all that disappears and you have nothing but the black screen. (Or per user SepticFuddy you can hold the Volume Up key while inserting the USB cable and it will connect quickly - I have not tested it this way). Then click on the Flash tool download button. After that you need to push the Atom Power button once briefly - not long enough to turn it on - just a brief click. After that you should see the Flash process going on - it only takes a few seconds to load the preloader, boot and recovery and then you will see a "done" with a big check mark. Remove your phone then and boot into your regular Android OS or use Volume Up and the Power key to boot into your TWRP. :highfive:
Why TWRP doesn't work with Encryption - from TeamWin
I guess this may explain why it is unlikely to get TWRP to work with the encrypted data partition - straight from Teamwin's TWRP website:
"Why doesn't TWRP support encryption on my device?
TWRP encryption is supported in 2 phases. The first item is keeping up with the newest support from AOSP, which can require lot of changes and integration with the new AOSP release. This can take time especially if we have to wait for reference devices to test with. The second item is custom blob support and integration with device OEM firmware.
Even if your device supports AOSP encryption and decryption, it usually requires custom blob support. The process of figuring this out may take time and may never be done. Some vendors such as Samsung use their own encryption techniques. Without heavy deconstruction/decompiling of custom library blobs, and successful ports by an active maintainer, this may never be done. Encryption support is a nice thing to have in TWRP, and not a must have support option. We feel that the ability to backup system and install custom firmware can outweigh having no TWRP support at all."
From: TWRP Website FAQ on Encryption
How I fixed TWRP
For anyone who wants to try the mods their self if you don't trust using the recovery I uploaded I believe these are the changes I made to the ported TWRP. You need of course the porting tool from Hovatek and after you have ported your original recovery you will want to use Image Kitchen to make these mods to the ported image:
Use Image Kitchen to unpack the ported TWRP recovery. In the Ramdisk folder this line "ro.agui.otg_usbdisk=yes" orginally found in the prop.default of the original recovery needs to be put into the file "default.prop" which is a different file name than the original but I am sure is the same purpose and was referenced in the original by a small file with that name.
Then this line "/dev/mt_otg_test(/.*)? ubject_r:mt_otg_test_device0" from the original recovery image in the file "nonplat_file_contexts" I believe I copied into the file "file_contexts" in the TWRP image in the Ramdisk folder.
Note - the above code line that has a smiley in it is because there is the letter "o" followed by a colon. Replace the smiley with "o" and : no spaces between it and the letter 'u' before it or between 'o' and :
I think the third file I modified was found in the unpacked folder /ramdisk/etc in the file 'recovery.fstab' and I took this line "/devices/platform/mt_usb* auto vfat defaults voldmanaged=usbotg:auto " from it to add to the same file in the ported TWRP. Then just repack everything in Image Kitchen and you should have a TWRP recovery that works with OTG.
If you aren't familiar with how to use Image Kitchen it would be best to google how to use it. I have left out some of the basics such as needing to Copy the “recovery.img-kernel” and “recovery.img-kernel_offset” from the unpacked stock recovery and overwrite those two files in ported TWRP folder. Best to look for an instruction article on techora.net about porting TWRP on mediatek devices.
Thank you, it's awesome! But how did you manage to flash Magisk? I can't flash it as /data and /storage can't be mounted.
You should be able to flash it with Fastboot by using command:
fastboot flash boot /path/to/patched_boot.img OR simply put it in the fastboot folder and type:
fastboot flash boot boot.img (the patched boot image)
You may want to review info on the Magisk thread here:
https://forum.xda-developers.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445
This method of course is done with you computer and USB cable attached to the Atom. Make sure you have correct drivers for it to fully recognize your phone.
A bit more info from topjohnwu's Magisk thread mentioned above:
Via Magisk Manager:
This method does not need root, and also does not require a custom recovery.
However, you MUST have a stock boot image dump beforehand, and you also have to be able to flash the patched boot image, either through fastboot/download mode or ODIN
Install the latest Magisk Manager
If you're planning to flash the patched boot image through ODIN, go to Settings > Update Settings > Patched Boot Output Format, and select .img.tar. For normal users leave it as the default .img
Press Install > Install > Patch Boot Image File, and select your stock boot image file
Magisk Manager will now patch your boot image, and store it in [Internal Storage]/Download/patched_boot.img[.tar]
Copy the patched boot image to your PC. If you can't find it via MTP, you can pull the file with ADB:
adb pull /sdcard/Download/patched_boot.img[.tar]
Flash the patched boot image to your device and reboot. Here is the command if using fastboot:
fastboot flash boot /path/to/patched_boot.img
If the above method fails for some reason you should also be able to flash to patched boot image with SP flash tools as long as you have the scatter file for the ROM you have installed on your phone. As I mentioned if you flash the patched boot image that way I found it best to also flash the preloader and recovery at the same time.
Cannot mount /data
What you did here was remarkable. I love the Atom so I never tried to tinker with recovery since I might end up with a bootloop. I hope we find a solution soon on how to mount /data.
post-root network failure
First off thank you for doing the research and posting in the thread to help us root this awesome little device.
I followed your steps to the "T" and I was able to successfully patch magisk and re-download it back onto my atom and it was rooted BUT, there seems to be some sort of network issue that I'm stuck on, I'm unable to turn on the wi-fi and bluetooth and every few seconds I keep getting an error message that says "bluetooth keeps stopping" consistently whenever I have the phone on.
I was wondering If you had any idea on what might be causing this, or if you had this problem.
thank you, and I look forward to hearing back from you
droidzer1, Finally got to post now and wanted to thank you for your work on the Atom. I got it rooted and got TWRP working too with only some frustrations because I got in a hurry and missed a detail the first try. I haven't found any problems and have had it running about 2 weeks now with root and TWRP. Nice to have root and of course great to be able to do a whole system backup now!
---------- Post added at 03:08 AM ---------- Previous post was at 03:02 AM ----------
hayestak said:
First off thank you for doing the research and posting in the thread to help us root this awesome little device.
I followed your steps to the "T" and I was able to successfully patch magisk and re-download it back onto my atom and it was rooted BUT, there seems to be some sort of network issue that I'm stuck on, I'm unable to turn on the wi-fi and bluetooth and every few seconds I keep getting an error message that says "bluetooth keeps stopping" consistently whenever I have the phone on.
I was wondering If you had any idea on what might be causing this, or if you had this problem.
thank you, and I look forward to hearing back from you
Click to expand...
Click to collapse
Were you able to get this fixed? Doesn't look like droizer1 has been on here recently. Mine didn't have either of those issues. Have you tried doing a factory reset and doing the whole process over? I think sometimes just a computer PC might glitch something on your phone so doing it over might skip the hiccup.
---------- Post added at 03:48 AM ---------- Previous post was at 03:08 AM ----------
Since droidzer1 first posted this in early January you might try using the version of Magisk that was available at that time as I think by later March when you posted there was a newer version out and I've found some versions of Magisk to not work a hundred percent and had to use an older version on some phones.
The latest Magisk (19100) + Xposed (v90 beta 3) work fine for me using the TWRP posted above, in case people were wondering about it.
R
Lost in reboot ...
Hi
I urgently need some help. I seem to be lost...
I have successfully installed TWRP on my Unihertz atom. And I can manage to go into either TWRP mode or into fastboot mode.
I can also successfully unlock the Unihertz atom with:
fastboot oem unlock-go
But what is next?
If I reboot, my phone constantly reboots. It cycles into reboot without Android coming up.
(perhaps I made something wrong).
What I actually want is: The phone should boot including Magisk.
Can anyone please help me what commands I have to issue (with the phone connected to my linux computer via USB) in order
to recover to a normal reboot? Which image-file should I use (please provide URL)?
Can anyone please help me what commands I have to issue to flash Magisk?
Which image-files I should use (please provide URL)?
If somebody has a custom rom or lineageOS rom I would be even happier ...
Thanks a lot.
Thank you
Confirmed working with the Android 9 Pie 2019082617 ROM, latest Magisk 19.3 (19300), latest Riru core v19.5, latest Riru- EdXposed v0.4.5.1b (4463) (SandHook). EdXposed seems hit or miss after a reboot though, getting it to stick may take a few installations.
To get SP Flashtool to work, I had to hold the Volume Up key while inserting the USB cable and it would instantly connect, rather than following the OP's instructions of just inserting the cable and waiting for a black screen.
I'd love to see a custom ROM like LineageOS or something, but this is will have to do for now.
SepticFuddy said:
Confirmed working with the Android 9 Pie 2019082617 ROM, latest Magisk 19.3 (19300), latest Riru core v19.5, latest Riru- EdXposed v0.4.5.1b (4463) (SandHook). EdXposed seems hit or miss after a reboot though, getting it to stick may take a few installations.
To get SP Flashtool to work, I had to hold the Volume Up key while inserting the USB cable and it would instantly connect, rather than following the OP's instructions of just inserting the cable and waiting for a black screen.
I'd love to see a custom ROM like LineageOS or something, but this is will have to do for now.
Click to expand...
Click to collapse
Thanks for the mention of a quicker method. I've updated my post to include your info.
LineageOS for Uniherz Atom?
SepticFuddy said:
I'd love to see a custom ROM like LineageOS or something, but this is will have to do for now.
Click to expand...
Click to collapse
Me too!! LineageOS for the Unihertz Atom would be great!
The hadrware of the Uniherz Atom is just great, is is small and it is dual-sim. This is unique in the market.
I would be even willing to contribute with 100,- EUR if somebody delivers a working LineageOS ROM.
Any body interested? :highfive:
SepticFuddy said:
I'd love to see a custom ROM like LineageOS or something, but this is will have to do for now.
Click to expand...
Click to collapse
The main problem is that unihertz never released their source code (despite being obliged to do so according to the android licensing contract).
There are some bits in the official mediatek kernel source tree (https://android.googlesource.com/kernel/mediatek/) but I doubt that this would be enough to build something stable out of it.
@droidzer1 Hey there, what is the difference between your modded TWRP and this test release by the TWRP Builder Project asside from the TWRP version?
J-Kos said:
@droidzer1 Hey there, what is the difference between your modded TWRP and this test release by the TWRP Builder Project asside from the TWRP version?
Click to expand...
Click to collapse
I'm not sure what the difference is except I came out with mine in January and theirs came out in March. Theirs is about 4 Megabytes bigger - maybe a newer version (mine is 3.2.1-0). I contacted 'bigbiff' at TWRP about mine when I had it working but they were not interested unless I had a device tree which I didn't so they didn't want to post it on their site.
Great, thanks for your reply. I am satisfied with you version, so I will just keep using it.

[OnePlus6] Phone frozen (bricked?) while installing Kali NetHunter.

Wanted to install NetHunter on my phone to learn. Here is a story of a foolish student decided to make his life difficult:
Device: OnePlus 6
Model: A6000
Android 10
Here are the steps I followed:
Followed these two documentations:
1) https://www.kali.org/docs/nethunter/installing-nethunter/#1-nethunter-support-and-pre-built-images
2) https://www.kali.org/docs/nethunter/
So downloaded the zip image > put android in developer mode with OEM and advanced reboot and debugging enabled > Fastboot menu
Then I followed this guide for step 3-5 from link 1:
https://forum.xda-developers.com/t/...-flash-twrp-root-nandroid-efs-backup.3792643/
(a little bit google reading said TWRP takes care of A/B style devices by itself no special steps needed)
Set up the windows machine with fastboot, adb and device drivers > run the command "fastboot oem unlock" > transferred twrp zip to the device internal storage > then flashed the new recovery mode "fastboot boot twrp.img" > install and selected the twrp zip that I had saved in internal storage before > reboot > system.
So far worked perfectly.
Then I downloaded the Magisk apk from github and installed it by transferring it to internal storage.
Next for step 6 from link 1:
I again download the ForceEncrypt disabler from zip and transfer it to internal storage then flash it using TWRP.
So far no errors.
Now the final step should have been to flash the nethunter zip image and this is where the problems started:
I tried to flash it using TWRP but it gave me an error about there not being enough storage.
Saw a YT video where he extracts the nethunter zip and via the magisk app does a install on the tar file found inside the extracted folder. This also failed.
After a bit google it said it was because I did not have custom ROM and chroot and lineageOS should solve my problem.
I flash the LineageOS zip image using TWPR > successful but says I should switch the slot to complete the zip files installed.
After switching and rebooting, fastboot goes to lineage always and its a bootloop , so no matter what I select its always reaching the same screen and I cant tranfer zip to internal anymore to try a different build.
So now I run the command fastboot boot twrp.img again and go back to slot A.
Now my phone is stuck in bootloader. No matter what option I select out of the 4:
Start
Recovery mode
restart bootloader
power off
(latter two work as expected technically)
I always end up on the same screen.
After connecting the phone it is showing it as connected in "fastboot devices" now but fastbood is not able to flash or boot any image to it: either freezes or unknown error. "adb devices" shows no devices.
Practically begging for help right now.
To fix your phone, you should use this recovery tool.
https://forum.xda-developers.com/t/op6-latest-10-3-8-collection-of-unbrick-tools.3914109/
You can follow a tutorial like this one
Good luck
You haven't chosen the right place to ask for help. delete your post or change it to "Questions and answer". Have a good day.
d
CarlosTime said:
You haven't chosen the right place to ask for help. delete your post or change it to "Questions and answer". Have a good day.
Click to expand...
Click to collapse
Thank you. I am trying the suggested video right now.
Do you also know why I get the storage error while trying to flash nethunter?
take it easy, relax i have a long story with oneplus too
send me msg on telegram so i can help u 98%
uaername : NotReal0
stay safe bro, and dont worry i dont need you money just bc im noob with english so i just know that u damaged ur phone and i know how to fix
saffron_jedi said:
Wanted to install NetHunter on my phone to learn. Here is a story of a foolish student decided to make his life difficult:
Device: OnePlus 6
Model: A6000
Android 10
Here are the steps I followed:
Followed these two documentations:
1) https://www.kali.org/docs/nethunter/installing-nethunter/#1-nethunter-support-and-pre-built-images
2) https://www.kali.org/docs/nethunter/
So downloaded the zip image > put android in developer mode with OEM and advanced reboot and debugging enabled > Fastboot menu
Then I followed this guide for step 3-5 from link 1:
https://forum.xda-developers.com/t/...-flash-twrp-root-nandroid-efs-backup.3792643/
(a little bit google reading said TWRP takes care of A/B style devices by itself no special steps needed)
Set up the windows machine with fastboot, adb and device drivers > run the command "fastboot oem unlock" > transferred twrp zip to the device internal storage > then flashed the new recovery mode "fastboot boot twrp.img" > install and selected the twrp zip that I had saved in internal storage before > reboot > system.
So far worked perfectly.
Then I downloaded the Magisk apk from github and installed it by transferring it to internal storage.
Next for step 6 from link 1:
I again download the ForceEncrypt disabler from zip and transfer it to internal storage then flash it using TWRP.
So far no errors.
Now the final step should have been to flash the nethunter zip image and this is where the problems started:
I tried to flash it using TWRP but it gave me an error about there not being enough storage.
Saw a YT video where he extracts the nethunter zip and via the magisk app does a install on the tar file found inside the extracted folder. This also failed.
After a bit google it said it was because I did not have custom ROM and chroot and lineageOS should solve my problem.
I flash the LineageOS zip image using TWPR > successful but says I should switch the slot to complete the zip files installed.
After switching and rebooting, fastboot goes to lineage always and its a bootloop , so no matter what I select its always reaching the same screen and I cant tranfer zip to internal anymore to try a different build.
So now I run the command fastboot boot twrp.img again and go back to slot A.
Now my phone is stuck in bootloader. No matter what option I select out of the 4:
Start
Recovery mode
restart bootloader
power off
(latter two work as expected technically)
I always end up on the same screen.
After connecting the phone it is showing it as connected in "fastboot devices" now but fastbood is not able to flash or boot any image to it: either freezes or unknown error. "adb devices" shows no devices.
Practically begging for help right now.
Click to expand...
Click to collapse
I had the same issue after trying to install nethunter myself. Unfortunately for me the MSMDownload tool wouldn't work because I couldn't get the phone to stay off, it would just boot back up into bootloader/fastboot mode as soon as I connected to the computer via usb cable.
Here's the solution that will work 100%. Go to this website below and download the stock OOS zip file for your phone, in my case it was the Oneplus 6T fastboot ROM. Unpack the files into your platform-tools folder, click skip all if it asks you if you want to replace any files in that folder, then run the flash-all.bat and it will unbrick your device. Keep in mind that it will unroot your device and remove twrp as well. There's a thread here that explains how to do it manually so that doesn't happen but its a bit of work to get it done that way.
FastbootRoms Activity
sourceforge.net

Categories

Resources