yashsingh1/xdaforums huggingface dataset:
[G4 Android Development] Leg0V0geL:
Thanks, it worked only had to adjust my patch script a bit.

If someone wants it, here it is:

#!/usr/bin/bash

command -v abootimg > /dev/null 2>&1 || { echo "You have to install 'abootimg' in order to use this script."; exit 1; }
command -v unzip > /dev/null 2>&1 || { echo "You have to install 'unzip' in order to use this script."; exit 1; }
command -v zip > /dev/null 2>&1 || { echo "You have to install 'zip' in order to use this script."; exit 1; }

input_file_path="$1"
if [ -f "$input_file_path" ]; then
input_file_name="$(basename "$input_file_path")"
working_dir="$(dirname "$input_file_path")"
extension="${input_file_name##*.}"
else
echo "No input file found."
exit 1
fi

patch_img() {
img_path="$1"

cmdline=$(abootimg -i "$img_path" | grep "cmdline" | cut -d " " -f 4-)

echo -e "\e[1mOriginal cmdline:\e[0m"
echo $cmdline

cmdline="${cmdline//"maxcpus="[0-9]/""}"
cmdline="${cmdline//"maxcpus"/""}"
cmdline="${cmdline//"boot_cpus="[0-9]"-"[0-9]/""}"
cmdline="${cmdline//" "/" "}"

four_cores="maxcpus=4 boot_cpus=0-3"
new_cmdline="$four_cores $cmdline"

echo -e "\n\e[1mNew cmdline:\e[0m"
echo $new_cmdline

abootimg -u "$img_path" -c "cmdline = $new_cmdline" > /dev/null

cmdline=$(abootimg -i "$img_path" | grep "cmdline" | cut -d " " -f 4-)

if [ "$new_cmdline" == "$cmdline" ]; then
echo "Successfull"
else
echo "Failed"
fi
}

patch_zip() {
echo "extracting boot.img ..."
unzip "$1" boot.img -d "$2" > /dev/null

patch_img "${2}/boot.img"

echo "repacking boot.img ..."
cd "$2"
zip "$3" "boot.img" > /dev/null
rm "boot.img"
}

if [ "zip" == "$extension" ]; then
echo "Zip archive found."
patch_zip $input_file_path $working_dir $input_file_name

elif [ "img" == "$extension" ]; then
echo "Image file found."
patch_img "$input_file_path"
else
echo "No feasible file type found."
exit 1
fi
[G4 Android Development] steadfasterX:
New Official release

twrp-3.3.1-1

Release date: 2019-07-18

Download: https://twrp.me

Device Tree changelog: while the version seems to be minor this is a

MAJOR

change: I switched from Android-6.0 to Android-8.1, removing 5.1 support

Summary

changelog:

Official TWRP now supports Oreo by default (decrypt, correct time)

This removes support for Lollipop bootloader stack - thats why the image size is almost just the half.

If you are still using an Lollipop / 5.1 bootloader stack (wth..?!) UPGRADE it - or 3.3.1-0 is the last supported for yours. You can always check the PREVIEW flavor for MM which is backwards compatible but do not expect any official builds for LP anymore.

you REALLY wanna now what else has changed?

it is way too much but here check it out and see what you have missed from not using a PREVIEW flavor .... ;)

.-
[G4 Android Development] fi5z.x9:
Please is this the file https://twrp.me/guacamoleb/twrp-installer-3.3.1-1-guacamoleb.zip ?

Keep getting the "404 Page not Found" error. Can't seem to download it. Thanks.
[G4 Android Development] steadfasterX:
1) I'm not the owner of the twrp.me website. Contact the TWRP website owners for TWRP website issues.

2) The file you're trying to download has nothing to do with the LG g4.

3) It you have the g4: type the correct (!) model in the search box as you're not trying to download the LG g4 TWRP !!

4) If you do *not* have the g4 but another phone: this thread is for the g4 only. Find the correct thread for your device.
[G4 Android Development] fi5z.x9:
Thanks [MENTION=5545101]steadfasterX[/MENTION] for the tip. I've downloaded it.
[G4 Android Development] kinuris:
Hello.

H815 Usu'd, Lineage 16 last release, TWRP 3.1.1-200 P

Wrong date and time in TWRP. When I make a backup the date written is 2015 and wrong day and month. Maybe I'm missing something?
[G4 Android Development] steadfasterX:
Yes you miss something .. What should I do without a log? Read the faq..

Also keep in mind that you HAVE to boot once to the ROM a a set the time there correctly .
[G4 Android Development] kinuris:
What I really miss was the FAQ. Sorry.

