yashsingh1/xdaforums huggingface dataset:
[G4 Android Development] TheMadScientist:
Lol. So i ended up with a non rootable s6 edge att. And a non rootable sprint g5
[G4 Android Development] steadfasterX:
rofl good job ;)

ok no need to do that ls -la check anymore. I extracted a h81210o KDZ and verified that my assumption was correct. its just a symlink to app_process64.

So well i would re-write the script and adding logs to see what actually happens.

In the meanwhile:

could u pls verify that you have those files on your ROOTED ROM?

/system/etc/install-recovery_original.sh
/system/bin/app_process64_original

.
[G4 Android Development] sdembiske:
This is what I have:

/system/bin/install-recovery_original.sh

/system/bin/app_process64_original

S. = 'soft-brick'
[G4 Android Development] steadfasterX:
lol yea it now make sense Mr SoftBrick ;)

hm.. strange that it lays in bin but the injection tries to go for etc.. hm ooooh i overseen that. It handles both cases.. :p

I've made the etc one as a WARNING only now and added the bin one..

ok. so..

Time goes by and I had another ...5 mins for re-writing ;)

Its heavily improved now!

Main change is it starts by default in DEBUG mode! This will touch NOTHING. Besides that I changed many other things within..

DEBUG mode will just give ERRORS if an unexpected situation has been detected while producing a log ofc.

but It will NOT abort so it can find all problems which may occur. dont be scared ;) as long as DEBUG=1 nothing will be changed!

Pls try the attached version. As said: as long as you leave the variable DEBUG=1 nothing else then a mount and detecting will happen. So please just try this first!

A log will be generated in /external_sd/revert_root.log !

When you set DEBUG=0 it will REALLY

EXECUTE

things

but

as for now leave it at 1.

Usage:

extract the script ;)
boot TWRP
adb push revert_root_injection.sh /tmp/
adb shell "sh /tmp/revert_root_injection.sh ; cat /external_sd/revert_root.log"
paste the whole output on paste.omnirom.org or similar and provide the link to it.

I feel like this has gone completely OT now.. :p it's not your fault [MENTION=6302635]sdembiske[/MENTION] though..

sorry to all users for that noise here!

[MENTION=6302635]sdembiske[/MENTION] could you pls open another thread and link it here so we can talk there.. my fault to not start that earlier..

.
[G4 Android Development] sdembiske:
I was worried that we might be getting away from the import of your OP and I will start another thread later today and post the link to it here. Thanks again for the extra effort - it is truly appreciated. I'll give the new revert version a go probably tomorrow with DEBUG=0 (my wife is ready to put my phone where the sun don't shine on my person I think ... for the amount of attention I'm giving it of late).

Best.

S. (aka Soft-Brick)
[G4 Android Development] steadfasterX:
ok my last OT post to this:

I hope u meant DEBUG=1 !?

DEBUG=0 will destroy

DEBUG=1 just logs

so best start with as it is atm (DEBUG=1) then get the log and we will see whats goin on.

lol I understand that.. and besides that maybe in a far away future u will consider to just USE that phone (in the way it is meant for.. :p ) ..
[G4 Android Development] sdembiske:
Yes, sorry ... I did mean DEBUG=1. It's a puzzle ... that given my nature ... has to be understood at least, if not solved to see why and where the issue of not recognizing an exFAT formatted SD card arises. ReeS86 has indicated no problem with the "h" version but that version did not have the last stagefright vulnerability patch which the later version "n" did - that in and of itself didn't make sense. My fond hope is to be able to be able to use the phone as it is meant to be ... recognizing an exFAT format so that the system image backup can be done to external.

Thanks again.
[G4 Android Development] sdembiske:
Here is the link to the new thread: Reverse-engineering the LG G4 Root-Injection (hackarchive's) method ...

https://xdaforums.com/g4/general/reverse-engineering-lg-g4-root-t3628778

Thanks again.
[G4 Android Development] steadfasterX:
famous quote:

- You're not a real developer until you completely bricked the device you're working on -

(author: 2017 - steadfasterX :p )

ok.. so here we are. I bricked my device. completely. well tbh i was about to investigate the deeps of the bootloader unlock (psssshh calm down.. just started some investigations here...) so there was a high risk always and I knew that.

The good news (not for you but for those who can unlock :p ):

It is very very easy to RE-lock ANY g4 as long as you have TWRP and root. I have made a flashable ZIP for my device but its possible for any device with ease.. I have a flash-template but one needs to extract the exact KDZ files of your

current running firmware

. Even this is easy though ;) well but all this is nothing where you can think of atm right?!

