Suicide-Squirrel / issues_pie

LG G4 stuff has been completely moved here: https://github.com/LGgFour
8 stars 0 forks source link

Unable to encrypt h811 #58

Closed crystalcommunication closed 2 years ago

crystalcommunication commented 3 years ago

I've installed LineageOS 16 on my T-Mobile LG G4 (h811) with the hopes of collecting all my old phones, updating them to somewhat recent versions of Android, and getting them all encrypted so they can be used as secure MP3 players or unlocked phones. I managed to get a recent version of TWRP, flash the OS, and successfully got it rooted with Magisk. The problems arose when I rebooted and attempted to encrypt the phone.

I went into Settings > Security & location > Encryption & credentials > Encrypt phone, then I plugged my phone into the wall and followed the prompts to confirm the encryption process. The phone proceeded to the usual gear Android encryption screen for a few seconds before the screen turned black for about 15 seconds, then I was returned to the lock screen, as if SystemUI had been restarted (and obviously my phone was not encrypted).

The first thing I thought was that Magisk was screwing things up somehow, so I carefully followed all steps in FAQ #2, including the factory reset and formatting data, and this time I didn't flash Magisk, so I currently have no root, then tried encrypting my phone again. Same thing happened.

So I connected my phone to a computer, enabled USB debugging, and fired up logcat. The output of logcat was spewing things way too quickly for me to read and find anything useful (and there was no output at all when I filtered it to only fatal messages), so I tried adb logcat *:E | grep Cryptfs, and I believe I've found the culprit here.

06-08 11:36:03.922   382  3294 E Cryptfs : Bad magic for real block device /dev/block/bootdevice/by-name/encrypt
06-08 11:36:03.924   382  3294 E Cryptfs : Cannot open block device /dev/block/bootdevice/by-name/userdata
06-08 11:36:05.911   382  3294 E Cryptfs : Bad magic for real block device /dev/block/bootdevice/by-name/encrypt
06-08 11:36:05.911   382  3294 E Cryptfs : Cannot open block device /dev/block/bootdevice/by-name/userdata

The zip I flashed was lineage-16.0-20210608-UNOFFICIAL-h811.zip. Any idea what could be causing this?

steadfasterX commented 3 years ago

The first thing which you should do is a factory reset in TWRP . For this you HAVE TO use the latest preview build from my leech server. Obviously you will loose all settings and apps so do a backup if needed.

If that does not solve your issue open the wipe menu in TWRP and choose to FORMAT the data partition . Obviously this will wipe any user data including pics etc from your phone .

If that does not help :

  1. Try the encrypt
  2. Share the debug logs as written in the XDA faq from /cache
crystalcommunication commented 3 years ago

As I stated previously, I did try formatting data and not rooting my phone, the TWRP I've been using for everything is twrp-3.5.2_9-PREVIEW-270_g4.img, from your leech server. I do not currently have access to the phone, I'll retrieve it and try the things listed in the FAQ #1 as soon as possible.

steadfasterX commented 3 years ago

As I stated previously, I did try formatting data and not rooting my phone, the TWRP I've been using for everything is twrp-3.5.2_9-PREVIEW-270_g4.img, from your leech server. I do not currently have access to the phone, I'll retrieve it and try the things listed in the FAQ #1 as soon as possible.

Formatting data is the second step. First one is a factory reset in TWRP as a special partition gets wiped then only. The FAQ listing the needed debug files is FAQ 7 btw.

So :

  1. When encrypting start a logcat as in FAQ 1
  2. When it bootloops after that grab the logs from FAQ 7
crystalcommunication commented 3 years ago

I did the factory reset and then formatted data, I remember thinking it should be working because I saw TWRP say it was wiping the special encryption partition. Sorry, I somehow misread which debug log you wanted.

steadfasterX commented 3 years ago

I did the factory reset and then formatted data, I remember thinking it should be working because I saw TWRP say it was wiping the special encryption partition. Sorry, I somehow misread which debug log you wanted.

np . I need both FAQ logs. so before pressing encrypt button follow the FAQ 1 and then on boot (loop) FAQ 7

crystalcommunication commented 3 years ago

Quick update: I finally got access to my device again. While I was going through and attempting to collect the logs, I decided to try encrypting again with SELinux set to permissive before I started the process. That caused my phone to start bootlooping (or, more accurately, the LineageOS splash screen shows forever), which it was not doing before.

https://fs.cryxtal.org/s/KwFWNrB6pRLaofF

In this folder I have placed the debug logs from FAQ 7 while the phone was bootlooping; I prefixed those files with BOOTLOOP_. I did not include the crash log because it was empty, and the kernel log file appears to be corrupted at the end, I assume that happened when I yanked my battery out so I could boot to recovery mode.

Once I get my phone booting again I will get a logcat and the debug logs from when I click Encrypt phone with SELinux set to enforcing, and I'll upload them to the same shared folder. If you'd like any more logs, just let me know and I'll collect them and upload them to that folder.

Update: I have uploaded the boot logs and logcat mentioned above, those ones have no prefix. Note that after failing the encryption, the phone still boots normally, just without encryption enabled, so those boot logs are from a normal boot. I followed the steps in option B of the "Providing a good logcat" guide, clearing the logs before I opened the Settings app, and dumping the logcat to a file after being returned to the home screen.

steadfasterX commented 3 years ago

thx for the update. first of all I would prefer having the logs attached here. if your server goes down or explode those are lost and it is 1 click more for me to download ;) other then that: it seems you had set selinux to permissive manually but the only way to exclude selinux is running the kernel in permissive mode even on boot. for this you could use the bootimg tool within mAid or any other linux and just edit the cmdline to set it to permissive. I see several denials which are related to setting the BT address so maybe it hang here or later.

crystalcommunication commented 3 years ago

I did change SELinux to permissive manually. I knew my changes wouldn't persist but I figured it was worth a shot to see if something different happened. Is the bootimg tool included with mAid? Most of my machines are running various versions of Debian. I used my Nextcloud instance because I wasn't sure if the logs contained any identifiable information and I don't exactly trust Microsoft. I'll upload them directly to GitHub next time, it's not like I'm daily driving this phone.

steadfasterX commented 3 years ago

yes as said bootimgtool is included in mAid but you can install it on your fav distro as well ofc.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 2 years ago

Closed due to inactivity. Feel free to re-open at any time and ensure you provide all requested information/logs.