Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Did someone managed to write TWRP to LG G4 with this tools? #14

Open
sxiii opened this issue Jun 20, 2017 · 2 comments
Open

Did someone managed to write TWRP to LG G4 with this tools? #14

sxiii opened this issue Jun 20, 2017 · 2 comments
Labels

Comments

@sxiii
Copy link

sxiii commented Jun 20, 2017

The only stuff that works for me, is:

python lglaf.py -c '!INFO GPRO \x08\x0b\0\0' > props.bin

And then it's possible to view data with

python scripts/parse-props.py props.bin

Every other command fails. Thinking of is it possible to flash system firmware or at least TWRP so phone can be flashed from linux, without any windows touches.

Thanks guys...

@steadfasterX
Copy link
Contributor

steadfasterX commented Jul 22, 2017

yes its possible when:

  1. u have the TWRP file on the device already (much better would be to be able to send it though.. but i dunno if or how that would be possible..) EDIT: maybe PR Script to copy files to phone #1 will work here?
  2. u flash it with dd + seek on the mmc device (no direct partition flash for recovery possible in download mode!)
  3. u integrate that PR in your code base added challenge response algo #12 (at least for me this is required to work with the G4)

example (not tested with the recovery partition yet but I used it for others):

  1. push the twrp.img to your device - best directly to the internal storage EDIT: instead maybe PR Script to copy files to phone #1 will work here?
  2. connect to the device in download mode via: python2 lglaf.py --unlock (I still hate that misleading parameter naming...)
  3. find out the seek start of the recovery partition (g4 uses mmcblk0p39) with e.g. gdisk
  4. dd if=/data/media/0/twrp.img of=/dev/block/mmcblk0 bs=512 seek=xxxxxxxxxx

I hope that one day I will found out how a push of e.g. twrp is possible directly within download mode - it has to be possible somehow.. EDIT: maybe PR #1 will work here?

PS: The above worked on LG G4 - H815 - BL Locked - MM v20g

@kenkit
Copy link

kenkit commented Feb 17, 2019

I have just flashed d850 with this tool

aiden@aiden-HP-Pavilion-g4-Notebook-PC:~/Desktop/lglaf$ python partitions.py --dump recovery.bin recovery
2019-02-17 19:52:06,284 partitions: INFO: Wrote 16777216 bytes to recovery.bin
aiden@aiden-HP-Pavilion-g4-Notebook-PC:~/Desktop/lglaf$ python partitions.py --restore /home/aiden/Downloads/twrp-3.0.2-0-d850.img recovery
2019-02-17 19:54:12,407 partitions: INFO: Done after writing 15435792 bytes from /home/aiden/Downloads/twrp-3.0.2-0-d850.img
aiden@aiden-HP-Pavilion-g4-Notebook-PC:~/Desktop/lglaf$ ^C
aiden@aiden-HP-Pavilion-g4-Notebook-PC:~/Desktop/lglaf$ python partitions.py --dump recovery2.bin recovery
2019-02-17 19:54:23,751 partitions: INFO: Wrote 16777216 bytes to recovery2.bin
aiden@aiden-HP-Pavilion-g4-Notebook-PC:~/Desktop/lglaf$ md5sum recovery2.bin
1e72eb5f0b27807112fb1a80af57aa42  recovery2.bin
aiden@aiden-HP-Pavilion-g4-Notebook-PC:~/Desktop/lglaf$ md5sum /home/aiden/Downloads/twrp-3.0.2-0-d850.img
e18e44e254003a5ab7cb84d2d4fbafa8  /home/aiden/Downloads/twrp-3.0.2-0-d850.img
aiden@aiden-HP-Pavilion-g4-Notebook-PC:~/Desktop/lglaf$ md5sum recovery.bin
54e52161fb9d108faa793a037663e84e  recovery.bin

I didn't erase it first, the twrp image was abit smaller than the backup dump hence the md5 mismatch
But twrp works from recovery mode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants