How to rescue data from my 9T Pro - Redmi K20 Pro / Xiaomi Mi 9T Pro Questions & Answe

So while walking it slipped out from my hand and hit the lower left corner.. The screen didnt even work anymore (after removing the glas, it was clear why, as the connector is lower left corner).
Good thing is, I have adb debugging enabled and my keys are known.. So I can access adb shell and various commands..
My problem is: It rebooted and now, the important stuff is NOT mounted.. Also via scrcpy or MonkeyRemote, I cannot send any touch event... Its not reacting at all.. Honestly, I dont know what it is doing, but its quite busy writing for ever logs in logcat, that the sensors have errors (which is no wonder).
So I tried various "adb shell input XXX", but its not working at all..
Tried to connect a mouse via normal usb-c hub, but I dont know if I would need an OTG cable or if it would even work.
DrFone and some other software, already wants the money, before unlocking anything.. And I would be Ok, if it would be 5-10€.. But buying the whole thing for 1 test, is a big no.
So my status:
adb shell working.
scrcpy at least showing a screen
phone is not reacting on anything else, besides the lockscreen to wake it up.. volume keys are also kinda ignored.
I tried the adb shell input stuff from stackoverflow, but nope.
Can I boot in any recovery thing and mount sdcard there? Does scrcpy work there?
What he heck is my phone even doing?? If I connect another phone in lockscreen and use scrcpy, I can also wake it up normaly.. So probably not only the screen got dmg while flying :/
Most annoying things: It has alarms going off all the time, as I can only snooze them -.-
Is there no command, to unlock it from adb/terminal? I know the damn pin
When I run top, the top most things are sufaceflinger and logd (between 2-15). So its not like sth is always at 100% cpu load..

So little status update:
all adb shell input XXX are simple not working, as Xiaomi needs another setting for that.. Which I cannot activate, without screen.
I will try a manual keyboard at home..
Is there a way, to root it with adb only? Would help me alot..

MIUI security center requires you bonded MI account to enable adb input commands in developer options. scrcpy has OTG mode and can emulate HID device.

scrcpy also didnt work, without that stupid setting set to be true/1.
Tested with my old Mi6. When I enabled the option in dev-settings, it worked fine.
But I was able to unlock it with a keyboard plugged in (+ mouse). Looks like the CPU also has some issues, as everything is slow-motion..
So I just tried, what do I need to press on the Mi6 -> then did it on the Mi9.
"hitting space -> pin -> enter", "hitting space -> pin -> enter".
But was able to rescue all my data + turn off the alarms.
PS.: I then tried to enable this setting, for inputs, but you need to have a SIM cart inserted, to activate it
PPS.: Oh.. Now I got you.. I have to enable this option in scrcpy.. OMG Will test that now
PPPS.: Yeah, with that otg mode, the keyboard and mouse would have also worked.. Well, for the next time I know it

alecxs said:
MIUI security center requires you bonded MI account to enable adb input commands in developer options. scrcpy has OTG mode and can emulate HID device.
Click to expand...
Click to collapse
Ok, thanks - that was missing

If you figure out the command line to enable it from adb settings put global I am very grateful

alecxs said:
If you figure out the command line to enable it from adb settings put global I am very grateful
Click to expand...
Click to collapse
Ok, so I dumped all settings and props to files:
Code:
adb shell settings list global > global.txt
adb shell settings list secure > secure.txt
adb shell settings list system > system.txt
adb shell getprop > props.txt
then searched for adb, usb and similar butfound only the following:
SETTINGS GLOBAL:
adb_enabled=1
adb_wifi_enabled=0
verifier_verify_adb_installs=1
GETPROP:
persist.security.adbinput=1
persist.security.adbinstall=1
(My phone: Mi 11 Lite 5G NE, MIUI 13)
That is, eg ADB can be enabled/disabled as settings global adb_enabled
However, ADB Input is not in settings but as persistent prop persist.security.adbinput and it can be only manipulated by Magisk - and by TWRP but on the old devices where System is not read-only
IMO, it would be theoretically possible on the Mi 9T Pro, but not if display is broken where TWRP cannot be used (I doubt there is anything like scrpy that works for TWRP)

