Bootlooped my phone by editing system - OnePlus 5 Questions & Answers

Hi there
Apologies if this is the wrong place. I did something dumb. I played with jOnePlus to change the accent color of my rooted OnePlus 5 with Oreo oxygenOS.
Then I ran the command
adb shell settings put system oem_black_mode_accent_color '#xxxxxxxxxxxx'
I cut and pasted and forgot to change the xxxxxxxx to a real hex colour. Then I got a System UI has stopped and now my phone tries to boot, goes to the Oxygen logo then goes to TWRP. I try to boot to system but it fails and goes to TWRP. I wiped cache and Dalvik to no avail.
Can I edit the shell settings inside of TWRP? Can I repair the settings somehow. Yes, I am dumb, but any help would be really appreciated.
EDIT--------------FIXED----------------
Hi all. Thank you all very much for your advice. I was determined not to dirty or clean flash, so I persevered .
I did a lot of research and fumbling, and I managed to edit the correct file so that the phone now boots and my data is preserved.
I downloaded PuTTYTray so that I could navigate and edit easily. See Stackoverflow for details (can't post link).
Then I booted into TWRP and opened PuTTYTray, then I navigated to:
data/system/users/0
where there are a lot XML settings files. I found a file called settings_system.xml and went looking through it.
I saw:
<setting id="44341" name="oem_black_mode_accent_color" value="#xxxxxxxxxxxxx" package="com.android.shell" defaultValue="#ff42a5f5" defaultSysSet="true" />
and changed it to value="ff0000"
Then rebooted and the phone was fine.
Thanks to Stackexchange (can't post link) also.

If you have backup, try to restore it or Dirty flash the rom.

There's a terminal available in TWRP, you should try to use that.
May I ask why you decided to change the accent colour via command? I believe you can now select any colour you want with the built in menu.

daviddosa said:
There's a terminal available in TWRP, you should try to use that.
May I ask why you decided to change the accent colour via command? I believe you can now select any colour you want with the built in menu.
Click to expand...
Click to collapse
he mentioned that he's using oreo oos..
it doesn't have this feature on oreo. only basic colors are available.
as of the op problem, i suggest to clean install.. as dirty flashing may keep ur settings and preferences so it won't help.

Related

[RESOLVED] assistance needed - chmod /data/data/

Hi guys, I recently used the 'fix permissions' option in ROM Manager, which caused my SMS contact pictures to disappear. I then was trying to fix this by doing:
Code:
su
chmod 666 /data/data/com.android.providers.contacts/files/*
in Terminal Emulator on the device and dropped it right at :
Code:
su
chmod 666 /data/data/
anyways, long story short......./data/data/ is now 666, the device just constantly force closed eveything and is now in a constant boot loop. So any advice in the best way to fix this? I have tried booting into recovery and doing 'fix permissions' but this does not fix it.
Would fastboot allow me to connect to PC and chmod /data/data/ to the correct permissions? (and what would those be??) Or is it screwed and do I need to factory reset?
Many thanks for any hrlp guys
Have you tried re-flashing your ROM form recovery, this should reset the permissions
To be honest I'm new to Android and don't know which img that would be or how to go about doing it. Would doing this wipe any of my data? I was hoping there would be a simple way of getting a terminal through my pc and chmod from there (if I knew the correct permissions).
fubofo said:
To be honest I'm new to Android and don't know which img that would be or how to go about doing it. Would doing this wipe any of my data? I was hoping there would be a simple way of getting a terminal through my pc and chmod from there (if I knew the correct permissions).
Click to expand...
Click to collapse
fix permissions will do it for the files within the folder so if it where that simple I think it you would have fixed it 666 gives read/write permissions to everyone so I don't see that would have caused your problems, what ROM are you currently running? If it's a custom one simply reflash it, which should preserve all your Data if not you may need to run an RUU for your vendor/market which will wipe everything
ghostofcain said:
fix permissions will do it for the files within the folder so if it where that simple I think it you would have fixed it 666 gives read/write permissions to everyone so I don't see that would have caused your problems, what ROM are you currently running? If it's a custom one simply reflash it, which should preserve all your Data if not you may need to run an RUU for your vendor/market which will wipe everything
Click to expand...
Click to collapse
Thanks for the reply, I'm running stock ROM with eng hboot, recovery obviously and custom kernel. The reason I ask about fastboot chmod is because I'm not 100% 'fix permissions' is working via recovery.
Also, just for knowledge sake, what .img would be for what from my backup?
- .android_secure.img
- boot.img
- cache.img
- data.img
- nandroid.md5
- recovery.img
- system.img
Re-reading your original post, something weird is going on here as running 'fix permissions' shouldn't have caused any grief in the first place, possibly your OC is too aggressive for your CPU? (although it shouldn't be).
Plenty of people have come across the same issue when running 'fix permissions' from ROM Manager. It causes contact pictures to not display in the SMS apps in some cases.
Also, I remember running an option from recovery and it did nothing (even though reported completed) hence why I want to overrule the fix permissions from CM Recovery 2.5.1.3 and try to run commands into the device someway (via fastboot if possible or another method).
I just need to know what permissions should be for /data/data/ and how I would go about running commands to the device. And failiing that, what .img would be needed flashed to get a working device again with as little data lost as possible nd how to go about flashing it... fastboot or recovery update.zip?)
fubofo said:
Plenty of people have come across the same issue when running 'fix permissions' from ROM Manager. It causes contact pictures to not display in the SMS apps in some cases.
Also, I remember running an option from recovery and it did nothing (even though reported completed) hence why I want to overrule the fix permissions from CM Recovery 2.5.1.3 and try to run commands into the device someway (via fastboot if possible or another method).
I just need to know what permissions should be for /data/data/ and how I would go about running commands to the device. And failiing that, what .img would be needed flashed to get a working device again with as little data lost as possible nd how to go about flashing it... fastboot or recovery update.zip?)
Click to expand...
Click to collapse
assuming you are running cM 2.5.1.3 recovery?, have you a nandroid backup to fall back ON, restoring that, from recovery, would be my first step. If not Modaco has a stock ROM that you could try flashing from recovery which should retain your data
ghostofcain said:
assuming you are running cM 2.5.1.3 recovery?, have you a nandroid backup to fall back ON, restoring that, from recovery, would be my first step. If not Modaco has a stock ROM that you could try flashing from recovery which should retain your data
Click to expand...
Click to collapse
Yeah I have backups but from a while ago (first boot to be honest lol). But what should I restore and how? (system.img or data.img? as its /data/data/ that seems screwed)
fubofo said:
Yeah I have backups but from a while ago (first boot to be honest lol). But what should I restore and how? (system.img or data.img? as its /data/data/ that seems screwed)
Click to expand...
Click to collapse
Not sure how a partial restore would go, I normally do a full restore via recovery
OK so I have managed to get it working again. Ran backup form recovery which seemed to allow me to gain adb shell once the backup was completed. From there I chmod 777 /data/data/ and this allowed me to boot the device.
Everything seems to be gone, like contacts and such, but my apps are all there inc. Titanium backup. I have restored all system data from the Titanum backups and am currently running Rom Manager 'fix permissions' to see if that will add the correct permissions to /data/data/ again.
Hopefully I just now need to add my Google / exchange / etc. accounts again to be back to normal.
[UPDATE] - everything now seems to be working fine (except the original SMS contact pictures issue) and my entire device is back to the way it was last week (from Titanium backup I presume).
[UPDATE 2] - have now successfully ran chmod 666 /data/data/com.android.providers.contacts/files/* (after Rom Manager 'fix permissions' and reboot) and SMS contact pictures are all working again. Everything is syncing now so should be back to normal soon!!
on a side note, this obviously shows there is an issue with fix permissions, looks like it needs updated.
I too had the "contact picture" issue after performing the mentioned "fix permissions" command in ROM Manager. By the way, I simply fixed it by manually re-assigning the picture for each contact -- fortunately I have just a couple dozen contacts with picture so it didn't take too long.
capt_harlock77 said:
I too had the "contact picture" issue after performing the mentioned "fix permissions" command in ROM Manager. By the way, I simply fixed it by manually re-assigning the picture for each contact -- fortunately I have just a couple dozen contacts with picture so it didn't take too long.
Click to expand...
Click to collapse
Yeah I tried that too first but it didnt seem to work for me, removed image then reassigned for a number of contacts but nothing worked. It's fixed now so I'll just let this die here for future similair issues.

Screen resolution messed up -help needed!

Hi, playing around with an app called "Resolution Changer Pro", I set my phone to 350x350 in order to try a few things how my smartwatch would behave, which has also android and 400x400.
That went OK, and I was able to get back to fullHD fine.
Then I also changed the DPI accidentally to 100 and then the phone crashed.
Rebooting results in a black screen and I can´t do anything....
With adb I tried to set the resolution back to something usable, and the reply was that the window manger is not running.
Then I tried to get hold of the build.prop with adb and checked the DPI setting there, which was 480 .. the defailt setting.
Now my android knowledge is at the edge, and I don´t have an Idea how to reset the settings back to normal.
What could I do without deleting everything and re-flashing?
Pros.. what should I do ??? :crying::crying:
Flash same rom via recovery.
maitrot said:
Hi, playing around with an app called "Resolution Changer Pro", I set my phone to 350x350 in order to try a few things how my smartwatch would behave, which has also android and 400x400.
That went OK, and I was able to get back to fullHD fine.
Then I also changed the DPI accidentally to 100 and then the phone crashed.
Rebooting results in a black screen and I can´t do anything....
With adb I tried to set the resolution back to something usable, and the reply was that the window manger is not running.
Then I tried to get hold of the build.prop with adb and checked the DPI setting there, which was 480 .. the defailt setting.
Now my android knowledge is at the edge, and I don´t have an Idea how to reset the settings back to normal.
What could I do without deleting everything and re-flashing?
Pros.. what should I do ??? :crying::crying:
Click to expand...
Click to collapse
First you have to flash TWRP in order to use terminal in recovery.
Download AROMA Filemanager from here thanks to @amarullz
Go into recovery then flash it. (don't forget to mount system partition first.)
Guide to path /system/ then select Menu->open console
type in
vi build.prop
Click to expand...
Click to collapse
Once you open the build.prop with vi , you can now use the arrow button to guide to your section.
There's two mode in vi, edit mode and connamd mode.
You have to enter "i" first to enter edit mode
Once you finish editing, press Esc on top and now you are back to command mode
Enter following command to save the file and quit:
:wq
Click to expand...
Click to collapse
Now press Close on right top then press menu and exit file manager, reboot your device.
You are done.
TIPs: Here's an useful command to delete a line that you can't use delete to eliminate
In command mode, type in following command to delete a line:
:dd
Click to expand...
Click to collapse
1. Ok, flashing the same rom did not help... this was the first thing I tried.
2. I already tried to work with my build.prop, which I downloaded with adb from the device.. I already said that in my first post.
In the build.prop the dpi setting is at 480, like I said. Modyfiying it from twrp with vi is the same as downloading it via adb and then modyfiying it locally and uploading it again..... this did not help, dpi was at 480, like I said.
Strange... right?
Where is the screen resolution saved? Dpi is in build.prop, but where is the resolution saved at?
The problem must be somewhere in the data partition, since flashing does not help. I erased system and re-flashed. no help.
maitrot said:
1. Ok, flashing the same rom did not help... this was the first thing I tried.
2. I already tried to work with my build.prop, which I downloaded with adb from the device.. I already said that in my first post.
In the build.prop the dpi setting is at 480, like I said. Modyfiying it from twrp with vi is the same as downloading it via adb and then modyfiying it locally and uploading it again..... this did not help, dpi was at 480, like I said.
Strange... right?
Where is the screen resolution saved? Dpi is in build.prop, but where is the resolution saved at?
The problem must be somewhere in the data partition, since flashing does not help. I erased system and re-flashed. no help.
Click to expand...
Click to collapse
Then you should backup before flashing or doing root permission changes.
You can now do a fully backup , data, cache anything And then flash the stock firmware via SP_FlashTool.
If you boot, then try to restore the partition one by one.
jwchen119 said:
Then you should backup before flashing or doing root permission changes.
You can now do a fully backup , data, cache anything And then flash the stock firmware via SP_FlashTool.
If you boot, then try to restore the partition one by one.
Click to expand...
Click to collapse
Ok, I did that... made a backup of all partitions, erased everything and re-flashed latest dev firmware.
Off course, everything works fine now, but all my settings and stuff are lost.
going back to my old data partition, the problem is back.
How can I get back to my old settings? What do you mean one by one?

Data Toggle button?

I know some international versions of the S7 have the data toggle in their drag down. Obviously AT&T HAS to remove it to inconvenience their customers......
How do we go about putting it back in? Would it be something like it was on the S5? (see here - http://forum.xda-developers.com/showthread.php?t=2721550)
Currently at work, but I'll be taking a look at this once I'm home.
---
edit - looks like I've found something from a German forum!! http://www.android-hilfe.de/thema/r...ixperience-s7-port-stable-v3-1.759967/page-33
I'm testing this now, hopefully my phone reboots
edit 2 - failure. Maybe someone else can see where I went wrong?
*DISCLOSURE - only follow the below if you are comfortable with messing up your phone. I will not be reliable for your damaged phone, if something does go wrong*
Based on the thread I found in German above, you have to edit "sysui_qs_tiles". For some reason, SQLite Editor cannot find that file, but Settings Database Editor(SDE) by 4A does.
Once SDE has been installed, head to secure, and scroll down until you see "sysui_qs_tiles"(see attached screenshot). When you click to edit it, you'll get a permissions error.
To stop the permissions error, plug phone into computer, open where your ADB is installed, then open an Administrator command prompt there. (start-> type "cmd" -> right click and select administrator, then type "cd c:\adb", or where your ADB is stored) You should do "adb devices" and then see your devices. If you do, paste this "adb shell pm grant by4a.setedit android.permission.WRITE_SECURE_SETTINGS". The next time you click on "sysui_qs_tiles", you'll be able to edit it.
The German thread says to reference this:
Wifi,Location,SilentMode,RotationLock,Bluetooth,MobileData,PowerSaving,AirplaneMode,DormantMode,Flashlight,UltraPowerSaving,WifiHotspot,PersonalMode,AllShareCast,Sync,Aod,SFinder,ScreenCapture
Click to expand...
Click to collapse
I tried inserting MobileData, but when I restart, there is no new MobileData tile (the MobileData addition stays in the "sysui_qs_tiles" though).
Any thoughts?
edit 3 - tried it one more time, and I added the screenshot tile!! Looks promising, but we would need to find the name for the mobiledata tile.
Delete
I am on PK1 and after flashing engboot i didnt like the way my phone ran so I flashed AP file of PK1 and now suddenly I have data toggle. I never even rooted with engboot or did any other adjustments to try and get the toggle.

Any way to change dpi without adb ?

I have rooted my BTV-W09 model. When I use 'adb shell wm density 320' from my computer terminal, the dpi setting is adjusted correctly, but it doesn't survive a reboot.
I tried to change the dpi setting with a build.prop editor directly on the tablet and with the Textdroider DPI app, but it doesn't work, it goes back to whatever DPI settings was implied by the display settings (from Small-400dpi to Large-480dpi).
Is there a way to permanently change the DPI setting to 320, or at least a way to do it directly from the tablet (without a computer)?
Why you not reading neighbor topics? Install Xposed, install App Settings module from here for example, activate it and setup whatever DPI you wish.
Thanks Slavon, but I'm speaking of a system-wide change, not just app by app. English is not my first language, sorry if it wasn't clear.
Sorry if I was a bit rude. Try "Pimp my rom" utility. Find it on Google Play. I worked for me and now I'm thinking of how to revert
Edit: if I got it right, this utility adds (modifies?) this key in build.prop: ro.sf.lcd_density
Not at all, I understand how it seemed like I was asking a duplicate question without looking in others threads, sorry again
And thanks a lot for the advice, I'll try Pimp my rom right away !
wlausrsker said:
Not at all, I understand how it seemed like I was asking a duplicate question without looking in others threads, sorry again
And thanks a lot for the advice, I'll try Pimp my rom right away !
Click to expand...
Click to collapse
If you just need to change density, you'd better try changing the value in build.prop first. And in case of any problems after, change the value of the key I wrote previously or restore the original build.prop from backup. Good luck.
Slavon-93 said:
If you just need to change density, you'd better try changing the value in build.prop first. And in case of any problems after, change the value of the key I wrote previously or restore the original build.prop from backup. Good luck.
Click to expand...
Click to collapse
I've tried this morning to change ro.sf.lcd_density to 320 in the build.prop and reboot. After reboot, ro.sf.lcd_density is still set to 320 but the display is still at 400dpi.
It's like ro.sf.lcd_density has no impact on the display dpi except for the display mode (tablet, phone, etc.).
Screen settings/Small + ro.sf.lcd_density=320 -> tablet mode in Chrome and 400dpi
Screen settings/Small + ro.sf.lcd_density=400 -> phone mode in Chrome and 400dpi
Screen settings/Large + ro.sf.lcd_density=320 -> tablet mode in Chrome and 480dpi
Screen settings/Large + ro.sf.lcd_density=400 -> phone mode in Chrome and 480dpi
I think maybe the DPI setting from build.prop is replaced during boot with the screen setting (Small:400dpi, Medium:440dpi, Large:480dpi). Could a init.d script could change the value after boot? I'll try tonight if the tablet allows init.d scripts to run.
Well, ok. I only quickly looked through the decompiled code. Change dpi with the app then, it'll make a backup of build. prop and try to compare both files - new and backup. I could have missed something. Just to mention, I didn't like the way tablet had behaved after changing DPI. EMUI is not well-designed for this. It's much better to set DPI for apps and leave it unmodified for system.
@wlausrsker this is covered in the apps running in phone mode thread. I posted there that the adb dpi change settings will stick after rebooting if you run the command "adb shell wm density 340 && adb reboot"*
*Use whatever density works best for you, I have found that 330 works best for me with the view mode and font set to large.
Slavon-93 said:
Change dpi with the app then, it'll make a backup of build. prop and try to compare both files - new and backup. I could have missed something.
Click to expand...
Click to collapse
johje said:
@wlausrskerI posted there that the adb dpi change settings will stick after rebooting if you run the command "adb shell wm density 340 && adb reboot"
Click to expand...
Click to collapse
johje, thanks but I tried it first and it doesn't survive reboot ("./adb shell wm density 320 && ./adb reboot" since I'm on Mac, it reboots in 400dpi).
Slavon, I've compared the files from before and after changing the dpi setting with the app, only ro.sf.lcd_density is changed, so you didn't miss anything.
Since methods successfully used by you and others don't work for me, it must be something I did differently on setting up my tablet. I used greatslon mod of TWRP and then flashed via TWRP the latest SuperSU (v2.79-SR1). Finally, I installed XposedInstaller and got xposed-v87-sdk23-arm64. Did any of you with reboot-surviving custom dpi setting used something different? (like the SRK Tool)
I'm off this weekend but I'll try next week to start over from scratch.
the reason adb change dpi and even build.prop change doesn't work is because huawei has set lcd_density in boot image. check content of /init.6x.rc
these init files are part of boot.img and will be overwritten at every boot. so what u need is a modified boot.img where this set lcd_density line is removed. Once you install that boot, you can set whatever dpi in build.prop and it will work. even adb dpi change will be persistent.
if you are on b026, i can share my edited boot.img
Thanks for the explanation bark1234, I now understand why everything I tried didn't survive reboot!
Thanks also for proposing your edited B026 boot.img but I'm on BTV-W09C100B005 and I can't find any B026 download for BTV-W09. From what I understand from other threads the latest Chinese OTA for the BTV-W09 is the BTV-W09C233B022, so I couldn't use it. Nevertheless, if you could maybe share it for others, it could help someone with the same problem on a BTV-DL09.
I tried to edit my boot.img but I'm a newbie. I've tried to extract my boot.img but I have no result with "cat /proc/mtd", so I extracted mmcblk0boot0 as a best guess. I tried to install abootimg to edit it but there's not blkid.h on Mac OS so I can't build it. If I give you what I extracted, could you maybe edit it like you did with yours? You would save me from applying at random a bunch of tutorials like I just did and hoping it will result in something usable In the meantime, I'll try and learn how to edit a boot.ini with my setup.
bark1234 said:
the reason adb change dpi and even build.prop change doesn't work is because huawei has set lcd_density in boot image. check content of /init.6x.rc
these init files are part of boot.img and will be overwritten at every boot. so what u need is a modified boot.img where this set lcd_density line is removed. Once you install that boot, you can set whatever dpi in build.prop and it will work. even adb dpi change will be persistent.
if you are on b026, i can share my edited boot.img
Click to expand...
Click to collapse
Just as an FYI, the adb dpi change initiated along with the reboot command has stuck for me after multiple reboots.
wlausrsker said:
Thanks for the explanation bark1234, I now understand why everything I tried didn't survive reboot!
Thanks also for proposing your edited B026 boot.img but I'm on BTV-W09C100B005 and I can't find any B026 download for BTV-W09. From what I understand from other threads the latest Chinese OTA for the BTV-W09 is the BTV-W09C233B022, so I couldn't use it. Nevertheless, if you could maybe share it for others, it could help someone with the same problem on a BTV-DL09.
I tried to edit my boot.img but I'm a newbie. I've tried to extract my boot.img but I have no result with "cat /proc/mtd", so I extracted mmcblk0boot0 as a best guess. I tried to install abootimg to edit it but there's not blkid.h on Mac OS so I can't build it. If I give you what I extracted, could you maybe edit it like you did with yours? You would save me from applying at random a bunch of tutorials like I just did and hoping it will result in something usable In the meantime, I'll try and learn how to edit a boot.ini with my setup.
Click to expand...
Click to collapse
If you are rooted, use flashfire app to get ur current boot.img from ur phone. and then copy it out to edit.
The tool i use for editing works on windows. i too have mac only, i have windows on vm in it.
https://www.dropbox.com/s/x46q5nzv49iauwi/Android Image Kitchen.rar?dl=1
Use above link to download tool i use.
unpackimg.bat will unpack boot img.
your init.x files will be in ramdisk, edit it there.
and then use repackimg.bat, it will create new boot.img.
johje said:
Just as an FYI, the adb dpi change initiated along with the reboot command has stuck for me after multiple reboots.
Click to expand...
Click to collapse
bark1234 said:
If you are rooted, use flashfire app to get ur current boot.img from ur phone. and then copy it out to edit.
The tool i use for editing works on windows. i too have mac only, i have windows on vm in it.
https://www.dropbox.com/s/x46q5nzv49iauwi/Android Image Kitchen.rar?dl=1
Use above link to download tool i use.
unpackimg.bat will unpack boot img.
your init.x files will be in ramdisk, edit it there.
and then use repackimg.bat, it will create new boot.img.
Click to expand...
Click to collapse
johje, it won't stuck for me, no matter how I try. Did you root by flashing the latest SuperSU? Did you installed xposed framework?
bark1234, thank you very much for the detailled explanation, I'll use Flashfire app to extract my boot.img and I'll try tomorrow at work on my Windows machine to edit it.
@wlausrsker I have not yet rooted my tablet. Once I got the dpi/phone apps issue fixed, it reduced my urgency for rooting. However, I will be rooting it soon, since a way has been found to enable the 5Ghz wireless adapter for the US version of the tablet. I will let you know if I am able to keep the dpi settings after rooting.
bark1234 said:
If you are rooted, use flashfire app to get ur current boot.img from ur phone. and then copy it out to edit.
unpackimg.bat will unpack boot img.
your init.x files will be in ramdisk, edit it there.
and then use repackimg.bat, it will create new boot.img.
Click to expand...
Click to collapse
Thanks again for the link and the explanation, it was really a painless process.
I used Flashfire app on my tablet to backup my boot.img (it resulted in a boot.lz4 file).
On my Windows machine, in a cmd window:
Code:
lz4 boot.lz4
unpackimg.bat boot
I then opened in Notepad++ the /ramdisk/init.61262.rc file to remove the line setprop ro.sf.lcd_density 560 in the on early-init and on boot sections of the file and saved.
In the cmd window:
Code:
repackimg.bat
rename image-new.img boot.img
I now have an edited boot.img to flash in TWRP. Does it seems to you that I did the editing correctly? The edited boot.img is 13.35Mb (about the same as the boot.lz4) but the extracted boot file before the unpacking was 32.77Mb. Is it normal?
13.9 is correct size. install this boot.img
For those of us following along. Does the edited boot image have to be flashed by TWRP in zip form? Or can we use Fastboot to flash it? or both will work?
I've done the edit's and have what I believe is a flashable zip. I personally like to use fastboot.
I have DPI set and holding by adb as I mentioned before but this is still nice to have.
Thanks
OP - here's a really easy way to change dpi and make it stick: https://play.google.com/store/apps/details?id=com.texdroider.texdroider_dpi
I'm using it on my MediaPad M3 without issues. PS - 320 is my preferred dpi as well, but I found it caused some issues like Settings would crash. I'm using 322 now without any issue for the last couple weeks. Enjoy

Forgotten pattern - how to unlock phone without loosing data

Don't ask me how, but I somehow set pattern and forgot it in one hour. I use face rec. as well but after reboot I need to unlock with pattern.
For last 10h I tried all methods how to unlock phone, but no success.
I'm using original, ROM, my G6 model is H870, running Pie, unlocked bootloader, so I can use TWRP. I spent most of my time and knowledge to unlock phone with adb/twrp. Best option I found is to delete gesture.key file which is located under /data/system.
Problem is, that /data is encrypted ...
Is there anyone who managed to remove pattern/lock without loosing data?
Thank you for your time!
akulp said:
Don't ask me how, but I somehow set pattern and forgot it in one hour. I use face rec. as well but after reboot I need to unlock with pattern.
For last 10h I tried all methods how to unlock phone, but no success.
I'm using original, ROM, my G6 model is H870, running Pie, unlocked bootloader, so I can use TWRP. I spent most of my time and knowledge to unlock phone with adb/twrp. Best option I found is to delete gesture.key file which is located under /data/system.
Problem is, that /data is encrypted ...
Is there anyone who managed to remove pattern/lock without loosing data?
Thank you for your time!
Click to expand...
Click to collapse
Maybe this will work: https://************/delete-android-security-pin/
Edit: link gets truncated... Just search 'Remove pin twrp' on Google and click the first result.
krilok said:
Maybe this will work: https://************/delete-android-security-pin/
Edit: link gets truncated... Just search 'Remove pin twrp' on Google and click the first result.
Click to expand...
Click to collapse
Non of this solutions work.
This is pretty the same as I said. My problem is that /data is encrypted and I can't find/see any .key files.
Also I can't do "su" command inside adb shell because of "insuff. privileges" ...
I tried all this solutions:
https://forum.xda-developers.com/showthread.php?p=49666433#post49666433
For method 1 -5 there is a problem with .key files which are not seen to my TWRP/Aroma browser. I don't know If I'm doing anything wrong in method 7, but also after mount I can't access /data/system (/data is empty).
In method 6 I'm stucked on
"Run pull settings.db.cmd inside By-pass security Hacks folder to pull out the setting file out of your phone." step.
I get "insuff. privileges" error.
akulp said:
Non of this solutions work.
This is pretty the same as I said. My problem is that /data is encrypted and I can't find/see any .key files.
Also I can't do "su" command inside adb shell because of "insuff. privileges" ...
I tried all this solutions:
https://forum.xda-developers.com/showthread.php?p=49666433#post49666433
For method 1 -5 there is a problem with .key files which are not seen to my TWRP/Aroma browser. I don't know If I'm doing anything wrong in method 7, but also after mount I can't access /data/system (/data is empty).
In method 6 I'm stucked on
"Run pull settings.db.cmd inside By-pass security Hacks folder to pull out the setting file out of your phone." step.
I get "insuff. privileges" error.
Click to expand...
Click to collapse
Have you tried this?
https://forum.xda-developers.com/android/software-hacking/remove-lockscreen-recovery-t3530008
Basically, the files you have to delete in the /data/system folder in TWRP are:
password.key
pattern.key
locksettings.db
locksettings.db-shm
locksettings.db-wal
It happened to me a while ago and I didn't have any '.key' files either; I just deleted the rest and when I booted up, I had no lock screen security PIN nor registered fingerprints but could re-set them again through security settings. I didn't need to flash any files nor fiddle around with adb commands, and all my data remained untouched...
If you can't find all those five files or the '.key' files, just delete the ones you can find and it should work. Otherwise, you'll probably have to do a full reset and reinstall...
krilok said:
Have you tried this?
https://forum.xda-developers.com/android/software-hacking/remove-lockscreen-recovery-t3530008
Basically, the files you have to delete in the /data/system folder in TWRP are:
password.key
pattern.key
locksettings.db
locksettings.db-shm
locksettings.db-wal
It happened to me a while ago and I didn't have any '.key' files either; I just deleted the rest and when I booted up, I had no lock screen security PIN nor registered fingerprints but could re-set them again through security settings. I didn't need to flash any files nor fiddle around with adb commands, and all my data remained untouched...
If you can't find all those five files or the '.key' files, just delete the ones you can find and it should work. Otherwise, you'll probably have to do a full reset and reinstall...
Click to expand...
Click to collapse
Problem is, that I don't have any files/folders at all in my /data. I even don't see system folder inside data.
akulp said:
Problem is, that I don't have any files/folders at all in my /data. I even don't see system folder inside data.
Click to expand...
Click to collapse
Sounds like your data folder is not mounted when you boot to TWRP... Have you checked? Reboot to TWRP, select the Mount option; data should be ticked by default. It it isn't, select it, go back to TWRP file manager, and see if you can now browse folders and files...
krilok said:
Sounds like your data folder is not mounted when you boot to TWRP... Have you checked? Reboot to TWRP, select the Mount option; data should be ticked by default. It it isn't, select it, go back to TWRP file manager, and see if you can now browse folders and files...
Click to expand...
Click to collapse
Unfortunately it's checked ... It's seems from this post:
https://forum.xda-developers.com/android/software-hacking/remove-lockscreen-recovery-t3530008/page12
nobody managed to get to (encrypted) /data on Pie.
akulp said:
Unfortunately it's checked ... It's seems from this post:
https://forum.xda-developers.com/android/software-hacking/remove-lockscreen-recovery-t3530008/page12
nobody managed to get to (encrypted) /data on Pie.
Click to expand...
Click to collapse
Last comment on that thread says the solution also works on Havoc Os 2.9, which is based on Pie... Maybe that person wasn't encrypted to begin with, but, if it doesn't work for you, I guess then the only way to go is a full reset... Good luck!
krilok said:
Last comment on that thread says the solution also works on Havoc Os 2.9, which is based on Pie... Maybe that person wasn't encrypted to begin with, but, if it doesn't work for you, I guess then the only way to go is a full reset... Good luck!
Click to expand...
Click to collapse
Yep, I saw that post ... I relly don't have any more ideas. Should be inside "mount modul" in TWRP /data listed?
I only have System, Cache and SD ... and i can check System only if i check bottom "mount system partition read-only" option.
But that's nothing to do with /data.
akulp said:
Yep, I saw that post ... I relly don't have any more ideas. Should be inside "mount modul" in TWRP /data listed?
I only have System, Cache and SD ... and i can check System only if i check bottom "mount system partition read-only" option.
But that's nothing to do with /data.
Click to expand...
Click to collapse
Data option should show. At least it does on mine... You can maybe try updating Twrp version?
I'm on last TWRP.... Meantime I already made full reset ....
If you have encrypted data partition, you're pretty much banned from messing with it, unless you manage to exploit your way through the adb, which requires you to have it enabled and in trust relation with your PC to begin with.
The way I'd go around this is to place an "always yes su" binary and perform pattern removal process through init.d or similar solution. In case if su commands are restricted, kernel with permissive SELinux needs to be flashed.
On a side note, isn't this Q&A?
I also had a problem with data folder not being mounted when booting to TWRP. I tried a full reset and immediately i have access to the Data folder (but theres nothing left inside so this is kinda useless). Then later when i did a reboot into the TWRP it happened again, couldnt access to anything even when the "mount Data" option is ticked, only until i did the full reset again that it could finally work.
It turned out the problem is with the TWRP itself, i flashed another custom recovery (OrangeFox-R10-Stable-h870, which is btw a better recovery than TWRP in my opinion) and the problem never occurred again.
So either try out that new Recovery or a different version of TWRP and see if it solves the problem. And always, ALWAYS, make a full backup of all your data before messing with anything (i had to learn that the hard way so trust me).
Do this,
- you should know that I am using "orange fox recovery" not "twrp",and stock "pie"
- reboot to recovery and go to system/data
- delete this files:
gatekeeper.password.key
gatekeeper.pattern.key
locksettings.db
-reboot the phone and that's it.

Categories

Resources