Here it is, I think.

https://bpaste.net/show/o6k7
[G4 Android Development] polfrank:
Hey, I have also the same problem. The time has always been wrong in twrp, even after selecting the correct time region. It is strange that the minutes are also un-synced. There is an option to set the offset (+/- minutes) but I think it should be correct without touching this. I have rebooted back and forth several times but it's still the same. I will try to get a log tomorrow, but how should I do this? Just start and stop a log while being already In twrp?

Using twrp pie 200, with latest los16, on an h815.
[G4 Android Development] kinuris:
Hi. The FAQ with instructions is in 3rd post after the change logs. You can get a log in TWRP, advanced, copy log button, and then use pastebin.
[G4 Android Development] steadfasterX:
thx for the log. ok pls re-do the same but with the TIMEDEBUG1 build: http://leech.binbash.it:8008/TWRP/P/

I will very likely fix nothing but produces much more log output.

.-
[G4 Android Development] kinuris:
I've done it on the go. Hope it is OK

https://bpaste.net/show/u3br

And checking "kernel logs"

https://bpaste.net/show/-lOX

Thank you!
[G4 Android Development] steadfasterX:
ok thx got it.. I have fixed that particular issue already but its not in any pie build yet. Before I can release that fix I need to finish decrypt for Pie.

decrypt works fine in pie btw (in my unreleased build) but.. well .. you cannot decrypt with Android / so cannot boot anymore afterwards.. :p

So I guess I need to fix that tiny little unimportant first ;)

anyways thx for your report and I will post here when there is a fix released.

.-
[G4 Android Development] steadfasterX:
New PREVIEW releases

read more about PREVIEWS and the <flavor>'s in the OP (what they are and

when to use

)!

twrp-3.3.1-PREVIEW-207_g4 for O, P and datamedia

Release date: 2019-08-22

Status:

without

data/media patch*: considered to be STABLE (exception:

P

which is in BETA)

including

data/media patch*: UNSTABLE (known issues for backup & restore)

TWRP sources changelogs:

without data/media patch

including data/media patch

Kernel: github-changelog (preview builds compile the kernel on build automatically (official not - yet) - so the kernel differ between official and preview)

Device Tree changelogs:

P flavor

O flavor

N flavor

MM flavor

Summary changelog (read the linked changelogs above for ALL changes):

fix in O, P, datamedia flavors: kernel panic in rare cases due to a memory leak in the pstore implementation (commit)

Download:

without

data/media backup/restore: sfX leech server (compatible with all G4 models and containing all flavors)

including

data/media backup/restore: sfX leech server (read the notes)

*Notes:

Since build #191 I split regular TWRP builds:

without

my data/media patch and those

including

my experimental data/media patch - as it turns out it is not as production ready as thought.

The data/media version can be found from now on here only: http://leech.binbash.rocks:8008/TWRP/datamedia/ and it is always based on Android Pie (almost identical to the P flavor - just with the datamedia patch on top). It will also lack behind as the TWRP sources need to be manually included from upstream and I do that rarely only.

The new and

high experimental

feature to backup data/media (so your internal storage) is a WIP (work in progress) but I would love to hear your feedback of the current implementation and the current known issues.

If you encounter any issue check the known issues first and if it is not listed share the recovery.log or even better open a new issue there.

.-
[G4 Android Development] sdembiske:
twrp-3.3.1-PREVIEW-207_g4 for P giving wrong back up date (& time), e.g. backup done today:

2015-01-01--22-11-38_lineage_h812_usu-userdebug_9_PQ3A190801002

twrp-3.3.1-PREVIEW-207_g4 for O gives the correct back up date, e.g., back up done yesterday: 2019-08-23--06-25-01_lineage_h812_usu-userdebug_810_OPM718120500