zgfg said:
Ok, so I dumped all settings and props to files:
Code:
adb shell settings list global > global.txt
adb shell settings list secure > secure.txt
adb shell settings list system > system.txt
adb shell getprop > props.txt
then searched for adb, usb and similar butfound only the following:
SETTINGS GLOBAL:
adb_enabled=1
adb_wifi_enabled=0
verifier_verify_adb_installs=1
GETPROP:
persist.security.adbinput=1
persist.security.adbinstall=1
(My phone: Mi 11 Lite 5G NE, MIUI 13)
That is, eg ADB can be enabled/disabled as settings global adb_enabled
However, ADB Input is not in settings but as persistent prop persist.security.adbinput and it can be only manipulated by Magisk - and by TWRP but on the old devices where System is not read-only
IMO, it would be theoretically possible on the Mi 9T Pro, but not if display is broken where TWRP cannot be used (I doubt there is anything like scrpy that works for TWRP)
Click to expand...
Click to collapse
Btw (sorry, OT for the originally reported problem), Netflix cannot be fooled (DRM) to display over scrcpy, only subtitles are displayed on the PC
YT works fine (although without sound - I will try with sndcpy), and strcpy properly recognizes landscape orientation, hence window on the PC can be stretched over the whole monitor
Edit: On the other PC I tried, audio works fine with scrcpy

zgfg said:
However, ADB Input is not in settings but as persistent prop persist.security.adbinput and it can be only manipulated by Magisk - and by TWRP but on the old devices where System is not read-only
Click to expand...
Click to collapse
Nice! I was curious because I don't have Mi account. Although I didn't have this property, just set it from resetprop anyway and it worked!
We can set it from magisk patched boot.img ramdisk/overlay.d/custom.rc systemless. or just add it in init.rc directly.
Code:
on boot
setprop persist.security.adbinput 1

Related

[SOLVED] problem WiFi hotspot

Finally found the solution with my z3c. Problem started with Lollipop. When I was using my phone as portable AP there was no Internet access on any device connected. There were many descriptions of solutions (manual settings, soft reset, deleting all APNs) but none of them worked for me.
My service provider suggested changing APN settings:
Use whatever APN you find working for you, and change "APN type" field from "default,supl" to "default,dun".
Now everything works just like it's supposed to.
Sorry if someone posted this already or if it's under wrong subject. This is my first thread. Thanks.
I use this solution and it works for me:
http://forum.xda-developers.com/z3/general/lollipop-tethering-t3058923
------------------------------------------------------------
This can be fixed permanently using the following procedure (UPDATE: no root required):
Enable developer mode (Go to Settings -> About phone, and click on the build number until the developer mode is enabled).
Enable USB debugging under Settings -> Developer options
Connect the device with a USB cable to a computer with the Android SDK platform tools installed (any modern adb.exe works, the one included with FlashTool, for example)
Start an adb shell: adb shell
In the adb shell, run this command: settings put global tether_dun_required 0
------------------------------------------------------------
BarajaVLC said:
I use this solution and it works for me:
http://forum.xda-developers.com/z3/general/lollipop-tethering-t3058923
------------------------------------------------------------
This can be fixed permanently using the following procedure (UPDATE: no root required):
Enable developer mode (Go to Settings -> About phone, and click on the build number until the developer mode is enabled).
Enable USB debugging under Settings -> Developer options
Connect the device with a USB cable to a computer with the Android SDK platform tools installed (any modern adb.exe works, the one included with FlashTool, for example)
Start an adb shell: adb shell
In the adb shell, run this command: settings put global tether_dun_required 0
------------------------------------------------------------
Click to expand...
Click to collapse
My post is about portable hot spot, not USB tethering. I'm not sure if your post is about the same thing
If yes, then I'm very glad that we have multiple solutions for the same problem
Whoa! My girlfriend had this same problem on a moto g 2014 she bought a year ago, so yesterday I changed her APN type as you said and now everything's working. Thanks a lot.
Sent from my D5833 using Tapatalk
dgaspa75 said:
My post is about portable hot spot, not USB tethering. I'm not sure if your post is about the same thing
If yes, then I'm very glad that we have multiple solutions for the same problem
Click to expand...
Click to collapse
Yes, the solution I provided makes portable WiFi hotspot work
APN Type change to "default,dun" worked like a charm for me.
'settings' is not recognized
i have same problem hotspot is not working i installed android studio 3.0.1 and ran command
settings put global tether_dun_required 0
i get error
C:\Users\log\AndroidStudioProjects\MyApplication>settings put global tether_dun_required 0
'settings' is not recognized as an internal or external command,
operable program or batch file.
any help please
APN Type change to "default,dun" worked like a charm for me...thanks brother
Thanks so much for this! Genius!!

Rescue party

Rescue party is faulty. If triggered it may leave device in usable state.
I think it's better to disable it for users who install mods and other stuff from here.
Magisk module would be useful for that
In my case it reset all settings, even those related to setup wizard.
I had to use adb to put them back. Commands are
adb shell settings put global setup_wizard_has_run 1
adb shell settings put secure user_setup_complete 1
adb shell settings put global device_provisioned 1
Click to expand...
Click to collapse