So back to the start.. I have successfully re-locked my h815 - why? to learn how and whats happening when you unlock and lock.

the trick for re-locking though is very simple.. when you flash a KDZ it (the device?) will avoid flashing (or re-flash the unlock ones? or just reject?) certain partitions when a device is

locked

. those are (at least) drm, misc, persistent.

To re-lock the only thing necessary is to flash those partitions manually (or with a flashable ZIP ofc) but i can not say it is for sure only these partitions because the first and only test I made were with flashing ANY partition except system and userdata.

I can say it works good. too good in my case though.. Before I realized that I fully re-locked my device I was in the download mode via a special access (LGLaf) given me a full shell and played around as usual in the last weeks. In the meanwhile I upgraded the whole bootloader stack from LL to MM and the strange thing was that i had full access to all partitions in MM?! I mean iirc on LL when I went into download mode in that shell access I cant even read several partitions.. :confused: well so while in that mode I zeroed out the laf partition. not a good idea at all.. why? I read some guides about that this would enable fastboot on some devices and I just wanted to try it out.

yes and to complete the trouble I had to say that I tampered the boot image as well...

and now?

- every boot says Secure Boot Error and bootloops after a sec

- No Download mode bc I nuked laf

- No fastboot mode bc LG has no key combo to get in

- No recovery mode bc of the same secure boot error

- It gets not detected by the PC with nothing - yes even no QL 9008 or something - its just bootlooping too fast for anything tbh

- and no this is not the ILAPO! its a self designed bootloop tbh.

So in fact an unusable device.

What next?

There is a guide which forces the 9008 boot mode http://www.gsmmarhaba.com/threads/unbrick-lg-g4-brick-hs-usb-qdloader-9008-without-box.612/ but I do not want to open the device as long as I have warranty.

I contacted LG and I hope to get it fixed - The current waiting time is 14 days though...

.
[G4 Android Development] raptorddd:
h811 can be relocked with relock command. ;)
[G4 Android Development] BIG_BADASS:
Progress is painfully slow with efidroid
[G4 Android Development] skdubg:
useless post [emoji35]

code yourself
[G4 Android Development] BIG_BADASS:
I don't code. I test code. Think of me as part debugger part quality assurance / quality control.
[G4 Android Development] Minto107:
What?? That's interesting... With 1 command? Why H815 can't do that? ???
[G4 Android Development] steadfasterX:
the question is what happens behind the scenes when using this command?!

I mean..

it would be very interesting to have a partition dump (at least for drm, persistent and misc but much much better would be any partition excluding system and userdata ofc)

before

using that command and

afterwards

..

.
[G4 Android Development] Newbie-g4:
I read it all. Even repeated warnings. There is amazing work here. All of this work and i can't even know how to thank something like this big. Open for community. I won't gonna use it tho, to complicated for me cause i've never used linux before. Short of long considering that i have no idea about all this. Why we can't use pre rooted stock rom or pre fished stock roms? I ask that cause i really don't know and it shouldn't be that hard. Or it is that hard?
[G4 Android Development] steadfasterX:
first thanks for appreciating my work ;)

and just that you know it: its always better to not quote such long posts like the OP. When you quote just select the part of interest if it is such long.

quoting such big ones makes the forum unreadable and no need to say sorry we all are here to read, find out & learn ;)

ok so regarding your situation:

you already read the OP and the process is very very simple. You need a rooted device. For this pre-rooted images / KDZ exists for many -if not all- g4 models.

For TWRP-in-FIsH you do NOT necessarily need a Linux due to the new installer improvements made by Rees86 and me! You can just install from within Android! There's no need to flash a whole system image or KDZ which would complicate more then help.. So just give it a try and tbh if you have no Linux and do not want to use the Android installer: you can consider to burn FWUL on a USB stick and just boot from there. Its a ready to use and userfriendly Linux and has everything on board for connecting your android device or flashing TWRP-in-FIsH on it.

.
[G4 Android Development] sdembiske:
Added benefit to installing TWRP-in-FSH

Ever tried to modify your build.prop file and run into issues like: not being able to save changes, changes being overwritten back to stock on reboot, softbricks .... etc.?