Time and dates are correct in rom and time is set correctly in TWRP settings ...
[G4 Android Development] steadfasterX:
Time in pie will be addressed asap. Once decrypt is fully working (it works already but you can't boot Android afterwards but who needs that lol) then time will work as well.

Pie TWRP is still kind of beta that's why oreo is official and not pie. Once I fixed all pie things the official will be based on pie as well .
[G4 Android Development] hamed_forum:
tanks hard work
[G4 Android Development] bestouff:
Hi,

TWRP can't decrypt my data partition on my H815. I tried latest official (3.3.1) and dev (3.3.1-preview-207_g4_p), as well as some previous versions, they don't work. But I still can install LOS or TWRP itself.

I even tried a full wipe and recreating an encrypted data partition (LOS 16), no sugar.

dmesg: https://paste.omnirom.org/view/191881da

Any hint ?
[G4 Android Development] hteles:
It's not ready yet for Pie.
[G4 Android Development] bestouff:
Ok, but it already didn't work in 15.1, 15.0, 14.1 ...
[G4 Android Development] steadfasterX:
it works in N and O for sure. just pie isn't working.

.-
[G4 Android Development] bestouff:
For sure it didn't for me. But now I've updated LOS to 16 so I can't deliver a log anymore.
[G4 Android Development] steadfasterX:
then you haven't used the correct preview flavor.

Only O will work with official twrp.

EDIT: btw: dmesg is fine but useless without recovery log...

.-
[G4 Android Development] bestouff:
Yes I didn't realize there was 1 matching TWRP per LOS release. Sorry for the noise.
[G4 Android Development] sdembiske:
Re: FAQ # 8: "Why are some builds about ~50% smaller then other versions of twrp for these devices?"

Could you please direct me to a commit or article where the compression issue is addressed. The reason I ask is that I have compiled a TWRP image (12.5 MB) but when I tried to flash it in TWRP, it indicated the image size is too large for the target device.

Not sure if it's a compression issue or whether the phone's recovery partition needs to be enlarged to handle the image. If the latter is the case, does the enlargement have to come at the expense of a partition reduction elsewhere? I have the correct adjusted size for the image already in my BoardConfig.mk file but it doesn't seem to make a difference when trying to install it.

Appreciate any input you can provide.

Thank you,

S.
[G4 Android Development] steadfasterX:
Well . You try to build TWRP. For which device ? What is the partition size on that device ?

Where is the repo your using ?

Full error messages ?

...
[G4 Android Development] sdembiske:
Building for Moto G LTE XT1040 running LineageOS 16.0. (I know it's not LG G4 but also know that you have done a little work on this on behalf of of your other Suicide Squirrel Team member, ThePiGuy0 and helped him with his port to the same device. I hoped you might provide some direction here as you don't like to be PM'ed but if it's a problem and you want to move it elsewhere, let me know).

Device recovery partition size is 10 MB according to the TWRP log vs recovery image size of 12.5 MB as mentioned. So must either compress image size further or increase phone recovery partition size, hence my original posted question.

This is the repo I've been working with: https://gist.github.com/sdembis/aefe1ae4ab28bc1deb3d266c60efdbf1

(forked from ThePiGuy0's GitHub account).

TWRP Recovery Log: https://gist.github.com/sdembis/98b9ce7d938c419fe0958005ffbf2ab6

Kernel log: https://gist.github.com/sdembis/aefe1ae4ab28bc1deb3d266c60efdbf1

Thanks again,

S.
[G4 Android Development] steadfasterX:
well there are several things coming in my mind:

1) Why not asking [MENTION=8699949]ThePiGuy[/MENTION] ? It is his repo and a kind person ;) I do not own that device which makes it harder then it could be

2) According to the board config the recovery partition is 16.7 MB but the message you get is (iirc) the EXTRACTED size of the ramdisk

3) as you mentioned it already this is def the wrong place for a discussion about that. a Telegram group is best for that these days.. just create one and invite me and ThePiGuy for example

My first steps would be to identify if the recovery partition size is correct (for this you need to boot into the ROM and check it there) and and if needed to reduce twrp I would start with excluding SuperSu, NTFS support and the TWRP app itself (needs a patch though)

PS: pls use meaningful commit messages in the future !!! ;)

.-
[G4 Android Development] steadfasterX:
New PREVIEW releases

read more about PREVIEWS and the <flavor>'s in the OP (what they are and

when to use

)!

twrp-3.3.1-PREVIEW-211_g4 for N, O, P and datamedia

Release date: 2020-02-28

Status:

merged current state of the O flavor to

OFFICIAL

twrp - expect a new

official

build soon!

without

data/media patch*: considered to be STABLE (exception:

P

which is in

BETA

but only bc decryption does not work here)

including

data/media patch*: UNSTABLE (known issues for backup & restore)

Summary changelog (read the linked changelogs above for ALL changes):

fix in N, O, P, datamedia flavors: many stuff around TIME (must be the 20th time that I fixed time..). NOTE: for all builds by [MENTION=4956374]aoleary[/MENTION] wait for his next ROM builds. They include missed libs which then will make the time working in TWRP again on those (e.g. havoc, aosip)

fix in P flavor: half-implemented encryption might had caused issues with unmounting/mounting system partition

fix in N flavor where TWRP was delivered with an old prebuilt kernel (now fresh created on build)

fix in N, O, P, datamedia flavors to impove UI speed

