yashsingh1/xdaforums huggingface dataset:
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] kwiksi1ver:
from adb shell run

cd /dev/block/platform/soc/
ls

the ls command will list a partition or two try to cd to them and look for a structure like this:

/dev/block/platform/soc/c0c4000.sdhci/by-name/

the c0c4000.shci will not match, it will be specific to your device model, but once you find that folder you can try to copy the boot and recovery partitions using commands like this:

dd if=/dev/block/platform/soc/c0c4000.sdhci/by-name/boot of=/external_sd/boot.img
dd if=/dev/block/platform/soc/c0c4000.sdhci/by-name/recovery of=/external_sd/recovery.img

or if you don't have an external SD card try this

adb pull /dev/block/platform/soc/7824900.sdhci/by-name/boot stockboot.img
adb pull /dev/block/platform/soc/7824900.sdhci/by-name/recovery stockrecovery.img

Again the folder name after the /soc/ in the path will be different for your device so replace that and you can save your stock boot and recovery images. From there we can use those to build a proper TWRP and get root by disabling dm-verity on the boot.img.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Dadud:
not seeing a c0c4000.shci or similarly named folder, just a lot of mmcblk folders, a by-name and a by-num folder. i see something called boot and recovery in by-name but when i try to adb pull it returns adb: not found
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] kwiksi1ver:
Sorry, I should have been more clear, you can't be in adb shell when you run the adb pull command.

So you'd find the full path of the "by-name" folder and you'd copy the whole path name. Then exit out of adb shell by typing "exit" and you should be back to the command prompt/terminal on your computer.

Then you run the command: (but replace the path of your boot and recovery files with the file structure on your device)

adb pull /dev/block/platform/soc/7824900.sdhci/by-name/boot stockboot.img
adb pull /dev/block/platform/soc/7824900.sdhci/by-name/recovery stockrecovery.img
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] dejello:
Opening command prompt/powershell (windows) or terminal ( linux) and type:

adb pull /dev/block/platform/soc/by-name/boot boot.img
adb pull /dev/block/platform/soc/by-name/recovery recovery.img

This works fine for me using my twrp and the twrp from the op. This does not work for you?

I have used this to boot into phh-treble and the lineage-phh-treble roms (with the stock kernel) and have gone back to stock (pulled the system.img before this). I have not been successful with Magisk myself.

EDIT- After typing this I just saw kwiksi1ver's reply... :p

Not that I've needed to but I had more lines in my fstab so I could mount more partitions like vendor (I believe Magisk wanted to mount it?) Included for whatever purposes. external sdcard not working right and I haven't tested out edits since I first tried it.

*** DISCLAIMER *** It's been a long time since I have messed with this stuff so excuse the messy stuff and my lack of knowledge of mounting flags. Also uh..... I'm not responsible for your choices.....
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] kwiksi1ver:
By chance could you also post the stock recovery.img and boot.img as well?
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] dejello:
I can. It boots but the sdcard is at least shown better on the op link. I took the one posted for the g6 play and swapped a few things with the stock recovery and came up with this. ***Again, I'm not responsible for how you use this and can't say anything is safe (though I have used it plenty). You WILL lose your data any time you want to mess with anything rom related.*** To get it to read the data partition you have to format it (that includes internal storage).
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] kwiksi1ver:
I don't have a G6 myself, I was just trying to kickstart the development on it.

I have a G6 play, I was the one who made the TWRP image for the G6 Play. ;)
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Dadud:
no, it doesnt seem to be working, this is a log my my powershell prompt.

PS C:\Users\dadud\Downloads\TWRP-3.2.1-ali-20180612.img> adb shell

~ # [6n cd /dev/block/platform/soc/

/dev/block/platform/soc # [6nls

by-name mmcblk0p16 mmcblk0p25 mmcblk0p34 mmcblk0p43 mmcblk0p52

by-num mmcblk0p17 mmcblk0p26 mmcblk0p35 mmcblk0p44 mmcblk0p53

mmcblk0 mmcblk0p18 mmcblk0p27 mmcblk0p36 mmcblk0p45 mmcblk0p6