Well, steadfasterX's TWRP-in-FiSH to the rescue. Refer to the following article and follow the commands exactly, particularly the last ones to reset the permissions (ignoring these will most likely end up in a brick on reboot). Works a charm.

Link: http://www.theandroidsoul.com/edit-build-prop-without-root-using-adb-in-twrp-recovery

Use caution and know what you're doing before deciding to alter your build.prop file or any other file/app for that matter (this method is also great for copying any files, apps etc. from your installed kdz's for modification or installation to another kdz). Make sure you know the current permission codes in use on the particular file/app before pulling them and pushing them back.
[G4 Android Development] raptorddd:
h815 needs key for unlock from LG .. we h811 dont just the command to unlock and relock.
[G4 Android Development] steadfasterX:
as usual your reports and tests are highly appreciated :highfive:

I added a link to the above post in https://xdaforums.com/showpost.php?p=71429070&postcount=2

thx again

wtf really?? I always thought you have to go to LG or TMO to get a key?? thats .. omg I have to check something!

,
[G4 Android Development] raptorddd:
yes weird huh. ??
[G4 Android Development] BIG_BADASS:
Not being able to save build.prop is not because twrp fish.. it's because you don't have ROOT access to the file manager... get ROOT access and it willl work..... I use ES FILE EXPLORER.... it works very well... and make sure to change permissions.... this is a permission issue...

Even better than a file explorer... you install BASH SHELL onto your device, then open build.prop with Vi or Vim text editors ... then make changes, and once you are done changes..... you change file permissions to the following:

chmod 644

YOU HAVE TO PUT THIS COMMAND.. so only YOU can change the file... NOT even the SYSTEM can change it. This way you will not face trouble once you reboot!

You're welcome!
[G4 Android Development] sdembiske:
Not just a root or changing permissions back to 644 issue, no matter what file explorer you choose to use.

For a junior member who started posting less than 3 months ago, finding rooting his H812 much too complicated, let alone installing TWRP-in-FiSH , you have gone from no knowledge about what you speak ... all the way to ... Senior TROLL.

Congratulations.
[G4 Android Development] BIG_BADASS:
Give this post a Thanks.

---------- Post added at 08:57 AM ---------- Previous post was at 08:56 AM ----------

Ok I admit... I know nothing... I'm going back to square 1 and making my way upwards... slowly.... I even went to the boot sequence of Android (ARM Instruction set)... and comparing it to Intel x86, and understanding what exactly is brick... and custom roms.. and all that...

I hope to make some real progress soon, please forgive me.
[G4 Android Development] BIG_BADASS:
Tell me, how useful is TWRP-in-FISH in situations where you need to FULLY format the hard drive? For example, you get a very stubborn trojan + rootkit that still remains even after you flash the stock firmware with LGUP refurbish option?
[G4 Android Development] bazaleem818:
error! you have android running but 22 is required

i get this error when try to last step sh ./install.sh

also then end of the terminal

./install.sh[100]:tr: not found

edit i try other way to browse to the file install.sh by terminal i get this

--> ERROR!! ABORTED WITH ERROR ---! Check the above output!

./install.sh[226]: ---: -- requires lvalue
[G4 Android Development] steadfasterX:
Do you execute this directly in android?

.
[G4 Android Development] bazaleem818:
yes in android terminal

lg g4 h815 usa locked bootloader with lolibop rooted with superus 2.8 and disabled silinux
[G4 Android Development] steadfasterX:
you followed the instructions step by step?
[G4 Android Development] bazaleem818:
yessssssssssssssssssss done thanks

i use bad terminal that come with 3c toolbox pro

now its done with terminal from google play store

thanks again
[G4 Android Development] steadfasterX:
good :)

do u saw the thanks button? ;)
[G4 Android Development] bazaleem818:
ok thanks

lol

when i reboot i dont see the light goes from blue to green its blue lighting

also i try to hold down while it blinking ( blue ) but its remain blue nothing happen also the message apeare that say problem in system but it work normal without the background
[G4 Android Development] steadfasterX:
go to the OP and find the topic "Catch the FIsH logs" and follow the instructions

.
[G4 Android Development] bazaleem818:
ok i just restart and it stack on android logo then i remove the battery and the green light apear then i do like you said done

twrp work

when i go to mount system the slide to mount disapear it there r( system, data cashe , micro sdcard , usb otg )

down there is check box says (mount system partition read only )

