Turn on Mi pad 4 when charger connected - Xiaomi Mi Pad 4 Questions & Answers

Try to use Mi pad 4 on my car dash.
I am planning to install it permanently so I won't be able to use power button to turn the device on.
Here is my scenario.
When the ignition on it will start charging the Mi pad.
When Mi pad senses the power connected. It boots up. When the ignition off, tasker will turn the Mi pad off.
I found some info for Samsung devices and Nexus. But no luck with Xiaomi.
I have a root access with factory recovery.
Need your help.

I know some devices which do that, which is annoying.. Every iDevice does it..
But it seems to have todo something with the kernel.
Or you could try this here (but it is from 2016).
http://en.miui.com/forum.php?mod=viewthread&tid=382444&page=1#pid7005933
You need either a Custom ROM or a customized kernel with that feature.
Or try this method (was also mentioned in the miui.com link):
https://www.handheldgroup.com/support-rugged-computers/knowledgebase-KB/23443/
Newest edit: Ok, I just tried the previous command but on my Nexus5 or a Lenovo Tab, the commands were not found :/
The right command would be for enable AUTO BOOT (you have to boot into fastboot/bootloader):
fastboot oem off-mode-charge enable
But then again, it didnt work :/
The problem is, that at least my devices do not understand enable or disable.. You have to use 1 and 0 and it seems this was made by old c/c++ developers, because 0 = enabled and 1 = disabled.
Disabled is the default value which means = NO auto boot.
So that command did it for me:
fastboot oem off-mode-charge 0
To see the value try this:
fastboot getvar off-mode-charge
This should be set to 0 = enabled.

can somebody confirm if this work and system start when usb is connected ?

Related

Auto boot Acer Liquid E700 when device plugged in

Hi there,
I'd like to know if someone knows the trick to make my Acer Liquid E700 boot up when it's initially powered down and I connect a Micro USB cable in it.
Currently it's showing the Charging mode and waits that I boot up the device manually using the button.
I read lots of forums speaking about different solutions
- the /system/bin/ipod file (or lpm or playlpm...) to rewrite usind sh script and calling /system/bin/reboot for example -> didn't work on this phone in my case
- using fastboot commands like fastboot oem unlock (which is working) and then fastboot oem off-mode-charge 0 -> which didn't work also in my case.
Please if somebody knows this device and can help, I'd be very grateful!!
Cheers
Bruno

Blutooth problem

I have a problem connecting to Blutooth. I bought a car 2DIN radio for android. My phone turns on blutooth and connects to a call without a phone call. My radio with other smartphones connects seamlessly, has a problem with my phone only. My phone connects properly with the handsfree, with the speaker and other devices, just does not want to connect with my radio. I had an original Image, now I changed to MUI, but it is the same.
Is it really so difficult to repair if no one else has encountered such a problem?
Help
I'm fighting for 3 days and I do not know where I'm making a mistake. I was looking for a solution for bluetooth connection with 2DIN radio. I found the image in EUI 5.8 15S still works well. I had TWRP installed so there was no problem, I found the image I installed. Unfortunately bluetooth does not work. I wanted to install MIUI so I downloaded the image and here my problem starts. I am in TWRP unfortunately I can not access the phone memory. I will start everything from scratch. I will do everything as described:
I have ADB installed on my PC
on the phone I enter the system developer set
in the directory where I have downloaded twrp with shift PPM and the command window opens
adb devices command - correct answer
adb reboot command bootloader - telefin into bootloader mode
fastboot oem unlock command - correct answer
fastboot flash twrp twrp.img - install twrp
button + volume and power - twrp mode
in the twrp install button - and again the same I can not access the memory.
If I choose the memory, I have 0 mg memory and OTG memory
What I do is not where the error is.
wojt_wc said:
Help
I'm fighting for 3 days and I do not know where I'm making a mistake. I was looking for a solution for bluetooth connection with 2DIN radio. I found the image in EUI 5.8 15S still works well. I had TWRP installed so there was no problem, I found the image I installed. Unfortunately bluetooth does not work. I wanted to install MIUI so I downloaded the image and here my problem starts. I am in TWRP unfortunately I can not access the phone memory. I will start everything from scratch. I will do everything as described:
I have ADB installed on my PC
on the phone I enter the system developer set
in the directory where I have downloaded twrp with shift PPM and the command window opens
adb devices command - correct answer
adb reboot command bootloader - telefin into bootloader mode
fastboot oem unlock command - correct answer
fastboot flash twrp twrp.img - install twrp
button + volume and power - twrp mode
in the twrp install button - and again the same I can not access the memory.
If I choose the memory, I have 0 mg memory and OTG memory
What I do is not where the error is.
Click to expand...
Click to collapse
When you start it, is TWRP asking for a password? If it does, that means your phone is encrypted, which, for example, is the default for Indian firmwares. It's a bug, but not the end of the world. You have to hit cancel at the password prompt and restart recovery. It will eventually start without asking for a password and then you'll have access to the internal memory. Once, I had to restart TWRP about 10 times until this worked, so you have to be patient.
Thanks a lot. Actually I had to start again and it was OK. But now I have a bigger problem. I downloaded the picture MIUI 9. The installation ran smoothly. MIUI 9 has been installed but I can not take over the configuration. Even though the SIM card is inserted it does not see it. Can not find no IMEI. Can not set up MI Acccount. The phone is hot all the time and it's still on Mi Account. Can you stop it? Can I upload another image?
Yesterday at a late hour I managed to run everything on a regular basis on SmailSUI. I reinstalled the memory cleaner and it works fine. All the time I'm waiting for MIUI 9. As you work on this image you can check if BT is working properly. At me mixed with different images from this began. So far I have not found a system that works properly BT. When connected to another Android BT connects without a phone. You can not receive or call BT.
Thanks again for your help.