mmcblk0p1 mmcblk0p19 mmcblk0p28 mmcblk0p37 mmcblk0p46 mmcblk0p7

mmcblk0p10 mmcblk0p2 mmcblk0p29 mmcblk0p38 mmcblk0p47 mmcblk0p8

mmcblk0p11 mmcblk0p20 mmcblk0p3 mmcblk0p39 mmcblk0p48 mmcblk0p9

mmcblk0p12 mmcblk0p21 mmcblk0p30 mmcblk0p4 mmcblk0p49 mmcblk0rpmb

mmcblk0p13 mmcblk0p22 mmcblk0p31 mmcblk0p40 mmcblk0p5

mmcblk0p14 mmcblk0p23 mmcblk0p32 mmcblk0p41 mmcblk0p50

mmcblk0p15 mmcblk0p24 mmcblk0p33 mmcblk0p42 mmcblk0p51

/dev/block/platform/soc # [6ncd by-name

/dev/block/platform/soc/by-name # [6nls

DDR cmnlib64 fsg mmi_misc prov syscfg

aboot cmnlib64bak hw modem provbak system

abootbak cmnlibbak keymaster modemst1 recovery tz

apdp devcfg keymasterbak modemst2 rpm tzbak

boot devcfgbak kpan mota rpmbak userdata

cache dpo logo msadp sbl1 utags

carrier dsp logs oem sbl1bak utagsBackup

cid frp metadata padA sp vendor

cmnlib fsc misc persist ssd

/dev/block/platform/soc/by-name # [6nexit

PS C:\Users\dadud\Downloads\TWRP-3.2.1-ali-20180612.img> adb pull /dev/block/platform/soc/by-name/boot stockboot.img

remote object '/dev/block/platform/soc/by-name/boot' not a file or directory

PS C:\Users\dadud\Downloads\TWRP-3.2.1-ali-20180612.img>

(ive got adb/fastboot enabled system wide so itll work out of whatever folder i have open)
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] kwiksi1ver:
Okay try this from powershell, it should work.

adb shell
dd if=/dev/block/platform/soc/by-name/boot of=/tmp/stockboot.img
dd if=/dev/block/platform/soc/by-name/recovery of=/tmp/stockrecovery.img
exit
adb pull /tmp/stockboot.img
adb pull /tmp/stockrecovery.img
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Dadud:
ended up downloading the new (r40) of ADB instead of the old (r32) and using command line, and had success.. ill edit this post with the google drive links to my boot.img and recovery.img as soon as it uploads (stuck on 512k upload and both are about 22 megs, should be done in 10-15 minutes.)

Edit: Links

https://drive.google.com/open?id=1VWK24zyIl2sGz4H99YrG1G0KdTUmBsG3 <- Boot.img

https://drive.google.com/open?id=1xXEj7vdiikBY5ygZANNeMWwvI1S3DO4H <- Recovery.img

---------- Post added at 01:03 PM ---------- Previous post was at 12:32 PM ----------

Say i wanted to flash the pixel experience project treble rom, all i'd have to do is flash the system.img from their download through twrp/fastboot and boot? i've already backed up my original system.img.

edit: attempted, failed. just reboots into bootloader every time i try to start it. reflashing stock system.img

edit: that also failed, along with my twrp backup.

edit 3: unbricked with the firmware found on this forum.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] dejello:
So.... I have tried installing again and ended in bootloops. I just tried installing AOSP phh-treble via fastboot (system.img doesn't need to be signed) and it is booting with the stock unmodified kernel.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] dejello:
Photos.. Also seen this boot logo randomly.. Thought that was interesting..

I am working to see if I can figure out the external sdcard in twrp (as this thread should be about twrp). Figured a booting image might help in that, dunno.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] dejello:
I have been working on creating a device tree to build a new version from source (v3.2.3-0). If anyone wants to test it out please let me know how things go: twrp-v3.2.3-ali.img

[EDIT]- Forgot I added a "Vendor Image" to the flash section in the case people have a backed up vendor image and want to flash it without using fastboot. This hasn't been tested yet.

[EDIT 2] - 64bit twrp-v3.2.3-ali64.img
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] r0tt0r:
just updated via official twrp app, and it went fine. everything works so far. the partition cannot be unencrypted but thats a different thing. thanks a lot

edit: due to encrypted partition i had to format data to different filesystem ext4 and wanted to revert to f2fs it was not available. maybe you can include mkfs.f2fs to it,
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] dejello:
I just realized that as well. I have updated the 64bit version: twrp-v3.2.3-ali64.img

32bit has not been updated and I will probably just remove the file altogether at some point unless we can think of a reason it'd be preferred
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] r0tt0r:
why purge 32bit? g6 is armv7 and is not arm64 i think
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] petya230:
https://www.qualcomm.com/products/sdm450-processor

Its 64bit..

Just sayin.

I dont know, Motorola why use 32bit os...

[MENTION=3060517]dejello[/MENTION]

So we will have 64bit kernel too? :o
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] dejello:
The kernel in twrp is 64bit, it's just that getting twrp to build and boot is alot easier than full Android for me
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] petya230:
hmm, maybe that kernel can boot with an arm64 gsi?

Can u try it? or.. can u give me that kernel? :D

Do u have telegram?
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] dejello:
It's been tried.. It takes more than just having a 64bit kernel--There has to be support in elsewhere. No, no telegram. Also, this thread isn't the place to discuss this, it should be for TWRP.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] petya230:
oh, okay.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] HACK3DANDR0ID:
DELETE
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] nlooooo:
G6 plus (evert) got the official build, not regular g6 (ali)
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] HACK3DANDR0ID:
Thats's what I said, more then one time, G6 Plus....
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] nlooooo:
This is g6 recovery thread...
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] dejello:
Decryption!

So...... been trying a few things for decrypting data. I'm not sure whether this played a role or not, at some point today during all my playing around I ended up formatting data and re(forced)-encrypting again as I went full stock to take the update recently (finally?). I also stopped twrp loading some decrypt services before trying vold and it stopped having some errors. Ever since then I have gotten my newest builds to decrypt data with the default password (no lock code) and a pattern. I have even restored a previous backup from when I was not encrypted and it works just fine. I am currently on Moto version OPSS27.104-15-10-4.

This is really for testing at this point in time. I'd like to know if anyone can decrypt (without wiping data and re-encrypting like I did). It'll take a minute to do it's thing but I have access to data in twrp while encrypted now. As ALWAYS, you're responsible for your actions. The decryption process itself will not hurt you data, only you formatting it, so you should be safe booting and trying to decrypt. If it doesn't and you want to try what I had done, feel free to do so and let me know how it goes. Went back to 32bit for testing purposes for now.

Google drive link (may be a temporary link): TWRP-v3.2.3-ali_crypto.img

I'd really like feedback please!

[EDIT] - It seems you may need to

flash

this version to make decryption work correctly. Hopefully once any quirks are worked out we will be able to make it work either way. Either way, make sure you have a backup of your stock recovery before flashing if you want to be able to go back (or use recovery.img from a factory zip--another thread in the forums).

To back up:

adb pull /dev/block/bootdevice/by-name/boot stockboot.img

To flash:

fastboot flash recovery TWRP-v3.2.3-ali_crypto.img
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] longerXDA:
My build is OPS27.82-87. I followed your guide to root my device and I re-encrypted it after.

I flashed TWRP-v3.2.3-ali_crypto in recovery. It took time to reboot, didn't ask me for password and when it reboot it has access to data.

I don't know if you need more info...