also down there r

(select storage) and (eneble MTP )

but there is no slide to pull

sorry for bad eng
[G4 Android Development] steadfasterX:
Catch the FIsH logs

reboot back to Android and catch the fish log (IMPORTANT!):

adb shell "su -c cat /cache/fish/fish.log"

adb shell "su -c cat /cache/fish/fish.log.old"

Upload it to https://paste.omnirom.org and paste the link!!!
[G4 Android Development] guillefs:
Installed twinfish in genesis ROM 2.2, android 5.1

Twinfish works well.

But after rebooting I realized that the phone is not connected via USB to the PC in any way.

Solution ?
[G4 Android Development] steadfasterX:
When you connect the device to your PC does it even do not display charge mode mode? beside this can you still charge the phone with regular charger? It sounds like a detective cable or usb port

.
[G4 Android Development] guillefs:
yes , display charge mode mode.

Already solved.

The problem was that you activate the Xposed module" Bootmanager Pro" .

Turn off Bootmanager and everything works fine again.
[G4 Android Development] steadfasterX:
TWRP in FIsH does not enable any xposed module.

.
[G4 Android Development] Dlind:
In theory would it be possible, to flash a T-Mobile stock mm rom on a att g4? I know i can't touch the boot img but could a T-Mobile rom work with att boot img?
[G4 Android Development] steadfasterX:
The first thing coming in my mind : why do you want to do that???

Hm. Well.. Maybe.. But when you test it it may soft brick. We know that you can modify the system image (when doing it right) but well who knows what happens in that case you're trying to.

Make a full backup with FlashFire especially do not forget all your internal storage.

Try and if it fails restore by LG up and FlashFire for the rest.. Keep an eye on antirollback before doing anything and ofc u need a MM base (bootloader, modem etc. ).

All this without guarantees. I have no experience in restoring with FlashFire on a locked device!

Hm while writing this an experience coming in my mind regarding my unlocking attempts:

Even when this all would work it may still give you unexpected results. One best example is the baseband/radio. The atd service (has nothing to do with att ;) ) and many others are running from the system image. That's the same for keymaster etc so unlocking and cell service may fail. Not because the frequencies are different just because some files are different and cannot be loaded.

Well the only way to know is testing ;)

.
[G4 Android Development] TheMadScientist:
We have been saying this all along.

When efidroid is ported in we can boot anything just aboit without modifying the boot change

We will never see unlocked bootloader this is a fact. Ive done plenty of study on this.

There is no hacking the lg g4 signed loaders the loader is encrypted with a 256 bit key which is impossible to bruteforce. G3 and g2 where just signed not encrypted. Thats why the hacks worked they "signed" everything we flashed.

Even with the limitations at current. With the bootloader state being said this is more than acceptable. Im trying to find a spint zv5 stock kernal to see if i can downgrade qfused if so i know we can fid a way for the mm users hopefully to dg and get root to
[G4 Android Development] nikomedes:
please see my question, "with efidroid in FIsH"
[G4 Android Development] spartan268:
No man, not 7.0. It'll be limited to lp
[G4 Android Development] TheMadScientist:
Should be able to dual boot it

---------- Post added at 07:44 PM ---------- Previous post was at 07:37 PM ----------

Finally bricked. Lol. I had to restore stock tot and reroot.

Lol i dont lie to any one im in a medial marijuana state and i got a presription. I gotta get high and try to reinstall the fish. Might be able to do this this time. Be in the rite mindset. Lol. Feelin better finally. Some at least. Still aint slept to much. Lol twrp still cant flash a downgraded boot partition. Hopin it would or could. Tryin to find some kinda hope for my fellow mm users
[G4 Android Development] raptorddd:
[MENTION=5545101]steadfasterX[/MENTION]

does the rest of g4's have antirollback.? i know h811 does.. so maybe it would be nice to update your post and have them first find out if they have antirollback. in the case that they do. so they dont brick phones downgrading... just saying.. not sure if rest of G4's have antirollback.. wish you good luck with this.. even though i have h811 i thank you for the rest that have locked BL. i hope it all goes well.. kudos for you. and testers..
[G4 Android Development] steadfasterX:
You can have root on marshmallow this is absolutely no problem but this root user is not allowed to do anything because of selinux!

I can show you in five minutes to root the device without a problem on marshmallow if you like . Again it will be useless but I can show