Question How to enter into BROM mode?

I tried all 3 combo with the volume and power key to no avail. Any help will be appreciated!
ken.yong said:
I tried all 3 combo with the volume and power key to no avail. Any help will be appreciated!
Click to expand...
Click to collapse
I believe its v+/pwr when logo appears release both then press an hold v+ an hold it....chk YouTube if im wrong
Leofire_72 said:
I believe its v+/pwr when logo appears release both then press an hold v+ an hold it....chk YouTube if im wrong
Click to expand...
Click to collapse
Nope, doesn't work. Which Youtube link please?
Vol down + Power when connected to a charger/USB. You can get into fast boot by immediately hitting Vol up + Power after you see the clearly drunk/passed out green Android
I want the same answer but everyone here is a ****. No one knows how to enter brom mode in any android especially like oppo.
I hate those "press these three buttons while standing on your head" instructions.
It's probably my fault that I'm untalented.
The bottom line, any device will go to boot ROM if it can't make any sense of anything.
Irrespective of model, if you can defeat/confuse/muddle access to the flash memory it will go to boot ROM.
Ok, there may be simpler device-specific methods.
Rule #1: Don't short arbitrary things that you don't know what they are.
Rule #2: A 100 ohm resistor is logically as good as a short without risking anything melting down.
Rule #3 Try grounding test points near the flash memory through a 100 ohm resistor to ground.
Rule #4 Don't blame me for anything.
Renate said:
I hate those "press these three buttons while standing on your head" instructions.
It's probably my fault that I'm untalented.
The bottom line, any device will go to boot ROM if it can't make any sense of anything.
Irrespective of model, if you can defeat/confuse/muddle access to the flash memory it will go to boot ROM.
Ok, there may be simpler device-specific methods.
Rule #1: Don't short arbitrary things that you don't know what they are.
Rule #2: A 100 ohm resistor is logically as good as a short without risking anything melting down.
Rule #3 Try grounding test points near the flash memory through a 100 ohm resistor to ground.
Rule #4 Don't blame me for anything.
Click to expand...
Click to collapse
But I don't want to open my oppos back . Any other solution??
ken.yong said:
I tried all 3 combo with the volume and power key to no avail. Any help will be appreciated!
Click to expand...
Click to collapse
For what purpose you need to enter brom mode ?
You might be able to get there from ADB: adb reboot edl
You might be able to get there from fastboot: fastboot reboot edl, fastboot reboot-edl, fastboot oem edl...
You might be able to use an EDL USB cable (although I've never had any success).
You can short the proper EDL test points.
You can disable the flash by disabling a signal to it using a load resistor.
You can erase the SBL/XBL. If you do this and the EDL loader doesn't work you are seriously bricked.
Me, I use the proper EDL test points. I also hate opening devices. So I put in a magnetic reed switch so I don't ever have to again.
(The white connector is the root console, which goes out a hole in the back of the case.)
MohanTheMass said:
For what purpose you need to enter brom mode ?
Click to expand...
Click to collapse
Would like to root it. No customized roms though
ken.yong said:
Would like to root it. No customized roms though
Click to expand...
Click to collapse
Okay
ken.yong said:
I tried all 3 combo with the volume and power key to no avail. Any help will be appreciated!
Click to expand...
Click to collapse
I've only ever been able to enter BROM using Mtk client. Easiest in Linux but you have to go through the process of setting it up but once you do, you can pull the main partitions as well as unlock the bootloader (once oem is toggled). I could enter fastboot on my BLU View Mega but i could toggle OEM unlock and, using Mtk client, unlock the bootloader. Now to the steps:
(Assuming you've set it up)
1. Power off device and remove usb
2. Start Mtk client
3. Plug in usb while holding VOL - & VOL +
The client will automatically recognize the device, thus allowing you to pull, flash, unlock bootloader etc.
I've used this method to pull the boot from multiple mtk devices to repack inside twrp. The files pull as BIN but i just convert them to IMG. Well worth the setup for what it can do
KMerrimanJr said:
I've only ever been able to enter BROM using Mtk client. Easiest in Linux but you have to go through the process of setting it up but once you do, you can pull the main partitions as well as unlock the bootloader (once oem is toggled). I could enter fastboot on my BLU View Mega but i could toggle OEM unlock and, using Mtk client, unlock the bootloader. Now to the steps:
(Assuming you've set it up)
1. Power off device and remove usb
2. Start Mtk client
3. Plug in usb while holding VOL - & VOL +
The client will automatically recognize the device, thus allowing you to pull, flash, unlock bootloader etc.
I've used this method to pull the boot from multiple mtk devices to repack inside twrp. The files pull as BIN but i just convert them to IMG. Well worth the setup for what it can do
Click to expand...
Click to collapse
EDIT: I meant to say I could NOT enter fastboot on my BLU device, so I had to use the client to unlock the bootloader
MohanTheMass said:
For what purpose you need to enter brom mode ?
Click to expand...
Click to collapse
100% success pulling boot from multiple mtk devices (stock/unrooted) using Mtk Client to enter BROM. Also able to unlock bootloader and flash on devices that allow OEM unlock toggle but can't fastboot.
mtk client hardly gets a successful handshake on my device.
.....Preloader
Preloader - [LIB]: ←[31mStatus: Handshake failed, retrying...←[0m
Port - Hint:
Power off the phone before connecting.
For brom mode, press and hold vol up, vol dwn, or all hw buttons and connect usb.
For preloader mode, don't press any hw button and connect usb.
If it is already connected and on, hold power for 10 seconds to reset.
.....Preloader
Preloader - [LIB]: ←[31mStatus: Handshake failed, retrying...←[0m
I want to use the below cmmand to force brom mode.
python mtk crash
But I need more light on arguments [--vid=vid] [--pid=pid] [--interface=interface]
before proceeding.
I also need asap more light on the risks involved in executing the command above.
@patrick7777777 did u ever figure it out? Im guessing ur on a tv as well like me im on a hisense 43a6h android 11 google tv and have some issues. I don't have oem unlock option on my google tv but id love to unlock the bootloader and root it and backup the stock rom. I can get it to reboot to fastbootd mode is what it says but it also says fastboot mode. Thats if i use a usb male to male in the usb port closest to the screen it has 2 usb 2.0 ports and if i type adb connect Android.local it connects if i have the adb drivers install but idk about the fastboot drivers and if I type adb reboot bootloader the tv turns off and wont turn back on via the remote or button on tv must reset the power to get it to turn back on idk if i can interface with it in bootloader mode but im sure i can in fast boot mode its just that the command adb reboot fastboot works in all but fastboot devices doesn't report any devices. Thanks
It's a Mediatek MT9612 chip inside.
Installed all requirements to run that python script?

Question How to reboot to Qualcomm EDL mode without ADB?

The TL;DR is, I bricked my phone (TMo Nord N200 5G, SIM unlocked, Bootloader unlocked). I'm trying to use the MSM to recover it. I can't boot to EDL (hold down volume up and volume down at the same time, while pressing power or plugging a USB cable into my PC). It just boots to Fastboot when I follow that procedure. I can't get to a place where I can use ADB commands (ADB shows device "unauthorized").
Longer version, my stock phone was upgraded to the June patch level, I think.
I did the SIM unlock, unlocked the bootloader, and installed the drivers.
I successfully flashed the latest PHH squeak FOSS by following this guide but it had some quirks that I wasn't completely satisfied with.
I flashed a SparkOS GSI linked from somewhere else, but it constantly beeped at me after I disabled Google Play Services, so I decided to move on.
I think the next OS I tried was CRdroid from the same place, but I also replaced the boot.img with a stock one that was patched for Magisk. I can't remember why I thought this was a good idea. There was also a thread that said Magisk doesn't like having nothing in system_a so flash this blank partition using these commands. It always errored out, but I tried it before rebooting.
At this point, my phone would either boot to Qualcomm CrashDump on its own, or Fastboot if I held volume down.
Using the latest Fastboot Enhance I was able to get into fastbootd by switching to "A" active, then rebooting to fastbootd. Have to remember to switch back to "B" active to get anything else to work.
I've tried flashing a few different things since I can get to fastbootd now. I'm no longer booting into the Qualcomm CrashDump, it reliably boots to fastboot as long as I'm "B" active. I just can't get anything resembling a working OS.
I've tried flashing the OTA TMo with Fastboot Enhance a few different times, and a few different GSIs through fastboot, and I really want to get back to stock now so I can start all over.
I've also tried a couple different MSM tool versions, but since my phone is never in EDL, it's never recognized.
Thank you for any assistance.
Holding the Vol +/- & power WILL force boot the N200 to EDL mode regardless of the software corruption as this is at the hardware level.
The thing you need to be concerned with is that you have the latest Qualcomm ADB tools installed so msmtool will recognise the phone while in this mode.
Install the latest adb driver and go into that folder when typing the command as you might have older adb installed already at another location (and in the system path) that is running instead.
Android MTK - How-to Guide and Root Tutorials
Android MTK is one of the best websites that provides the latest Root Tutorial, USB driver, Android Tool, Stock Firmware and How-to Guide.
androidmtk.com
Then you need to have msmtool running and ready to begin and the mouse button hovering over the start button. As soon as the first logo screen comes up, it will only go into EDL mode for about 3-4 seconds and then move on to booting and dump you into fastboot if the rom is corrupt/missing. You need to watch msmtool on the first line and the second it shows up, click start and it will flash.
If you are still missing it and in fastboot I think the the N200 supports the force phone to edl mode by fastboot command:
fastboot oem edl
scanman0 said:
Holding the Vol +/- & power WILL force boot the N200 to EDL mode regardless of the software corruption as this is at the hardware level.
The thing you need to be concerned with is that you have the latest Qualcomm ADB tools installed so msmtool will recognise the phone while in this mode.
Install the latest adb driver and go into that folder when typing the command as you might have older adb installed already at another location (and in the system path) that is running instead.
Android MTK - How-to Guide and Root Tutorials
Android MTK is one of the best websites that provides the latest Root Tutorial, USB driver, Android Tool, Stock Firmware and How-to Guide.
androidmtk.com
Then you need to have msmtool running and ready to begin and the mouse button hovering over the start button. As soon as the first logo screen comes up, it will only go into EDL mode for about 3-4 seconds and then move on to booting and dump you into fastboot if the rom is corrupt/missing. You need to watch msmtool on the first line and the second it shows up, click start and it will flash.
If you are still missing it and in fastboot I think the the N200 supports the force phone to edl mode by fastboot command:
fastboot oem edl
Click to expand...
Click to collapse
Thank you for responding!
The command fastboot oem edl is returning either:
FAILED (remote: 'Command not supported in default implementation')
FAILED (remote: 'unknown command')
I'm running fastboot version 33.0.2-8557947, it's not in my system path.
From a full power off, holding the buttons and plugging in the USB cable, it's about 5 seconds until I see the OnePlus logo, then 2 more seconds before I drop into Fastboot. I'm not sure what I'm looking for, to confirm EDL mode. I'm not seeing my Device Manager update in that time, and the MSM tool isn't displaying anything, either.
try insert cable then volume + and - and power. keep it holding for 10-15 seconds or till you see qualcomm device in device manager
qualcomm drivers
Qualcomm_Drivers_Setup.exe
drive.google.com
try holding both volume buttons (make sure its off!) then plugging your phone in to the computer with msm tool open (you can pre-press the start button) (make sure you have all the drivers installed)
How can I verify that I have all of the required Qualcomm drivers installed?
I've run pretty much every driver install in this thread, or that I could find by searching, and it still seems like my laptop isn't recognizing the phone.
yrrebeulB said:
How can I verify that I have all of the required Qualcomm drivers installed?
I've run pretty much every driver install in this thread, or that I could find by searching, and it still seems like my laptop isn't recognizing the phone.
Click to expand...
Click to collapse
Open up Device Manager in windows. and then attempt to connect it to the computer while in EDL mode. In EDL mode it will still look like it's off btw, that confused me a lot.
You're looking for a device to show up in Device Manager when you connect it. If you're in EDL mode and have the driver's installed correctly it'll say qualcomm-something-something. If you see unknown device, you don't have the drivers installed. If no new device is detected either you're not in EDL mode or you should try a different cable.
Same issue as OP, won't boot into edl
edit: use USB 2.0
You can try enumusb.exe here: http://www.temblast.com/windows.htm
Code:
C:\>enumusb.exe /l /v05c6 /p9008
It will list the first time that a QUSB_BULK was plugged into a port, even if there was no driver found/loaded.
If you want, you can clear past connections by (needs to be admin command line):
This does no harm. I clear everything out occasionally, it just means that next boot will take 5 seconds longer while it discovers "new" devices and installs the same drivers.
Code:
C:\>enumusb.exe /d /v05c6 /p9008
Or, if you don't like that, just plug your device into a different port and see if another port is listed in enumusb.exe /l
On that same page you can find usblog.exe
You just run it and it will show you what pops up and down.
But, this only shows devices that Windows has loaded drivers for.
swee08315 said:
Open up Device Manager in windows. and then attempt to connect it to the computer while in EDL mode. In EDL mode it will still look like it's off btw, that confused me a lot.
You're looking for a device to show up in Device Manager when you connect it. If you're in EDL mode and have the driver's installed correctly it'll say qualcomm-something-something. If you see unknown device, you don't have the drivers installed. If no new device is detected either you're not in EDL mode or you should try a different cable.
Click to expand...
Click to collapse
THANK YOU!
I didn't know there was a mode where it was powered on and the screen stayed off.
I finally got there by this path: Fastboot -> Recovery (I think?) -> List of languages, I chose English -> Power off -> Yes, really -> Hold down VOL+ and VOL- until I noticed the Qualcomm device in Device Manager
So I'm in EDL mode now! But my MSM tool crashes immediately on launch. So new problem, at least.
yrrebeulB said:
THANK YOU!
I didn't know there was a mode where it was powered on and the screen stayed off.
I finally got there by this path: Fastboot -> Recovery (I think?) -> List of languages, I chose English -> Power off -> Yes, really -> Hold down VOL+ and VOL- until I noticed the Qualcomm device in Device Manager
So I'm in EDL mode now! But my MSM tool crashes immediately on launch. So new problem, at least.
Click to expand...
Click to collapse
I re-installed the Qualcomm driver bundle while my phone was plugged in and in EDL mode, and MSM finally worked! Thank you kind stranger! I'm back to factory now.
Thank you Strangers ,
yrrebeulB , all of you​
Ytube21 said:
qualcomm drivers
Qualcomm_Drivers_Setup.exe
drive.google.com
Click to expand...
Click to collapse
thank you
yrrebeulB said:
THANK YOU!
I didn't know there was a mode where it was powered on and the screen stayed off.
I finally got there by this path: Fastboot -> Recovery (I think?) -> List of languages, I chose English -> Power off -> Yes, really -> Hold down VOL+ and VOL- until I noticed the Qualcomm device in Device Manager
So I'm in EDL mode now! But my MSM tool crashes immediately on launch. So new problem, at least.
Click to expand...
Click to collapse
this line literally saved me hours
yrrebeulB said:
So I'm in EDL mode now! But my MSM tool crashes immediately on launch. So new problem, at least.
Click to expand...
Click to collapse
Try my native Windows EDL client. It uses the same Firehose loader as your stock tool does.
At the very least this will give you a second opinion.
http://www.temblast.com/edl.htm

ADB unauthorized on Xiaomi MI 9T Pro with black screen

Hi to everybody,
my MI 9T Pro has black/broken screen so I need to access it and/or replicate the screen by using the ADB facility.
It has the USB Debug enabled, but I cannot authorize the access from my laptop due to the black screen and broken touch, there is any possibility to bypass the authorization process?
I have already tried to connect a mini-docking station in order to replicate the screen via the USB-C to HDMI feature, but nothing appears on the external display.
Any suggestion?
Many thanks
Roberto
P.S.: the phone works, it receives call, it is connected to the wifi network and, if it is connected via USB to the laptop, the "adb devices" command returns its serial number followed by a sad unauthorized status...
Tamagnun said:
Any suggestion?
Click to expand...
Click to collapse
Hello and good afternoon, Roberto.
Welcome to XDA! I hope you'll always get the support you require.
However, prior to your next posting please read the guidances that are stuck on top of every forum like
Note: Questions go in Q&A Forum
If you are posting a Question Thread post it in the Q&A forum. Technical discussion of Android development and hacking. No noobs, please. Device-specific releases should go under the appropriate device forum...
forum.xda-developers.com
and the others. I've moved your thread to Android Q&A.
Thanks for your cooperation!
Regards
Oswald Boelcke
Senior Moderator
Thank you Oswald, sorry for my wrong posting, I chose that thread because it was referred to ADB.
Kind Regards
Roberto
Don't know if it'll help, but the unauthorized message means a mismatch between pc and phone.
You can do this:
Go to C:/Users/<your username>/.android and delete a file called "adb key"
It's a hidden folder so activate that in folder options.
However, this will only trigger a new authorization message on the phone again.
The Android usb debugging notification gives you the option to switch the connection to be controlled from the phone to the PC side but it won't help if you can't see it.
IamTheBRAVE said:
Go to C:/Users/<your username>/.android and delete a file called "adb key"
Click to expand...
Click to collapse
Thank you very much for the useful tip!!
In this folder I found two files with the same timestamp:
- adbkey (without extension)
- adbkey.pub
Do you think it's better to delete both, isn't it?
Any idea to connect to the smartphone the USB-C data cable AND an external keyboard at the same time, using an OTG adaptor?
I need to use the data cable for ABD because I'm afraid I didn't activate the wireless debug option on the phone AND the keyboard in order to try to grant the authorization when the popup "appears" (ehm... it cannot, but if it should be possible it woold appear!! )
Anyway, many many thanks for this first step!!
Tamagnun said:
Thank you very much for the useful tip, in that directory I found two files,with the same timestamp:
- adbkey (without extension)
- adbkey.pub
Do you think it's better to delete both, isn't it?
Click to expand...
Click to collapse
Both is ok.
Any idea to connect to the smartphone the USB-C data cable AND an external keyboard, via OTG adaptor?
I need to use the data cable for ABD because on the phone I'm afraid I didn't activate the wireless debug option AND the keyboard in order to try to grant the authorization when the popup "appears" (ehm... it cannot, but if possible it wuold appear!! )
Click to expand...
Click to collapse
I don't know, maybe a wireless keyboard ? Or an usb hub like this:
https://www.amazon.com/TargetGo-Splitter-Extender-Ultra-Slim-Microphone/dp/B0957JKBHZ
So you can plug both the keyboard and the phone cable. Not sure if it would work...
Good luck
Hi Iam,
I'm performing some tests with an old phone (Note 4) in order to check your suggestion: unfortunately it's not possible to connect a keyboard (using an OTG cable, the phone is the "host" and devices are "clients") and to use ADBat the same time, because the standard data cable sets the phone like "client" and the PC like "host".
In fact in the OTG cable the pin 4 in the micro-USB connector is closed to GND, in standard data/charge cable the PIN 4 is not connected.
The idea to use a wireless keyboard is good, but with the black screen I cannot control BT connection or other.
In addition, I verified that the grant popup appears only if the phone is unlocked and also this is very hard with the black (and dead) screen.
I read in another thread (that I'm not able to find now...) that by copying the adbkey file from the PC .android folder to an internal android directory on th phone (something similiar to /data/adb/keys, but I don't remember well...) the smartphone authorizes the PC to connect via adb, do you now if this method could be a way to bypass the manual grant operation ?
Do you know a method to copy a file from PC to the phone by starting it in recovery mode?
Fastboot can help in this operation?
Thank you
Transferring files can only be done with adb push command.
I am not aware of a directory in the phone with the adbkey in it. So can't help you there...
Edit: found this
Storage location of "adb_keys"
I have a Galaxy s3 (I9300) that has a broken touch screen (display is fine). I therefore can not click the authorization dialog that pops up when I try to access the device via adb on any ROMs above
android.stackexchange.com
Hope it helps a little.
Hi Iam, thank you for your help!
On GitHub I found the cmd to copy RSA key from the PC to the smartphone, it is:
adb push %userprofile%/.android/adbkey.pub /data/misc/adb/adb_keys
but the author wrote that it works only with rooted phones... and my broken one is not!!
Anyway I'll try and I'll write here the result of the test in order to share my experience.
Nothing to do, it doesn't work...
The phone is switched on because if I connect it to the data cable on the PC I get this result:
C:\Users\rober>adb devices
List of devices attached
598261c1 unauthorized
and it is in RECOVERY MODE because I cannot find its IP address on the wifi router, but I cannot push the adbkey file:
C:\Users\rober>adb push C:\Users\rober\.android\adbkey.pub /data/misc/adb/adb_keys
adb: error: failed to get feature set: device unauthorized.
This adb server's $ADB_VENDOR_KEYS is not set
Try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.
I don't have any idea to bypass the unauthorized state, due the host/client state it isn't possible to connect an external keyboard and the data cable at the same time, wireless keyboard cannot be paired without accessing the display so I dont' know how to proceed... sigh...
If someone has a suggestion I'll really appreciate it!
Found this. Can you try it?
Android - Enable ADB from recovery
Android - Enable ADB from recovery. GitHub Gist: instantly share code, notes, and snippets.
gist.github.com
What do you have for a screen lock? Swipe? Pattern? Numbers?
You need to tap and swipe the screen to get things done.
A plugged in mouse could do that if you only knew what you were doing.
If you have a digitizer (Wacom tablet) you can use that to do anything the screen can do.
Also, are you quite sure that the screen isn't responsive? It could be black but responsive.
I did a project to swipe patterns using a separate, rooted Android.
It works like a charm, but it's kind of a pain to set up.
See: https://forum.xda-developers.com/t/accessing-my-phone-with-a-dead-screen.4542763/post-88013171
Hmm, it's actually more complicated.
I plug in a device and the authorization popup appears.
But, if I pull the plug, the popup disappears after a second.
You won't be able to get a USB digitizer working.
You'd need a Bluetooth digitizer, but that would have to be enabled too.
So you'd need the USB digitizer to enable the BT digitizer.
(By "digitizer" I mean any absolute pointing device.)
If there is an internal UART (hardware console) you might be able to simply type in the adb_keys.
this script claims to by-pass the adb authorization by patching stock boot.img and resign with google test keys. it might work on locked bootloader (untested)
https://github.com/bkerler/android_universal
I don't know how it works, but you can hopefully write/flash partitions in EDL mode with this loader (untested)
https://forum.xda-developers.com/t/...r-qualcomm-based-phones.4368989/post-88041131
there is also a linux executeable to reboot into EDL mode from fastboot
https://github.com/bkerler/edl
Code:
$ fastboot devices
$ ./fastpwn oem edl
to install the loader
Code:
$ python3 edlclient/Tools/fhloaderparse path/to/FHLoaderDir Loaders
if you don't have linux you can try the re_livedvdV4.iso from pendrive.
there is also executeable for windows to reboot EDL and another EDL tool for windows (credits: @Renate)
the downside of this, once you rebooted phone you cannot get back to its currently (AFU) unlocked state, which means all your files are no longer decrypted (BFU). you can install apps remotely only as long as the phone is decrypted and online, so maybe there is a better way (vysor?)
alecxs said:
there is also a linux executeable to reboot into EDL mode from fastboot
Click to expand...
Click to collapse
I see that the "fastpwn" is 12 MB. Seems a bit large. No idea what's in there.
Some abl's may support fastboot commands for getting to EDL.
I've never seen it clearly listed which do have that.
The standard fastboot filters all commands except for "oem".
Code:
fastboot tickle me elmo // will not even be sent because "tickle" is not on the command list
fastboot oem ridiculous command // will be sent since oem commands get a free pass
So if your device uses an oem command to get to edl it will work with the stock fastboot.
If it uses a special "first tier" command you will have to use a modified, lenient fastboot.
IamTheBRAVE said:
Found this. Can you try it?
Android - Enable ADB from recovery
Android - Enable ADB from recovery. GitHub Gist: instantly share code, notes, and snippets.
gist.github.com
Click to expand...
Click to collapse
Hi Iam, I found a similar page on GitHub and I tried to input the adb pull command (see my previous msg), but because the PC is not authorized there is no way to write anything on the phone by using abd.
Many thank for your tentative to help me.
Renate said:
What do you have for a screen lock? Swipe? Pattern? Numbers?
You need to tap and swipe the screen to get things done.
A plugged in mouse could do that if you only knew what you were doing.
If you have a digitizer (Wacom tablet) you can use that to do anything the screen can do.
Also, are you quite sure that the screen isn't responsive? It could be black but responsive.
I did a project to swipe patterns using a separate, rooted Android.
It works like a charm, but it's kind of a pain to set up.
See: https://forum.xda-developers.com/t/accessing-my-phone-with-a-dead-screen.4542763/post-88013171
Hmm, it's actually more complicated.
I plug in a device and the authorization popup appears.
But, if I pull the plug, the popup disappears after a second.
You won't be able to get a USB digitizer working.
You'd need a Bluetooth digitizer, but that would have to be enabled too.
So you'd need the USB digitizer to enable the BT digitizer.
(By "digitizer" I mean any absolute pointing device.)
Click to expand...
Click to collapse
Hi Renate,
it is not possible to connect at the same time a USB keyboard (phone is the server by using an OTG cable) and a data cable (phone is the client in this situation) and as you have verified, when the data cable is disconnected, the grant message disappears...
I have a BT keyboard, but it is not possible to pair it to the smartphone working on a black screen, even if it was responsive.
Finally, I thing there isn't a way to bypass the grant message and authorize the phone "regularly", I think.
Renate said:
If there is an internal UART (hardware console) you might be able to simply type in the adb_keys.
Click to expand...
Click to collapse
Where the UART should be present? Inside the phone? Uhhmmmm.... Even if I found it your idea would be to wire it by soldering directly on the mainboard? Too much difficult for my poor experience, sorry!
Many thanks for your answer.
Before to start with replies, dear Alexc and Renate please let's apologize me because I'm absolutely newbie about these new devices, in order to clarify to you my (un)knowledge condition, let's consider that my last fw update was performed using the Odin tool on very old Samsung devices!
Thanks to your suggestions, now I know what is the fastboot and EDL (I read something on XDA and other sites), but I haven't understood if it is possible to read the userdata from one of these two boot states... anyway, I try to reply you, if you would want to continue to help me I'll be very grateful for this!
alecxs said:
this script claims to by-pass the adb authorization by patching stock boot.img and resign with google test keys. it might work on locked bootloader (untested)
https://github.com/bkerler/android_universal
Click to expand...
Click to collapse
It is written that it is tested only up to Android 10, so I prefer to avoid to test this method on a smartphone that hasm't a working screen, it isn't possible to understand what happens on it.
https://github.com/bkerler/android_universal
alecxs said:
I don't know how it works, but you can hopefully write/flash partitions in EDL mode with this loader (untested)
https://forum.xda-developers.com/t/...r-qualcomm-based-phones.4368989/post-88041131
Click to expand...
Click to collapse
I downloaded the firehose file for the chipset 855 but I'm not interested to flash a new firmware or similar...
alecxs said:
there is also a linux executeable to reboot into EDL mode from fastboot
https://github.com/bkerler/edl
Code:
$ fastboot devices
$ ./fastpwn oem edl
Click to expand...
Click to collapse
OK, the previous is clear for me: now the smartphone is booted in fastboot mode and the utility can access it:
Code:
C:\Users\rober>fastboot --version
fastboot version 34.0.0-9570255
Installed as C:\Android-Recovery\platform-tools\fastboot.exe
C:\Users\rober>fastboot devices
598261c1 fastboot
Is the fastboot utility version the right one to operate on my smartphone?
Please let's explain me: if I'll reboot the phone to EDL (using fastpwn utility, fastboot oem command or another utility or method) I risk to lose my userdata ?
alecxs said:
to install the loader
Code:
$ python3 edlclient/Tools/fhloaderparse path/to/FHLoaderDir Loaders
Click to expand...
Click to collapse
Sorry for the stupid question, but why I have to install a loader on the phone?
alecxs said:
if you don't have linux you can try the re_livedvdV4.iso from pendrive.
Click to expand...
Click to collapse
My Surface has Win10 and Ubuntu (I never use it but I have prepared a dual boot for any needs...).
alecxs said:
there is also executeable for windows to reboot EDL and another EDL tool for windows (credits: @Renate)
Click to expand...
Click to collapse
I would prefer to use Windows utilities, but it is not mandatory...
Before to try to switch to EDL I need to understand if this operation will destroy my data or not, and what I can do from this EDL boot mode, I know it is posisble to flash the phone from scratch, but is it possible to read data by mounting phone partitions or similar?
For example, I listed the fastboot options and I found the possibility to FETCH a partition from the phone and copy it to the PC, this can help to access my data?
Maybe they are encrypted?
Do you have a schema or a list of all available partitions inside a MIUI 13 device? (I need to learn something before to proceed...)
alecxs said:
the downside of this, once you rebooted phone you cannot get back to its currently (AFU) unlocked state, which means all your files are no longer decrypted (BFU). you can install apps remotely only as long as the phone is decrypted and online, so maybe there is a better way (vysor?)
Click to expand...
Click to collapse
So, the previous message is the reason I'm very carefull before to switch to EDL boot mode: is it enough to switch the phone to EDL in order to lock all data because they'll become definitively encrypted ??
Please let's try to clarify me your suggestions and how to proceed...
Many many thanks for your patience
Update: with the cmd fastboot getvar all I obtained the entire partions list, I tried to fetch one of this and the result is:
Code:
C:\Users\rober>fastboot fetch limits cache.ext4
fastboot: error: Unable to get max-fetch-size. Device does not support fetch command.
Not good, but at least I have answered to a couple of questions by myself... sigh...
@alexc: two years and seven months ago you helped someone to retrieve userdata from a bricked MI 4C by suggesting the followiing process, can i do something similar on my MI 9T PRO?
1 Obtain a programmer
To successfully acquire all of the data from EDL you need programmer.
For Mi 4c it is prog_emmc_firehose_8992_ddr.mbn that can be obtained in (first?) official image of OS. I got it from file Xiaomi_Mi_4C_V8.1.3.0.LXKCNDI_20161213_China_5.1_XFT.zip on some random site. You can find it in the archive under folder Firmware/images/.
The full path in archive would be Firmware/images/prog_emmc_firehose_8992_ddr.mbn.
2 Get working Firehorse​I have got mine from repository: https://github.com/bkerler/edl.
Proceed with all instructions mentioned in the repository. (I personally used Ubuntu 20.04 as all of the stuff is easier to make work.)
3 Connect to EDL​Boot phone to fastboot. In case of Mi 4c that is my case it is pushing volume down during boot.
When you enter fastboot and you can see your device with fastboot:
fastboot devices
In case of Mi 4c you can directly boot to EDL with command:
fastboot oem edl
4 Acquire data through EDL​When device enters EDL state you can test connection with programmer (in my case prog_emmc_firehose_8992_ddr.mbn). In loader parameter you are entering path to this file.
./edl.py --loader=prog_emmc_firehose_8992_ddr.mbn printgpt
When it outputs all of the partition then you are golden!
On my phone there is one partition named userdata:
userdata: Offset 0x00000000c4000000, Length 0x0000000683bfbe00, Flags 0x00000000, UUID 07c2b899-1574-564c-2f46-e26a6378bdd8, Type 0x1b81e7e6
To acquire the partition use command:
./edl.py --loader=examples/prog_emmc_firehose_8992_ddr.mbn r userdata userdata.bin
The copy of user data just needs to be read.
5 Reading user data (userdata.bin)​Luckily for the phone Mi 4c you can directly mount the dump in Linux. For some other phones the process might not be so straightforward and you might need simg2img. But I am not 100% sure.
sudo mkdir /media/userdata
sudo mount -t ext4 -o loop userdata.bin /media/userdata/
To read the data you will need to get root rights as the data belong to non-existing or different existing users and you won't get access with your user.
sudo mkdir userdata
sudo cp -r /media/userdata/media/0/* userdata/
The path to the your data might be different so take your time to look around.
Done! All the data are now completely accessible.
Click to expand...
Click to collapse
What is the "programmer"?
As I wrote before, I downloaded the file prog_ufs_firehose_sdm855_ddr.elf but it is the firehose, not the programmer, isn't it ?
Many thanks, I spent all the night to try to acquire some knowledge, but I have too many dubts again...
When your Android boots it goes PBL (in ROM) -> xbl -> abl -> Android.
A Firehose loader is a custom replacement for xbl that it can load live.
Instead of loading all the rest of the stuff it just sits on USB and awaits commands.
Firehose, programmer, loader, .bin, .elf, .mbn can all be the same things.
Using EDL will not hurt your system or data (unlike fastboot unlock).
If you read back your userdata it will still be encrypted (if it was).
One thing that you can do is read back your entire image.
Then you will in any case be able to restore your device to exactly how it is right now.

Categories

Resources