ADB "settings put" returns "Permission denial"

I just got an X2 Pro, my first Realme phone - coming from OnePlus. Besides the pretty horrible OLED lottery, I'm pretty satisfied so far.
Unfortunately, Realme seem to void their users warranty when rooting (but not for unlocking the bootloader or even loading custom ROMs) - so I'm working my way to a usable phone via ADB.
The biggest issue of modern Android - for me atleast - are the intrusive heads-up notifications.
To disable them, I usually use the "adb shell settings put global heads_up_notifications_enabled 0" command. On all other phones - even a Samsung S10 - this worked perfectly fine.
However, on my X2 Pro, I just get "Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS".
My bootloader is already unlocked, and I of course enabled ADB debugging over USB in the developer options. What am I missing? "adb root" didn't help either.
FIXED IT
"Disable permission monitoring", the last option in the developer options, must be enabled for ADB shell commands to work properly.

Stuck on lockscreen without ability to type in password

Samsung Galaxy S10
Android 10
TWRP
Rooted with Magisk
I just put my phone in ultra power saving mode, but unfortunately i cant unlock the lockscreen because i disabled samsung keyboard and now there is no keyboard where i can type in my password, and since i am in power saving mode it also disabled my other keyboards
So i tried removing the screenlock by deleting the locksetting files in /data/sys/, but since my phone is encrypted i can only see nonsensical filenames, so i dont know which files to delete
Can i safely delete every file there ?
I dont want to factory reset my device because i have a lot of important data on it
I already tried to remove the lock using https://findmymobile.samsung.com/, but it says that that function is disabled on my phone
I have no physical keyboard that i can plugin in into my phone
Remove /Bypass Lockscreen With Recovery
Recently when i restored my data using TWRP i faced a problem at lock screen. I was not able to unlock my phone with the pin i set Earlier..So after so many attempts i was able to find a solution for that problem.(works with pattern,pin etc)...
forum.xda-developers.com
Can i safely delete the other files too ?
Because i dont know which encrypted filenames correlate to the files that i have to delete
EDIT: Thanks, i solved it by connecting a USB Keyboard to my phone using an USB-OTG connector included in the package of my Galaxy S10
If the device supports OTG, you can try connecting a full size PC USB keyboard via OTG.
I went through similar situation when I changed screen render resolution to less than half, then accidentally locked the phone, the keyboard and Screen-Guard were rendered at low resolution, and lock screen was not interactable.
The only way to restore that without prior arrangements was to flash stock Samsung ROM, via PC, with carefully choosing options to not format internal storage and data partitions.
If you have custom recovery, you could enable insecure USB debugging options in build.prop that always allows USB debugging via ADB, then re-install Samsung keyboard, or find some other solution with ADB.
If you have custom/twrp recovery, I'd say connect to PC in recovery mode and copy to PC all important files from /sdcard just in case.
Old Android versions like Android-5 had build.prop files where you could force USB debugging for development uses, that would Allow ADB even the device was locked.
I am not aware if newer Android versions allow that.
Once you get to TWRP, you need to use
Bash:
vi /system/build.prop
Or just
Bash:
echo "text-lines" >> /system/build.prop
To the build.prop file
in command line and enable debugging mode.
The build.prop lines :
Forced USB debugging
Harshiv989 said:
Old Android versions like Android-5 had build.prop files where you could force USB debugging for development uses, that would Allow ADB even the device was locked.
I am not aware if newer Android versions allow that.
Once you get to TWRP, you need to use
Bash:
vi /system/build.prop
Or just
Bash:
echo "text-lines" >> /system/build.prop
To the build.prop file
in command line and enable debugging mode.
Click to expand...
Click to collapse
I cant access /system/ from twrp, it just says that there is not such folder despite it being there, but i think that i have enabled debugging anyways and i already made a backup, which is somehow useless because of the encryption
Harshiv989 said:
If the device supports OTG, you can try connecting a full size PC USB keyboard via OTG.
Click to expand...
Click to collapse
I read in several other threads that in ultra-power-saving mode, android only allows USB devices to charge the phone, and i have no keyboard that i can plug in anyways, i cant buy one because everything is locked down (COVID)
The only way to restore that without prior arrangements was to flash stock Samsung ROM, via PC, with carefully choosing options to not format internal storage and data partitions.
Click to expand...
Click to collapse
As far as i know i cant just flash stock firmware without having to wipe my data
If you have custom recovery, you could enable insecure USB debugging options in build.prop that always allows USB debugging via ADB, then re-install Samsung keyboard, or find some other solution with ADB.
Click to expand...
Click to collapse
How could i reinstall samsung keyboard ? I have no access to the pm command in the twrp shell, and the files are encrypted anyways
Another related thing: https://forum.xda-developers.com/t/...-galaxy-s10-e-5g-exynos.4180287/post-84456927
I see that with combination of FBE, UPSM and disabled Samsung keyboard, you have put yourself in far more idiotically constrained situation than I had, as well as what Samsung devs imagined was possible.
With encrypted file system, you wouldn't even be able to flash an update.zip that includes a build.prop (from your stock ROM)with forced ADB enable-ment lines from recovery I guess. ( this is different than doing it from developer options, allows adb access without unlocking device )
I would still suggest you to charge your phone 100% and attempt a HW external keyboard method,
I am willing to bet Samsung was not stupid enough to block USB I/O devices at kernel level in UPSM.
You don't necessarily need to buy a new keyboard, just find one that connects to PCs via USB, wire or wireless dongle, either should work (no RGB/W backlights in keyboard if wired, we want a low powered keyboard, smaller if possible), from any other computer geek you know, and an OTG connector.
I have always been able to flash the stock ROM that only rewrites /system partition, and leave /data mostly untouched, have done it numerous times with odin, with new devices, you should be able to do that.
The device encryption is a hurdle which severely limits your options.
Also, my UPSM allows both wifi, and Bluetooth, if you had either of them ON, you could use a Bluetooth keyboard or debugging via wifi, if Bluetooth keyboard was previously paired(it auto connects), or wifi debug feature was set up already , ADB access might be possible, though wifi ADB is more secure, unlikely to work in locked screen guard state.
funny the most command and most upvoted answer for this issue on the internet for the average joe (not xda) is to reset the mobile.. disgusting reallly.. i also cannot imagine do the massive reconfiguration for this trivial issue. just had the gboard disappear and took a really short time to plug PC keyboard and an adapter i always have with me.
plug and play to the rescue...

