[G4 Android Development] steadfasterX:
FAQ

Frequently Asked Questions (FAQ)

What's the meaning of decryption in terms of TWRP?

When you enable full device encryption in your favorite ROM or using stock without modification then your data partition is encrypted. That means no one can access your data when you shutdown your phone.

So in twrp you will see the data partition as a big 32gb unreadable partition even if 3GB are in use when you booted (and therefore decrypted) your ROM.

You CAN still backup that data partition but it will backup the whole 32GB because of encryption.

With this twrp version when started you will be asked for the decryption password and your data partition is readable as in the ROM. When you backup now the data partition it just backups the data in use so 3 GB instead of 32GB.

Regarding any pros of not using full disk encryption in your ROM I can say it does not really matters in performance in all normal cases. You will always read that disabling decryption will give you much more power and so on but the today's spec of phones are so good you will feel a slightly diff only. Ok some users still believe that this is minimal diff is what they need but to be honest: The ONLY way to find an answer for yourself is testing on your own using the SAME ROM and same version! One time with encryption once without. Use the exact same ROM and use the exact same configuration like governors, custom kernels etc.

On the other hand you will get a minimum of security if you enable encryption but give access to everyone finding your lost phone if

not

!

So it's up to you if you want this risk for a minimum on performance improvement.

And just for sure:

decrypting in twrp is not permanent! Your data gets just decrypted for backing up nothing more nothing less.

[*]

You talked about using IRC to get support. What is this and how can I use that?

Note: check the support topic as from now on there is also a Telegram group for that available.

Meaning of IRC => Internet Relay Chat. A very good IRC client is this one here: hexchat <-- download it and read the quick intro to get started: Quick-Start

--> when asked if you want to join a channel type in "#twrp" and after connected you will be in.

If you do not want to install anything you can simply use the webchat instead directly over here: Webchat

Howto communicate? IRC means many people talking the same time and there are some goods and bads to know about using IRC.

So please read this mini and very quick overview (especially the good manners there): Good manners in IRC (matches for all OS not for fedora only)

[*]

What is that "adb" thing??

adb stands for: Android Debug Bridge and can help a lot when it comes to work with your device. It is not for developers only but they use it a lot of course.

But a normal user can use this to exchange files without the need of mounting, backing up the device, reboot the device and use it as a very comfortable way of having a terminal emulator.

I highly recommend to use FWUL to connect your device. Not for TWRP only but also for anything else adb/fastboot related.

What Logfiles have to be provided and how?

Two options are available:

Option A is the

absolute

minimum when reporting an error and it can be done by every user without installing anything or any special skills!! Reports without this minimal requirement will be

ignored

!

Option B is also very simple but you need to install ADB if not installed already. The steps are very easy and there is an easy installer available.

Keep in mind that if you have a problem and want that to be solved the more you can tell and the more you can provide the better it is. So choose your option wisely....

A) The absolute MINIMUM: recovery.log:

Start in TWRP and connect an USB cable to your device

Menu: Advanced

Menu: Copy Log

Click Home button and go to Menu: Mount

Ensure MTP is enabled (button at the bottom)

Open the file explorer on your PC and go to Sdcard

open the file "recovery.log" in a text editor (windows users: Wordpad)

copy the whole content and paste it on http://bpaste.net (choose a long duration in the drop down).

After you pasted your log there a LINK WILL BE GENERATED!!! I NEED THAT URL !!!

.

Here are 2 screenshots which should guide you in this:

paste the log file:

View attachment 4512130

copy URL:

View attachment 4512131

Report the link of that paste URL by PM or in this thread

Besides the above tell me:

ROM name or say "STOCK"

ROM version ("LL" or "MM" - if you can tell me the build number as well)

Encrypted device or not

B) But for THE BEST SUPPORT

provide not recovery.log only but also dmesg by executing the following cmds on your PC:

Start in TWRP and connect an USB cable to your device. Then on your PC (requires ADB installed! Check FAQ #3 of this post!!):

adb shell

dmesg > /tmp/dmesg.txt

OPTIONAL (only when requested by me): logcat -d -b all > /tmp/logcat.txt

OPTIONAL (only when requested by me): adb pull /tmp/logcat.txt

OPTIONAL (only when requested by me): cat /proc/last_kmsg > /tmp/kmsg.txt

exit

adb pull /tmp/recovery.log

adb pull /tmp/dmesg.txt

OPTIONAL (only when requested by me): adb pull /tmp/kmsg.txt

Open all logs one by one with a text editor like wordpad or similar and paste it here: http://paste.omnirom.org (do

NOT

paste all in one! Every single log should have a single paste URL)

If the logfile(s) are too big to get them uploaded on paste.omnirom.org use something like gists.github.com if you have a github account or zip it and upload it at www.filedropper.com

Report the link of that paste URLs by PM or in this thread

Besides the above tell me:

ROM name or say "STOCK"

ROM version ("LL" or "MM" - if you can tell me the build number as well)

Encrypted device or not

[*]

What is required to get support?

Get IRC running (see FAQ 2)

Get adb running (see FAQ 3)

Collect logs (see FAQ 4)

Go to IRC and paste your problem together with the paste URLs you done before

If you can't see me on twrp or if there are any reasons why you may not get IRC running (serious? even not the webchat??!) answer to this thread and paste your URLs here

[*]

Why is the time wrong in TWRP?

most important: use the

latest

TWRP (atm of writing it has to be the latest BETA 3.1.1 sfx-14). This has been fixed several times on our journey for different ROMs and their versions and should work for STOCK (up to N) and on any custom ROM now very well.

if you still encounter issues: set the time zone correctly in TWRP once. then reboot into TWRP and it should be still the correct time

if you still encounter issues: scroll up to FAQ #4 A) and pull the recovery log and attach it to your post.

For reference here the previous explanations (when using the latest TWRP no actions are required anymore!! even when switching between STOCK and custom ROMS !)

Before

CM12.1:

Time setting was handled with the proprietary qcom time_daemon which was responsible to save a time offset of the qcom RTC (Real Time Clock). This time_daemon gets the time from the RTC and save the offset to the current "real" system time in either /data/time or /data/system/time. That means it SHOULD work out of the box for you but as you're reading this it may not.

Since

CM12.1 and newer:

The proprietary time_daemon was completely replaced with an open-source alternative provided by sony: "timekeep".

The main principal is the same: the time gets read from the RTC and then gets not written to files in the file system but instead a persistent property is written (timekeep save) each time the time or timezone changes or when Android shuts down. This property is then read at the next boot again by timekeep (timekeep restore).

The handling of timekeep is fixed since build 127 of this twrp version / official 3.0.2-1 version so it should just work for you if you have that build running (or newer).

Stock ROMs:

Stock ROMs or stock based ones like Imperium ROM uses the proprietary qcom time_daemon. That means it SHOULD work out of the box for you but as you're reading this it may not.

When you had read the above and it states it SHOULD work for you but it doesn't:

Boot into twrp:

Menu Mount: select Data to get it mounted

On your PC:

adb shell rm /data/system/time/ats_2

adb shell rm /data/time/ats_2

adb shell rm /data/property/persist.sys.timeadjust

One of the above adb cmds may fail but that doesn't matters.

Now reboot into recovery again and the time should :fingers-crossed: be fine.

If the above give you NOT the correct time:

Please follow all steps of the above FAQ #5 and additionally also give an output of the following cmd while in twrp:

adb shell mount /data

adb shell ls -la /data/time /data/system/time

[*]

Does this build supports F2FS?

Yes

[*]

Why are some builds about ~50% smaller then other versions of twrp for these devices?

TWRP builds with more than 30 MB contain an uncompressed kernel image and support both bootloader versions : MM and LL

TWRP builds with about 16 MB contain a compressed kernel image and will run with MM bootloader only. As soon as I found out that this was the reason for not booting TWRP on LL devices I reverted the compression to support both again

btw the kernel is build with UBER tool chain

so the short answer is just "compression".

[*]

Unlocking? Rooting?

official unlock (h811, h815 EUR) http://xdaforums.com/g4/general/unlock-bootloader-install-twrp-root-t3128241

unofficial unlock (any G4): https://bit.do/unlockg4