Thanks for your work.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] dejello:
Do you have a password or pin or anything set in Android? If so, what kind and do you have it set to require the password to start Android?
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] longerXDA:
I use pin code with fingerprint. After a reboot, I have first to put the pin, and after that I use the fingerprint.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Xplorer4x4:
[MENTION=3060517]dejello[/MENTION] go to the install screen or file manager screen and see if the file/folder names make sense when browsing your internal storage or if they are a mix of random characters. The decryption successful message is not a true indicator.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] dejello:
Yes, I checked this before as I wanted to be sure. I am still working on code cleanup/etc to try and improve things.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] meatwad0222:
I was gonna try the updated build but just to confirm: i currently use a pattern code along with fingerprint, should i switch to pin or password?
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] dejello:
Pattern should work. I have tested using a pattern alone (did not have fingerprint) and it worked.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] r0tt0r:
location gives me a 17fMtu_aqRFpA0weCO5TwagPPoOnqrpUk.bin and not a twrp-3.2.3-ali-crypto.img
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] dejello:
It works fine for me, please try again?
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] r0tt0r:
seems a browser issue on my side sorry. i used duck duck browser and that gave me the bin, tried with fennec now and it works as img
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] dejello:
No worries, glad the link works now. Let me know how things work out!
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] r0tt0r:
works perfect, that is really great. thanks a lot for your work on that,
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] jglm4u:
So the arm64 version of TWRP actually works? Does that mean we could like flash arm64 roms ? Or we need arm64 kernel ect to be able to boot an arm64 gsi IMG?
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] dejello:
No, it doesn't mean that. It's been said before but I'll say it again, there HAS to be other driver/module/etc support on the device and we don't have that (yet). Also, the newer builds where I've included vold decryption weren't working right with 64bit (probably because our vold stuff is 32bit?). It's a lot easier to get twrp working as it's more inclusive with what it needs, and it needs WAYYY less than a full Android system does. My last attempt at a 64bit rom, which included modifying the vendor partition, got a boot animation but went no further. Admittedly, I've never done that before so who knows.. Since then I decided to pour myself into twrp to see where we could get with that first.

Other note, there was a bug in the last build I posted that caused issues with creating and then restoring (the ones created by that particular version) password protected backups. This has been corrected and a new version is up at the same link: TWRP-v3.2.3-ali_crypto.img
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] dejello:
Don't know why I haven't checked until now, has anyone had success in decrypting while using a GSI?
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] jglm4u:
How do I know if Im decrpyting?
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] dejello:
You'll see this (click the bars to the right of the home button) and data will be mounted and readable. Otherwise it'll should an error. If you're not encrypted then it'll just mount data without saying any of the stuff in the pic.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] r0tt0r:
yes it works, the password entry is accepted and data is mounted and accessable
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] dejello:
Interesting. I will need to try using a password. I had a pattern and wasn't getting it to work
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] dejello:
Slight update that should help with wiping/formatting after decrypting. Same link: edited---see edit below!

Please feel free to test (as always, your responsibility, backup/whatever..) and let me know your results.

NOTES:

* If you format data after decrypting (to remove encryption) without using Factory Reset, you may need to reboot to recovery and format data again to be able to boot.

[EDIT] Official TWRP (ALI)!
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] kholdstayr:
I'm looking for a relatively cheap phone that is rootable, and I'm considering getting a Moto G6. I wanted to know what this means : "Notes: Currently only vold decryption is working."

I've never rooted a phone before so I have no idea what vold decryption is. Thanks!
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] dejello:
The decryption in TWRP is working, but isn't perfect (See the official thread for more details). Basically this build of TWRP attempts to use the device's decryption tools instead of it's own to decryption data that has been encrypted. It has nothing to do with rooting in and of itself. At the moment we find ourselves needing to use modified boot images to get magisk (root) to function when flashed through TWRP. Hopefully that will change soon.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] CHETAN 1998:
What is the decryption password
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] madbat99:
There isn't one. Geez. Read, read, and then when you think you have it all read it again.

TWRP cannot read encrypted data.

Unless you format data and flash magisk or flash a no forced encryption zip, TWRP will never be able to read data. Ext. SD card only.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] CHETAN 1998:
K leave it

After i flash magisk my SIM cards not detecting and neither they are getting signal.

Help me out with this
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] PGHammer:
SO - Only for India?

So, this is not a universal TWRP (for areas other than India)? The reason I ask is that Best Buy is running a sale on the G6 here in the US ($150USD - universal unlocked), and THE reason I would bite at that price is because I would be able to run any firmware available - not just stock. (That is not the case with my Samsung S7 Snapdragon - where I am not only blocked from Pie, but from anything that isn't stock.)
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] bhati2710:
Need mmcblk0.img of xt1925-13 as my phone got bricked. That would be great help.