that means you do not have to find an exploit for rooting the device instead find a way to disable selinux that the only way it will work

if you like I can show you the things I already investigated and some details about how they could be on IRC channel

Believe me or not but I tried many to find a way but then I stopped it because I I thought first of all I want to see if the whole staff is working or not what I had in my mind so I decided to first start with lollipop

.

I still believe that the key will be the download mode even there selinux is active but you may have more permissions than normal Android because here you can flash a Rom what you can't in a running Android. Check my github for lglaf to get a shell in download mode. ..

.
[G4 Android Development] TheMadScientist:
Lol i know the sprint g4 does.

From what it shows. The worst are all the american devices and some internat devices
[G4 Android Development] onotor:
I am wondering about the fact that we can flash Resurrection Remix or LineageOS???
[G4 Android Development] TheMadScientist:
J

Should be able to with efi.

Biggest thing im looking at. Dont know about android but say installinv windows and ubuntu. The grub loader is installed on the boot partition. At worst only issue i forecast not fully understanding yet of coarse. Is that the install locations may have to be changed. Again not sure completly how android dual boot works but still should work. Just tell roms to boot from intern storage or sd card. We shouldnt have any issues though
[G4 Android Development] alitavas:
View attachment 4077263

Maybe it's a new problem!!!?

Sent from my LG G4
[G4 Android Development] TheMadScientist:
twrp also requires unlocked bl not nomore

again this is closest any ones got
[G4 Android Development] steadfasterX:
lol.. they do not know FIsH yet ;)

btw (even this is OFF-TOPIC):

I have my first efidroid test build done.. (which is the first step for efidroid-in-FIsH)

it boots up with fastboot (yea right this will NOT work with a locked device yet) and it displays the current OS + a manually added one in /data/ :D (see attached screen)

so the only thing to do is merging that stuff to official and doin efidroid-in-FIsH..

again: boot gets not modified when using efidroid-in-FIsH and again this is all not ready to use and again it SHOULD work but i can say for sure when its ready only (but i really have a good feeling that it will..)

.
[G4 Android Development] uio88:
Oh my God, you're amazing my friend! Good work,!
[G4 Android Development] raptorddd:
yes.. i dont want to see people blaming him.. hes doing alot already.. says some does downgrade and bricks hell get blame.. so better to let them know that.. :good:
[G4 Android Development] TheMadScientist:
I ended up in the e.r. today. 103 far fever. They did a flu swab. And i got type a flu and type b. I always say go big or go home. I dont barely remeber being there. My wife would swore i was 100 % drunk if she didnt know any better. Found out type a is like swine flu bird flu and pandemic strains like that. Now im all scared. Ima die from having 2 flus. Boys. This is rough let me tell you. My wife said i was hyper ventilating. And blackin out. But i did get a little sleep last nite. So theres a plus.

I cant afford to be like this. I aint been at work all week. My wife works too. The kids were all sick. With type b. And my father inlaw hangs out here and he had type a so im fricked

---------- Post added at 07:31 PM ---------- Previous post was at 07:27 PM ----------

Lol all us veteran g4 users know

But im seein a lot of new faces specially here in the last few days

I put up a page on the sprint threads a few weeks back about which can and can downgrade. Cause all the new faces were bricking
[G4 Android Development] LaughingCarrot:
All I can say is I hope you feel better and hopefully dying from the flu wouldn't be the case lol. I remember having swine flu a long time ago as a kid. I was out of school for a week.
[G4 Android Development] TheMadScientist:
Tomorrow will be 5 days outa work. I got slammed today.

Thank you
[G4 Android Development] spartan268:
Hope you feel better soon! You already contributed a butt load here and it's well appreciated. You'll make it then enjoy getting super baked after lol
[G4 Android Development] TheMadScientist:
Lol no smokin for me. Chokin up to bad. Lol. I need to quit cigarrettes. I smoke less than a pack a day. And i smoke 5 packs in a week. That would help a lot. Prob is when im done smomin aint nothin better than a cig
[G4 Android Development] raptorddd:
hope you get better soon. take care of yourself
[G4 Android Development] Dlind:
The reason is I had a friend who is on T-Mobile and she needs wifi calling and other stuff related to T-Mobile software and well the guy I bought the phone from advertised an UNLOCKED G4! But he also showed pictures of a T-Mobile g4 in his pictures!! But the guy sends me a f*cking at&t g4!!! So I was hoping I could help her out