broken screen enable usb debugging - Redmi K20 Pro / Xiaomi Mi 9T Pro Questions & Answe

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

Related

[Solved] X8 unable to enter xRecovery / Flashmode

Hello,
I've had my phone rooted for a long time and things were working out quite fine (yes, I have a recent xRecovery backup ) but a couple of days ago I wanted to try out something new, and wanted to prepare my system for the installation of a custom kernel.
Long story short: I used the busybox installer from the market, but it couldn't verify the installation process because of some previously installed busybox version (guess it came with my ROM...) So I used the uninstall option within the app and this is were things started to go down the drain:
Now when I reboot the phone, it's no longer possible to enter xRecovery as it was possible before (pressing back button repeatedly, during SonyEricson Logo) instead the it just reboots straight into Android. And in Android all that works is the log screen - all other applications / services crash. (I really can't do anything, as soon as I try to unlock the screen I'm bombarded with Error Messages, and sometimes the phone reboots because so many services fail)
I still can get into the reboot options menu when I press the power button > 1sec, but selecting "reboot into xRecovery" or "reboot into CWM" doesn't work -> it will just reboot normally again.
It also seems impossible to get the phone into flash mode. (Turn Phone off, Unplug USB, hold Back Button, Turn Phone on, Connect USB - and every possible variation I could find just leads to the phone booting into Android)
What I tried to do:
I still have root access when I connect to the phone with adb, so I reinstalled the busybox binary from the "SuperOneClick" package into the /system/xbin/ folder manually -> no change
I checked the debug log (from adb logcat) for errors indicate a problem, but there's no obvious message
I checked the dmesg output for errors / problems, but here everything seems to be fine
I reinstalled xRecovery manually (files from SuperOneClick) via adb by putting the files (xrecovery.tar+chargemon), into /system/bin -> no change
I tried to get into recovery / bootloader mode by using "adb reboot bootloader" and "adb reboot recovery" -> normal reboot
I checked the permissions of the binary files (su, busybox, chargemon) and they're all set to 06755
I checked if all symlinks of system programs that require busybox / su are pointing to existing binaries, and they all seem to be correct
Before I proceed and start trying some things that are not so easily reversible I've got a couple of questions:
What happens if I delete all files in the "/system/" folder? (the xRecovery files are in that folder and I guess xRecovery itself needs a couple of files to work properly)
Do you have any tips / ideas what I could try? I really don't mind resetting the phone as I have backups, it's just that I can't get into the mode where I can reset the phone
Thank you very much!
In your case, i suggest you never ever, ever fiddle up with busybox again... leave that up to chefs.
Also, i think you should try removing the battery for a couple minutes, then put it back and press back, then (while holding it) insert usb cable. That's a surefire way to get into flash mode (At least for me, sometimes it happens to boot normally even if i press back if i don't remove the battery). Also, just to be sure, before connecting your phone in flash mode, press Windows + R [In your keyboard, obviously] and type "devmgmt.msc" [Without the quotes] and see if you get a new device under USB devices. If it has a yellow triangle, right click it and choose update drivers, then point it to the flashtool folder for drivers, it should be able to find them. Good luck.
Use PCC
PCC Brought my phone to its original state when I had soft bricked my phone. It worked as a charm , and it was back to the state like nothing ever happened. Also my phone got unrooted. Everything stock like I had bought it from the store.
Use PCC , thereafter get your phone rooted again , as you had initially done.
Dude are you kidding me???You are doing it wrong man...
to get into flashmood
1. turn your phone off
2.press and hold the back button
3.without leaving the back button insert ur phones cable ..
you don't. need to turn on your phone after doing this....
use pcc or seus to repair it it's a soft brick......
@all that replied: Thank you for your help, I managed to fix the problem, will explain it in next post in case somebody runs into a similar problem
@Drknzz
about the fiddeling: that's how you learn stuff - in the last 36 hours I was forced to dig deep into android, and it was fun - and now I've got a pretty good picture of the system
Your your tip about removing the battery for a cpl of minutes didn't work for me.
I also tried XperiaRebootOptions, but this app also fails putting the phone into FASTBOOT mode - so I'll have to keep searching for an explanation
@Mayank77
I can't use PCC, because I'm running Linux as my O/S of choice and try to keep my VirtualBox locked (when I was very desperate this morning I tried it in a VirtualMachine, but PCC wouldn't connect properly to my phone)
@noobismyname
thanks, but doesn't work in my case
a little description of how you can solve problems (using Linux) with incompatible versions of su and busybox that can occur when Market Apps like BusyBoxInstaller are used in combination with ROMs that require specific Versions of the above tools.
In special cases this might lead to the problem, that you can no longer enter xRecovery or put your phone into fastboot mode (depending on your ROM) but you still have debug access to your phone.
Requirements
Nandroid / xRecovery Backup on your local machine
Android SDK -> adb
Image extraction tool unyaffs
root access to phone
Steps
Extract the backup image
The backup files created by xRecovery use an uncommon format because of the filesystem used in android. Use the tool unyaffs (code dot google dot com/p/unyaffs) to extract the image to a directory of your choice.
log into you phone with adb
open up a terminal, and use $adb shell to connect to your phone. Change to root user $su root
If required: make the partition writeable
$mount -o remount,rw -t yaffs2 /dev/block/mtdblock0 /system
compare files
open a second terminal window and navigate to the folder where you extracted the backup image. Start comparing the content of the directories with each other. Important files are: /system/build.prop, /system/bin/su ->symlink to system/xbin/su, /system/xbin/busybox, ...... (depending on what you messed up)
the command $busybox ls -l /system/targetdir | grep sought_file [/] comes in handy, because it will output the files alphabetically sorted and not in arbitrary order like the default adb ls proproamm
[*]use adb to push files to your device
if you find a missing / missmatching file use $adb push /file/on/your/pc /data/local/tmp to copy the backup file to your mobile
[*]copy files to target directory
use (as root) $ cp /data/local/tmp/file /system/..... to copy your backup into the correct place
[*]check permissions
check the permission of every file you copied and in case you're unsure: they should belong to root, group root, access permission 755 (or 06755 in case of busybox and su)
$ls -l /target/dir | grep filename to check
$chown root /target/file
$chgrp root /target/file
$chmod 755 /target/file
[*]make sure changes are written to disk
flush all pending filesystem changes $sync
[*]reboot
exit the adb session with ctrl+c
and use adb reboot to restart & enjoy your phone

[Recovery][GUIDE] Moto X 2014 Broken Screen Recovery Guide

So, after owning my beautiful Moto X for 1 month, I found that the screen is not nearly as shatter resistant as my old iPhone 4S. After managing to completely shatter it, I called Motorola up for a replacement (which for a customized Pure cost $125) and it was on its way, but before that I needed to get my old data off. Luckily I have unlocked my bootloader and rooted my phone in advance, but i had turned off USB debugging and had a passcode lock. All of the guides for making a full backup assume that you have screen access. After messing around for a few days, I finally managed to make a full backup of my phone. I thought I'd put together this guide for anyone else who has the same issue.
Assumptions
Your bootloader is unlocked and phone rooted (do not try to unlock it now or it will wipe the phone)
Your phone is not encrypted (there's still a way around this which I'll cover but I did not have to use)
You have ADB/fastboot set up on your computer (and have tested it at least once)
Required files/guides
CWM recovery file - http://motoxroot.com/cwmtwrp-recovery-for-moto-x/
Lock Screen removal guide - http://forum.xda-developers.com/showthread.php?t=1409304
SQLite DB editor (I'm on Windows) - http://sqliteadmin.orbmu2k.de/
Androidscrencast - https://code.google.com/p/androidscreencast/
ADB keystroke events - http://thecodeartist.blogspot.com/2011/03/simulating-keyevents-on-android-device.html
Steps
The first thing I did was download the customer CWM image for the 2014 Moto X which can be found here:
Code:
http://motoxroot.com/cwmtwrp-recovery-for-moto-x/
Next I went rebooted the phone into bootloader mode by holding "Volume Down + Power" for about 15 seconds. I could not see images on the screen but I could tell when it lit up.
Note: If you have an encrypted phone, you can use an OTG cable and a standard USB keyboard to type in the password blind. I used something similar for the PIN code, however this guide does not actually need to worry about that
Test that you have fasboot access by running
Code:
fastboot devices
You should see your device listed
Boot the CWM recovery image (you do not have to flash it which is nice)
Code:
fastboot boot XT1095recovery.img
Wait a few seconds and verify that you can now access your phone via ADB
Code:
adb devices -l
If this works, you now have a shell to be able to do the next part which is removing the passcode and enabling USB Debugging I followed the guide at http://forum.xda-developers.com/showthread.php?t=1409304 to do remove the lock screen
Mount the data partition of your phone by running
Code:
adb shell mount data
adb shell mount system
Grab the settings DB from the phone and copy it locally (Other guides say to copy to an intermediary, but since you're using a recovery ROM the files can be directly accessed)
Code:
adb pull /data/data/com.android.providers.settings/databases/settings.db settings.db
Open the file in your SQLite editor of choice and run the following statements
Code:
UPDATE secure SET value=65536 WHERE name='lockscreen.password_type';
UPDATE secure SET value=0 WHERE name='lock_pin_autolock';
While we have the settings DB open, it's also a good time to enable ADB Debugging by running the following statements (credits to http://stackoverflow.com/questions/13326806/enable-usb-debugging-through-clockworkmod-with-adb though I had to mod some more stuff)
Code:
UPDATE global SET value=1 WHERE name='adb_enabled';
UPDATE global SET value=1 WHERE name='development_settings_enabled';
Push the file back to it's original location
Code:
adb push settings.db /data/data/com.android.providers.settings/databases/settings.db
From here, the next set of commands should be run within the shell. You can access it by running
Code:
adb shell
Remove some existing property files
Code:
rm /data/property/persist.service.adb.enable
rm /data/property/persist.sys.usb.config
Add in the ADB settings
Code:
echo "persist.service.adb.enable=1" >>/system/build.prop
echo "persist.service.debuggable=1" >>/system/build.prop
Correct the permissions for the settings.db file
Code:
chown system:system /data/data/com.android.providers.settings/databases/settings.db
chmod 660 /data/data/com.android.providers.settings/databases/settings.db
At this point, everything is ready to go and we're ready to reboot to your real install with no pin code and ADB enabled.
Reboot your phone
Code:
adb reboot
Run androidscreencast (don't worry about the keyboard/mouse instructions they don't work). Chances are the screen will be blank, press the Power button your phone and wait (it's got a *very* slow refresh rate)
Once you see your desktop, you can now run an ADB backup. I like getting everything, but this will take a while because it grabs all images, music, SD card stuff, etc.
Code:
adb backup -apk -shared -all -f backup.ab
On the screencast you'll see the prompt pop up asking you to enter a password and confirm. This was the part that took me a while and you have to do it fairly quickly otherwise it'll time out. In a separate windows run
Code:
adb shell input text <yourpassword>
adb shell input keyevent 61
adb shell input keyevent 61
adb shell input keyevent 66
At this point, you should see a full backup kicking off and running. You can run a logcat to watch the process of it. In some cases a full backup may hang if a resource has a file open, the two commands to work with this are:
Code:
adb shell logcat | grep BackupManagerService
To kill a process the backup is hanging on, enter the shell
Code:
su
ps | grep <nameOfProcess>
am force_stop <nameOfProcess> (the clean way)
kill <pid> (the dirty way)
Hope this helps! This took me a little while to figure out but now I have a full backup and my new Moto X will be here within the
week.
Okay so an ADB full backup sucks for a restore. Luckily I got a nandroid backup instead and that worked much better. There's some stuff you have to do with mapping /sdcard for it to work on the Moto X. I'll update this post soon with that information.
Thanks a lot for this! Helped me recover all my data from a Moto X with a completely broken blank screen!
This is an awesome Guide! Congrats!! I have a different situation. My Moto X 2014 is the XT1097 variant. The phone was neither rooted nor had an unlocked bootloader before the screen died. I downloaded the stock rom for my device, and flashed it with RSD Lite, since the program sees the phone connected in fastboot mode. Do you think I could use this method to reach the desktop? Also, the recovery.img in your guide is for the XT1095. Would it work for the XT1097? I know I can unlock the bootloader via fastboot, but what about rooting? Thanks in advance!!

[GUIDE] Fix fingerprints and Wi-Fi after failed Oreo update

If, like me, you tried to update to Oreo while you were on Nougat rooted, you should have been greeted with some encryption problems, leading to an almost complete loss of data. Except Joocx posted a guide for how to get the data back, so you could get the data back. Nice, but how do we get a working phone back? Maybe you flashed Nougat again and restored your /data and internal storage backups, hoping it would work. It did work. Except Wi-Fi was broken and fingerprints didn't work.
If you haven't managed yet to get a working phone back, you can have a look here.
Restore Wi-Fi and fingerprints on Nougat or Oreo, without data loss
Reboot in TWRP (no matter which version, as long as you use 3.2.1-0 if you're on Oreo), and from your PC run the following commands.
If you feel like it, you can also run the three rm commands from the TWRP terminal, but it's hard.
Code:
C:\> adb shell
~ # rm /data/misc/wifi/wpa_supplicant.conf
~ # rm -rf /data/system/users/0/fpdata
~ # rm /data/system/users/0/settings_fingerprint.xml
Reboot to system, and voilà.
Update: 3DSammy has pointed out that plugging in your phone to your computer is actually not required. All the file management operations can be done using TWRP's file manager (in the "Advanced" section), the commands can be run directly on the phone using TWRP's terminal and OTG storage can be used for the ROM and Magisk. I had forgot about that file manager since I thought it was only for reading (not for writing/deleting).
Just so others know, TWRP under the "Advanced" menu item has a "File Manager" which allows you to remove each of these files. That's important for those who can't get to a PC with a working adb to mount the shell. I used OTG external storage to access the OTA and Magisk zips for flashing and storage of my nandroid backup.
Personally I would need the File Manger as I have a fully functioning PC fastboot but for some reason can't see my OP5 using adb. Not a big deal but there is a user-friendly built right into TWRP which always has "root" privileges to "/data".
zdimension said:
If, like me, you tried to update to Oreo while you were on Nougat rooted, you should have been greeted with some encryption problems, leading to an almost complete loss of data. Except Joocx posted a guide for how to get the data back, so you could get the data back. Nice, but how do we get a working phone back? Maybe you flashed Nougat again and restored your /data and internal storage backups, hoping it would work. It did work. Except Wi-Fi was broken and fingerprints didn't work.
If you haven't managed yet to get a working phone back, you can have a look here.
Restore Wi-Fi and fingerprints on Nougat or Oreo, without data loss
Reboot in TWRP (no matter which version, as long as you use 3.2.1-0 if you're on Oreo), and from your PC run the following commands.
If you feel like it, you can also run the three rm commands from the TWRP terminal, but it's hard.
Code:
C:\> adb shell
~ # rm /data/misc/wifi/wpa_supplicant.conf
~ # rm -rf /data/system/users/0/fpdata
~ # rm /data/system/users/0/settings_fingerprint.xml
Reboot to system, and voilà.
Update: 3DSammy has pointed out that plugging in your phone to your computer is actually not required. All the file management operations can be done using TWRP's file manager (in the "Advanced" section), the commands can be run directly on the phone using TWRP's terminal and OTG storage can be used for the ROM and Magisk. I had forgot about that file manager since I thought it was only for reading (not for writing/deleting).
Click to expand...
Click to collapse
Hey Z,
I was hoping you can walk me through this process as I'm still unable to fix this Wifi Issue. I've done exactly as you said in the guide but my wifi is still not working. It will turn on and everything but will not connect to a network. It just says "configuring ip address".
Dchoi229 said:
Hey Z,
I was hoping you can walk me through this process as I'm still unable to fix this Wifi Issue. I've done exactly as you said in the guide but my wifi is still not working. It will turn on and everything but will not connect to a network. It just says "configuring ip address".
Click to expand...
Click to collapse
Indeed, it's weird that it's still not working. But if I understood correctly, you are able to turn it on and scan networks, which is a step forward fixing the problem. The message you are getting means that there is a problem while requesting an IP address through DHCP. Try using a static IP on that network. If it works, then there may be a conflict it some other DHCP problem on your router. Otherwise, try on another WiFi network. If neither if those works, then I don't know.
zdimension said:
Indeed, it's weird that it's still not working. But if I understood correctly, you are able to turn it on and scan networks, which is a step forward fixing the problem. The message you are getting means that there is a problem while requesting an IP address through DHCP. Try using a static IP on that network. If it works, then there may be a conflict it some other DHCP problem on your router. Otherwise, try on another WiFi network. If neither if those works, then I don't know.
Click to expand...
Click to collapse
Thanks for the response Z! I just tried it and my wifi isn't stable at all when trying to connect to wifi. It's my workplace wifi that I usually have to sign into to access. It'll connnect and disconnect constantly. Is there anything you'd advise me to do?
Ok so I'm a little confused.
Are we running the command in one full line? eg:
C:\> adb shell ~ # rm /data/misc/wifi/wpa_supplicant.conf
My fingerprint sensor never died so I don't require that fix. I just cannot connect to wifi network. Detects it but once connection attempts in just reverts to 'saved' and tries to reconnect.
Also are you sure this is run once you boot into TWRP and not Fastboot mode?
Running from TWRP via ADB:
C:\>adb shell ~ # rm /data/misc/wifi/wpa_supplicant.con
/sbin/sh: /: Permission denied
From TWRP terminal manager I ran the same command and errored with sh: adb: not found.
I'm rooted and encrypted.
Cheers.
buzzfuzz1 said:
Ok so I'm a little confused.
Are we running the command in one full line? eg:
C:\> adb shell ~ # rm /data/misc/wifi/wpa_supplicant.conf
My fingerprint sensor never died so I don't require that fix. I just cannot connect to wifi network. Detects it but once connection attempts in just reverts to 'saved' and tries to reconnect.
Also are you sure this is run once you boot into TWRP and not Fastboot mode?
Running from TWRP via ADB:
C:\>adb shell ~ # rm /data/misc/wifi/wpa_supplicant.con
/sbin/sh: /: Permission denied
From TWRP terminal manager I ran the same command and errored with sh: adb: not found.
I'm rooted and encrypted.
Cheers.
Click to expand...
Click to collapse
Nah, the command is supposed to be run when the phone is in TWRP.
First, you use adb shell to open a terminal from your PC (ignore this step if you want to use TWRP's integrated terminal directly on the phone).
Then, when you're in the shell, run the rm command.
Well it seems this fix didn't work unfortunately :/ Wifi still cannot connect to any network.
Is the command simply deleting the file and it regenerates upon reboot?
buzzfuzz1 said:
Well it seems this fix didn't work unfortunately :/ Wifi still cannot connect to any network.
Is the command simply deleting the file and it regenerates upon reboot?
Click to expand...
Click to collapse
The file the command deletes is basically the "Wi-Fi" settings file, which contain identification settings for the network card amongst other things. If you keep the Nougat one while you're on Oreo, you can't turn on Wi-Fi, or use anything related to the Wi-Fi antenna; Thus, we delete it. That solves the problem "Wi-Fi doesn't turn on". Here, you've got another problem: "Wi-Fi can't connect". I have no clue of what could be causing this, this issue never happened to me. I'm gonna search a bit and update here if I find anything.

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...

How to rescue data from my 9T Pro

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

Categories

Resources