Thanks
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] iamraikamran:
I have mot g6

Its imei was changed by shopkeeper

If i flash custom rom will it be remain same or gone to ots original imei

I don't wanna lose current imei

Plz anybody tell me
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] jlink38:
Any issues with the Treble ROM on the G6?
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Dadud:
after fixing my brick where i found out the hard way the phones not 64 bit or A/B, i got XenonHD, PHH-AOSP and lineage GSI's to boot. Flashed system imgs through fastboot. and had to whitelist my phone through google in order to get play store services to work. TWRP works fine for flashing oppengapps, Doesnt like encrypted storage though.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] DeineMudda111:
I can boot into twrp (fastboot boot twrp.img) but it show me 0MB of sd card and internal when i click of install. Any solution?
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] dejello:
The stock setup is to encrypt the data partition. TWRP can't read it that way. There is an option to format the data partition in TWRP but be warned **YOU WILL LOSE YOUR PERSONAL DATA** It's similar to factory reset but goes a step further. Kinda not useful at the moment as it will re-encrypt (and wipe data again) when you reboot.. The rom will complain it can't read the data partition and offer (only choice to continue) to encrypt it again....which makes TWRP not able to read it.

We also have the current issue where external sd cards are not picked up by either port in my experience
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] stifmaster81:
some Nexus type page and the Google to download the Factory image and flase it by adb?

Enviado desde mi moto g(6) mediante Tapatalk
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] TheLoonyRebel:
Hopefully with the kernel source being out for the G6 that might help get TWRP up and running properly now.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] stifmaster81:
I would like you to answer me if you know

Enviado desde mi moto g(6) mediante Tapatalk
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Dadud:
i used the factory images for my phone (g6, ALI) found in these forums.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] fix-this!:
for root why not just take the boot.img and patch with magisk? has anybody tried this? you shouldn't need twrp.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Dadud:
why? topjohnwu just announced project treble compatible magisk coming soon. should be able to just flash it on top of the stock motorola firmware and root it that way.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] likemiketoo:
Tried it, as well as other users on G6 Plus thread, the patched boot image is smaller in size than the original boot image and causes bootloops when flashed.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Josio67:
I did the exact same thing and i got root perfectly, but I noticed that I patch it turning on in Magisk, the options Keep Force Encrypt and Keep AVB 2.0/Dm-verity

Hopefully keeping that enabled will boot your too.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Dadud:
the new project treble magisk is apparently available on topjohnwus github, i dont know anything about building from source but im going to try to learn and get a version to test to see if it'll root easier before we start having everyone mess with boot.imgs and make it harder to return to stock to take an OTA.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] kwiksi1ver:
Can someone test either of these TWRP images?

Test 1: https://drive.google.com/open?id=1DGwaVVg5BdL4ye-Uz-6U6gwsm8-7TPJ1

fastboot boot moto_g6_TWRP_test1.img

Test 2: https://drive.google.com/open?id=1rs1czXcCuUIxLpQeD-oiW-mpyAB7TZgp

fastboot boot moto_g6_TWRP_test1.img

Neither test will read your userdata because that is encrypted. It may take a while to boot because it's trying to decrypt it. If it asks for a password just click cancel.

If either/both of them work we can edit your fstab, then flash a dmverity free boot.img, and then flash magisk and get root.

Note: I do not have this device I'm just trying to help.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Dadud:
test 1 did not boot "FAILED: Remote Failure" Test 2 booted and showed decrypt data password screen.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] kwiksi1ver:
If you click cancel after the decryption promot on “test 2” do the rest of the functions appear to work? Touchscreen? File manager, mounting of partitions, Exterbal sdCARD etc.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Dadud:
the micro sd card does not seem to want to be checked in the mounting tab (i have mine formatted for internal storage though). OEM, PERSIST, and Firmware show up now. touchscreen works fine, and i could try to decrypt or wipe to dig further if you'd like.

edit: ill quickly format my SD card differently and try again quick

edit2: does not mount