fix in N, O, P, datamedia flavors: exclude TWRP app

fix in N, O, P, datamedia flavors: screen timeout has been removed (as this can cause issues where the device might not wake up)

fix in N, O, P, datamedia flavors: increased default brightness to 78 %

TWRP sources changelogs:

without data/media patch

including data/media patch

Flavor specific changelogs:

Device tree: P flavor

Kernel: P flavor

Device tree:O flavor - current state will become the next official (already merged, waiting for build)

Kernel: O flavor

Device tree:N flavor

Kernel: N flavor

MM flavor has reached its

END OF LIFE

Download:

without

data/media backup/restore: sfX leech server (compatible with all G4 models and containing all flavors)

including

data/media backup/restore: sfX leech server (read the notes)

*Notes:

Since build #191 I split regular TWRP builds:

without

my data/media patch and those

including

my experimental data/media patch - as it turns out it is not as production ready as thought.

The data/media version can be found from now on here only: http://leech.binbash.rocks:8008/TWRP/datamedia/ and it is always based on Android Pie (almost identical to the P flavor - just with the datamedia patch on top). It will also lack behind as the TWRP sources need to be manually included from upstream and I do that rarely only.

The new and

high experimental

feature to backup data/media (so your internal storage) is a WIP (work in progress) but I would love to hear your feedback of the current implementation and the current known issues.

If you encounter any issue check the known issues first and if it is not listed share the recovery.log or even better open a new issue there.

.-
[G4 Android Development] masemoel:
Time finally works on AOSiP with the latest preview (213).
[G4 Android Development] waterblue85:
I'm pretty sure that mounting microsd card in 3.3.1-preview-211_g4_N TWRP is broken.

Please fix it.

Second, I'm not sure if /system error occurring during installing ROMs due to my operating faults or not.

Thank you [MENTION=5545101]steadfasterX[/MENTION]

I'm apologizing for no log file attached 'cause I flash to 196_N too fast lul.
[G4 Android Development] steadfasterX:
As said in the chat already: read the faq and share the logs as described in 4a and 4b. Other then that microsd is working perfectly fine here. How do you formatted your sdcard ? Which file system?
[G4 Android Development] waterblue85:
I'm using vFAT, formatted by TWRP-213-O or windows, i'm not sure.

But right no i'm using TWRP-196-N and everything works right and i'm happy to use it.
[G4 Android Development] steadfasterX:
Well ok. Up to you.
[G4 Android Development] waterblue85:
I remember i used Diskgenius to format my sd card.

Maybe I'll try v213-N again, and I'll give you the log file.
[G4 Android Development] mkrts:
can i try dd install method on locked bootloader?

dd if=/sdcard/twrp.img of=/dev/block/bootdevice/by-name/recovery
[G4 Android Development] steadfasterX:
Uhm bro locked means locked. Unlock first.
[G4 Android Development] mkrts:
sir there is a method you presumably know

1- go download mode

2- dd if=/dev/block/mmcblk0 bs=8192 skip=55296 count=529920 of=/data/media/0/system.img 'take system image

3- inject supersu on Lınux OS to system image

4- dd if=/data/media/0/rootedsystem.img bs=8192 seek=55296 count=529920 of=/dev/block/mmcblk0 'take rooted system image to phone in download mode

with this method i had rooted my h815tr on locked bootloader

so i had asked may be recovery installation works ?

so another question --> we can take and inject system image but cant inject recovery image (you say we cant inject recovery)

why we cant inject recovery image :confused:

i just wonder

i am not dev like you

thank you in advance
[G4 Android Development] polfrank:
Because the locked bootloader is going to recognise the custom recovery and as a result won't let you boot it. I don't know if it is going to let you boot the system at all in this case.

The method you refer to for rooting is an old method that worked only in Android 5, I think.
[G4 Android Development] steadfasterX:
Exactly like that. TWRP in FisH exists for these devices but no way to boot a custom ROM. Thats why UsU exists.
[G4 Android Development] cooledi:
Hi SFX, I have encountered an error when restoring from twrp, apparently it just give erorr on data partition only; extractTarFork() process ended with ERROR: 255

I'm using the latest TWRP 3.3.1-0, thanks.
[G4 Android Development] steadfasterX:
no recovery log no help.

official is outdated (usually) and PREVIEW builds have to be used when you are not on an OREO based ROM anyways.

.-
[G4 Android Development] cooledi:
ok, I've just update preview build, same error... logs are below;:good:

https://justpaste.it/6yvnt recovery log

https://justpaste.it/1zqgf kernel log
[G4 Android Development] steadfasterX:
thx. what is your current installed ROM and ROM version?