[*]

Don't trust TWRP for EFS backups? Do you want to have an independent backup of EFS? Do you wanna restore EFS without TWRP?

Consider to use the brand new backup method even for locked devices! DLM Backup

words in blue are commands you have to type on your PC

boot into TWRP

connect usb cable

adb shell

Backup

For the following 2 cmds: replace /external_sd by /sdcard if you have no external SD card. HINT: you have to decrypt /sdcard first if you enabled device encryption!

dd if=/dev/block/bootdevice/by-name/modemst1 of=/external_sd/modemst1

dd if=/dev/block/bootdevice/by-name/modemst2 of=/external_sd/modemst2

dd if=/dev/block/bootdevice/by-name/fsg of=/external_sd/fsg

dd if=/dev/block/bootdevice/by-name/misc of=/external_sd/misc

Restore

For the following 2 cmds: replace /external_sd by /sdcard if you have no external SD card. HINT: you have to decrypt /sdcard first if you enabled device encryption!

dd if=/external_sd/modemst1 of=/dev/block/bootdevice/by-name/modemst1

dd if=/external_sd/modemst2 of=/dev/block/bootdevice/by-name/modemst2

dd if=/external_sd/misc of=/dev/block/bootdevice/by-name/misc

dd if=/external_sd/fsg of=/dev/block/bootdevice/by-name/fsg

[*]

You can't unlock your screen after you encrypted your device?

First of all: this has absolutely

nothing

to do with TWRP but as I encrypt always and everything I encountered a problem after encrypting my device and I just want to share you my solution:

checkout the following tool if you have the same issue described there: http://xdaforums.com/g4/development/tool-lock-screen-fix-encrypted-devices-t3499478

[*]

How to open/start/boot into TWRP?

You have 2 options at least:

when Android is booted:

you can do "adb reboot recovery".

Besides that many custom ROMs have a special power option or just download one of the dozens apps letting you do this

via key combo:

The only valid and always working and supported way on getting with a hardware key combo(!) into twrp is using the factory reset screen.

After installing TWRP correctly, you will still have the original LG factory reset screen/menu booting before TWRP, every time. So the correct and only way to get into TWRP is to select two times "Yes" in the official LG factory reset menu, and only then you will get into TWRP (It's a restriction by LG. There is no key combo available in some / all / most LG devices to boot directly into recovery and so TWRP).

Any other key combo like vol up + power depends on the kernel of the ROM! So it may work or not. Factory reset will work always.

If you are interested on the background why the factory reset page cannot be bypassed read on here: https://xdaforums.com/g4/development/recovery-twrp-3-touch-recovery-t3442424/post72628311

For this you have to ensure that you have the latest twrp version really installed(!) because if twrp sits in recovery it will ignore the factory reset command when going through it.

Power down and pull out the battery. Do not forget to remove any USB cable.

Press power down and hold it down. Put battery back while keeping vol down pressed. Press power button and keep now both buttons pressed. When you see the LG logo the first time just release the power button for 1 second ( do not release vol down ) and then press power again and keep both pressed until you see the factory reset screen.

Once you see that screen just go through the steps like you would do a factory reset. If twrp is installed you will just open twrp without wiping any data. Again it is mandatory to have twrp installed otherwise it would really reset your device.

For the paranoid: If you want to be sure use "adb reboot recovery" when in android. When you see twrp all is fine but just do a full backup and then go through the factory reset first. ;)

[*]

What is a system IMAGE backup and why does it fail?

Using this new option is an ALTERNATIVE method to backup in opposite to the regular file based method. It is like a bit by bit backup of the COMPLETE partition which is the reason why it is much bigger as a regular backup.

So you likely will NEVER use the Image option or when you're a paranoid one only.

HINT: This method requires an ext4 or exfat partition on your external SD card otherwise image backups will fail due to the file size.

user reports success using the internal storage as target for the backup but if you do this keep in mind that you have to move that backup to your PC manually to ensure you have it by hand for the worst case.

So you may ask now why or when should I select this method? Never. So why is this option here? The main reason is TWRP in FIsH. I want to keep both device trees identical.

.