broken screen enable usb debugging

yes it's another one of these threads ^^
I think my best shot at accessing my phone, especially getting at my 2fa keys, would be to use something like vyzor.
I used this just last week so I thought I would have usb debugging enabled, but somehow when I connect my phone it is not listed under adb devices.
Unlocking my phone via a usb keyboard makes it show up in the explorer, but its still stuck in charge only mode.
I tried following this guide https://gist.github.com/varhub/7b9555cdd1e5ad785ffde2300fcfd0bd to enable usb debugging
(In recovery mode my phone is accessible via adb)
and also tried to put these values
Code:
persist.service.adb.enable=1
persist.service.debuggable=1
persist.sys.usb.config=mtp,adb
into: /system/etc/prop.default
also created them as files in /data/property with the associated value (e.g. echo -n '1' > /data/property/persist.service.adb.enable)
set them via setprop (e.g. setprop persist.service.adb.enable 1 and later setprop persist.service.adb.enable true)
Before that I mounted system and data via:
Code:
twrp mount /system
twrp mount /data
mount -o rw,remount /data
mount -o rw,remount /system
But none of this worked and I also don't get how this would work without me needing to enter my pin? (I can decrypt via twrp decrypt, but I don't need to to set these values?)
Also in general lets say usb debugging is enabled, do I need to enter my pin before it will show up under adb devices
And if I don't set the adb_keys and have not yet trusted the RSA key it would show under adb devices as unauthorized?
My rom is iirc this:
[ROM][UNOFFICIAL][11.0][raphael] LineageOS 18.1
@abhishek987 any chance of a Xmas present this year? :giggle:
forum.xda-developers.com
With twrp and magisk installed.
Currently I am trying to enable file transfer via the usb keyboard by trying stuff out, taking screenshots during it and then rebooting into recovery to download those screenshots. (are there any keyboard shortcuts that would e.g. allow me taking a screenshot, or accessing search in the settings?)
Since I use the kiss launcher I can start apps by just typing the app name after unlocking. That way I managed to start a http server via termux, but termux doesn't seem to have access to any interesting files.
I also have nextcloud with instaupload enabled for my camera, which I could make it upload my Screenshots so I wouldn't need to reboot everytime ^^
Seems like this phone does not support hdmi out
Actually managed to turn on usb debugging this way. Was a bit easier cos my tv apparently through the app let me check my screenshots lol.
Is there any command or anything i can do to check that the RSA key is now permanently being accepted?
seems like a system restart resets usb debugging

Categories

Resources