.-
[G4 Android Development] cooledi:
Right, AOSiP 9.0 UsU'ed F500.

** solved ** I've just flashed Sky Hawk Recovery 2.2 and it just restored the data partition perfectly!:highfive:
[G4 Android Development] bonbonboy:
Hi there!

I'm facing a weird issue. I wanted to update (bootloader, recovery, rom etc...) my device (H815) i didn't touch from years. Currently it's unlocked (officially), rooted and under dirty unicorns 7.1.2.

So first of all, the recovery:

I tried to flash it via the TWRP official app, with adb commands ("fastboot boot twrp.img" or "fastboot flash recovery twrp.img") or with the buttons combo (to the double LG screen asking to wipe your device): results, every time my device boots to the LG logo, then reboots and boots my rom normally. Impossible to reach the recovery.

Any idea or clue please?

[SOLVED] The lastest twrp-3.3.1-2-g4.img i downloaded on official twrp website was maybe too recent compared to my previous recovery and bootloader. I downloaded the 3.1.1-0-g4.img and booted on it, and it was ok! Then i could flash the last twrp (with bootloader stack on MM 20p or higher from steadfasterX).
[G4 Android Development] steadfasterX:
Latest Official release

twrp-3.4.0-0

Release date: 2020-06-22

Compatibility:

OREO

(all other versions should work for flashing but enc, time and any adb commands will work with

OREO

only)

Download: https://twrp.me

Device Tree changelog: no changes

Summary

changelog:

TWRP release notes

New PREVIEW releases

read more about PREVIEWS and the <flavor>'s in the OP (what they are and

when to use

)!

twrp-3.4.0-PREVIEW-224_g4 for N, O, P and datamedia

Release date: 2020-07-05

Status:

without

data/media patch*: considered to be STABLE (exception:

P

which is in

BETA

but only bc decryption does not work here)

including

data/media patch*: UNSTABLE (known issues for backup & restore) (note: datamedia builds have been paused until further notice)

Summary changelog (read the linked changelogs above for ALL changes):

TWRP release notes

TWRP sources changelogs:

without data/media patch

including data/media patch (note: datamedia builds have been paused until further notice)

Flavor specific changelogs:

Device tree: P flavor

Kernel: P flavor

Device tree:O flavor

Kernel: O flavor

Device tree:N flavor

Kernel: N flavor

MM flavor has reached its

END OF LIFE

Download:

without

data/media backup/restore: sfX leech server (compatible with all G4 models and containing all flavors)

including

data/media backup/restore: sfX leech server (note: datamedia builds have been paused until further notice)

*Notes:

Since build #191 I split regular TWRP builds:

without

my data/media patch and those

including

my experimental data/media patch - as it turns out it is not as production ready as thought.

The data/media version can be found from now on here only: http://leech.binbash.rocks:8008/TWRP/datamedia/ and it is always based on Android Pie (almost identical to the P flavor - just with the datamedia patch on top). It will also lack behind as the TWRP sources need to be manually included from upstream and I do that rarely only.

The new and

high experimental

feature to backup data/media (so your internal storage) is a WIP (work in progress) but I would love to hear your feedback of the current implementation and the current known issues.

If you encounter any issue check the known issues first and if it is not listed share the recovery.log or even better open a new issue there.

.-
[G4 Android Development] stezo2k:
Phew! Glad I found this thread and actually looked at the release notes

I was struggling to install a Pie ROM to no avail, none of them would work and was coming up with error E1001. Have sorted it by downgrading to 3.31

Keep up the good work
[G4 Android Development] steadfasterX:
you really should ensure you are using the latest Bootloader stack and switch to the preview release which you should do anyways when using pie.
[G4 Android Development] Feduz:
Hi! I'm try to using

Method 2) fastboot

I'm able to go into fastboot mode, but when I want to go into recovery, it say me "waiting for device". What can I do? H815 with MM. I think that I have all the drivers

I've latest twrp downloaded, maybe is this the problem? which I have to use? thanks
[G4 Android Development] steadfasterX:
boot FWUL or a mAid nightly from an USB stick: http://maid.binbash.rocks (click at "nightly" at the top to download) and here is the thread explaining how to get started (mAid is the new name of FWUL): https://xdaforums.com/android/software-hacking/live-iso-adb-fastboot-driver-issues-t3526755

.-
[G4 Android Development] Feduz:
thanks, i will try! for the twrp, which i have to use with MM?
[G4 Android Development] steadfasterX:
I would say the (PREVIEW) MM one ?! :laugh:

.,