StrawberryVanillaLollipop for Xperia Z2 (AOSP 5.0) [CALLS][SMS][WIFI][BRIGHTNESS] - Xperia Z2 Original Android Development

So, while I'm working with krabappel2548 on a proper build for the Z2, I wanted to share my current WIP regardless.
It's imply AOSP 5.0 build for the Xperia Z2. The system.img is a bit larger because it is a snapshot of my current device and contains also already the GApps, but you can flash it just as always (fastboot flash system system.img), which you should not do unless you know exactly what you are doing!! You have been warned and I take no responsibility.
What is working?
- Proper brightness control in the full range
- Wifi
- Calls (everything)
- Texts (everything)
- Sound (everything)
- Charging LED/Notification LED
- Sensors (all)
- Vibration
- Screen of course
- Touch
What doesn't work?
- Mobile data (it already basically works but there is a small stopgap that stops us from making use of it)
- Bluetooth
- Camera
- NFC
- Video playback is somewhat broken, but you can use e.g. VLC with OpenGL 2.0 video output to watch videos, which works perfectly (but e.g. YouTube will not work)
Just flash the boot.img and system.img as you usually would with other ROMS, and pick a userdata.img from one of the other 5.0 threads of your liking; I didn't want to duplicate it here. If you don't flash userdata, then make sure you WIPE THE DEVICE BEFORE BOOTING THIS ROM FOR THE FIRST TIME!!
Have fun as usual, and bug reports about stuff that isn't listed above are always welcome.
Peace out,
DOWNLOAD
https://mega.co.nz/#F!mcVyzKJY!vxczjESXdcgZQOPrTvVXDQ
cheep5k8

Can you post some screen shot?

Sadly not; there is an issue with surfaceflinger (related to no video playback) which doesn't allow me to make screenshots. Maybe I'll find an alternate method to make a screenshot, then I'll update the post.

Have you tried building with the following in your BoardConfig.mk
MAX_EGL_CACHE_KEY_SIZE := 12*1024
MAX_EGL_CACHE_SIZE := 2048*1024
USE_OPENGL_RENDERER := true
VSYNC_EVENT_PHASE_OFFSET_NS := 7500000
SF_VSYNC_EVENT_PHASE_OFFSET_NS := 5000000
TARGET_USES_ION := true
HAVE_ADRENO_SOURCE:= false
OVERRIDE_RS_DRIVER:= libRSDriver_adreno.so
TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS := true

Thanks for the rom, but it doesn't seem to boot on my Z2. It just stops at the sony bootloader screen here...

You did wipe the phone before booting (or flash a userdata image)?

Why I got failed message when writing system.img?
FAILED <remote: Unknown chunk type>
Other 2 boot.img and userdata.img can be flashed normally.
I already redownload system.img and adb sdk.

- system.img contains gapps-lp-20141107 (117Mb) ?
- boot.img contains custom recovery ?

same as the above, stuck at sony logo and "remote: unknown chunk type" when flashing system.img

Looks like @sindre2104 and maybe @deezid stuck at sony loggo because they can't flashed system.img too just like me. Anyone who can flashed it can confirm this?

Related

[RECOVERY] (Un-)tethered TWRP 2.8.7.0 for Asus ZenFone 2 (x86)

Hi folks,
finally we compiled a(n un-)tethered TWRP package for our ZenFone 2 (confirmed on ZE551ML and ZE500ML)!
!!! NOTE: If you want to apply a new OTA update, please flash stock recovery first !!!
Also, if you encounter any errors with the official recovery by TeamWin, please don't ask for support here as this is an unofficial build (done with the hard work of many people collaborating in a great manner!)​
If you don't want to unlock your Bootloader, you can use the tethered recovery.
Tethered (=after a reboot everything is back to normal)​
Features:
- Compiled with CM12 sources (although CM12 and TWRP are not liking each other very much :silly: )
- Optimized for x86 (smooth UI now)
- internal and external storages are mounted correctly
- Backup of boot, system, cache and data possible
- Full Crypto and SELINUX support
Bugs:
- Sometimes Backup and Restore hang. Fortunately it doesn't begin these operations so you don't brick your device (any hints on this are welcome!)
- USB Storage mount doesn't appear to work at all (pretty sure I took the correct path to the LUN file)
How to use:
- Download the tethered CWM package from here (method 2): http://forum.xda-developers.com/zenfone2/general/root-newbie-root-instructions-zenfone-2-t3114063
- replace the recovery.zip in "CWM_Zenfone_2_IntelFB_RecoveryLauncher" with the one you can find in the download section
- start the procedure by using cai_dat_CWM.bat
- type ACCEPT (case sensitive!) and enter
- type T4 and enter
- Set your timezone when booting the first time into the Recovery, maybe this fixes the backup and restore bug (needs to be done just once)
- Unplug your USB cable from the device, too, before flashing, backing up and/or restoring
Untethered (=permanent recovery)​
Features:
- Compiled with CM12 sources
- Optimized for x86 (smooth UI now)
- internal and external storages are mounted correctly
- Backup of boot, system, cache and data possible
- Full Crypto and SELINUX support
- kernel compiled dynamically (thanks to @crpalmer and @jrior001 and all involved for their fantastic work) with permissive Selinux
- USB-OTG support added (Beta supports NTFS file systems)
- Splashscreen can be backed up (to fiddle around and create your own)
- img files flashable now via recovery (thanks to @cangcan, @yakub234go and @vampirefo)
- F2FS support on kernel side
Drawbacks:
- MTP doesn't work
How to use:
Method 1
Get root rights
Unlock your bootloader
Download twrp.img from the download section and put on sd card (or pick the beta version for NTFS support)
Fire up adb or install a terminal emulator and type:
Code:
su
dd if=/sdcard/twrp.img of=/dev/block/by-name/recovery
reboot recovery
Method 2
Download twrp.img from the download section and put in your adb/fastboot directory
Unlock your bootloader
Boot into bootloader (turn off, keep Vol+ pressed and press the power button until it vibrates - then release ONLY the power button and keep volume up pressed until you see the fastboot GUI
Open up fastboot on your PC and type:
Code:
fastboot flash recovery twrp.img
Then press vol down 2 times until "Reboot recovery" shows up and press power 1 time to boot into recovery
Method 3 (if you have an older version of TWRP already installed)
Place img on your internal sdcard, then reboot to recovery, click install zip, then select "Images..." in bottom right, then you see the img. Tick "Recovery" afterwards and then on OK.
Download folder:
Gone
Cheers!
Credits
@social-design-concepts for the great tethering method and the brilliant support and guidance :good:
@vampirefo also his support and guidance :good:
@updateing for the link to the commit for x86 pixelflinger
@jrior001 and @crpalmer for the great work on the kernel source
etc. etc.
Special thanks:
@Drew442 Thanks for the contribution!
Amir J. - thank you too!
TeamWin for their great recovery
XDA:DevDB Information
[RECOVERY][LOLLIPOP ONLY] (Un-)tethered TWRP 2.8.7.0 for Asus ZenFone 2 (x86), Tool/Utility for the Asus ZenFone 2
Contributors
TheSSJ, social-design-concepts, vampirefo, updateing, crpalmer, jrior001, knoneNull, etc etc
Source Code: https://github.com/TheSSJ/device_asus_zenfone2
Version Information
Status: Stable
Current Stable Version: 21_f2fs
Stable Release Date: 2015-07-02
Created 2015-06-04
Last Updated 2016-09-24
Update 07-02-2015
ADB sideload works now (thanks @jrior001 & @crpalmer)! Make sure to download the latest ADB version: http://forum.xda-developers.com/showthread.php?p=42407269, credits for this to @shimp208
Update 06-30-2015
NTFS Support tested extensively and proved to be stable (not elegant, but functional)
Added recovery partition back to recovery.fstab to make it flashable via recovery itself
Update 06-28-2015
Moved to stable state
Added Beta version for NTFS support (twrp_ntfs.img)
Update 06-23-2015b
Upgraded source to TWRP 2.8.7.0
Update 06-23-2015
Functional TWRP with fast wipe/restore (-DNO_SECURE_DISCARD, thanks crpalmer)
ADB works
Just have fun in fiddleing around with the recovery
If no bugs will be reported we can declare this recovery stable
Update 06-10-2015
Boardconfig parameters changed, seems to back up, restore and flash even with USB cable attached
Update 06-04-2015b
Rolled back to 2.8.5.0 as restoring threw out the error that system was not being able to mount rw
Everything works now!
Update 06-04-2015
Built a version optimized for x86, fixes UI lags
Added Crypto Support again
Update 06-02-2015b
Removed TW_INCLUDE_CRYPTO flag as it caused backup operation to freeze
Update 06-02-2015
Moved to Beta stage
Fixed mounting of external SD
Update 06-01-2015
Completely reworked BoardConfig.mk
Removed all modules
Added @vampirefo 's adbd and adbd-recovery binaries from his TWRP builds (dunno why, but there aren't any binaries in my builds?) - thanks!
Graphics work now (still slow, need to fine tune with the correct boardconfig flags), no double backups, no flickering!
Update 05-31-2015
Included USES_ION flag into boardconfig.mk
Removed cpu temperature to reduce redraws
a little more stable now!
Nice I can't wait for the BL to be fully unlocked so we van get native TWRP.
Hello recovery or rest and it just temporary? thank you
jejemc said:
Hello recovery or rest and it just temporary? thank you
Click to expand...
Click to collapse
Hi,
yes, after rebooting no trace of TWRP is left
I have updated the zip now. It is a little stabler after I removed the CPU temperature, but still I have the feeling there are 2 GUIs sharing the same screen. Weird - I have to do more research - maybe I have to write my own UI updater...
Cheers
the gears are slowly moving! i hope BL gets unlocked by the time my ZF2 arrives..
is this for any ZF2 variant or just 551ML (4gb ram/2gb ram versions)?
thanks for taking the time with this (hopefully) awesome device!
This is awesome..thanks for your contribution! I am hoping for some custom roms..the stock ZenUI isn't the greatest :/
TheSSJ said:
Hi folks,
I managed to compile a tethered TWRP package for our ZenFone 2!
Click to expand...
Click to collapse
Do you have a link to your device repo?
Are there specific instructions for using it to build a tethered recovery (I'm familiar with building twrp, including within CM, but I haven't looked much into what the tethered exploit does to boot the recovery).
It seems I have successfully completed a Backup! As mentioned, the interface is painfully slow at times, but this is serious progress. Has anybody tried restoring a backup yet?
Could you please develop twrp or cwm for asus 450cg
NOTE:
1 backup successfully
2 Use Very lag
3 flash zip not work
crpalmer said:
Do you have a link to your device repo?
Are there specific instructions for using it to build a tethered recovery (I'm familiar with building twrp, including within CM, but I haven't looked much into what the tethered exploit does to boot the recovery).
Click to expand...
Click to collapse
Hi,
unfortunately I don't have any. Basically I wrote a BoardConfig.mk based on the data provided by the Nexus Player (Asus Fugu, which is also Intel based). Then I took 2 modules (one for the display and one for the support of exfat partitions) and compiled a normal TWRP. The output folder holds the compiled img as well as the ramdisk in a simple folder. I put the ramdisk content into a simple zip file and included an update-script to have it unpacked properly. What the recovery-trigger exactly does is not clear to me. It seems it temporarily overwrites the logcat binary with itself and then gets executed at a reboot directly. The recovery trigger just unpacks the zip and executes the recovery binary if I understood correctly.
If you want I can upload my device configuration, it's better if there are more ppl looking at this
29y6145 said:
NOTE:
1 backup successfully
2 Use Very lag
3 flash zip not work
Click to expand...
Click to collapse
Thanks for the feedback!
2. Yeah, the lags are a pain, also because it seems to execute every touch twice and I don't know how to fix this at the moment (maybe it is sufficient to increase the time to determine when a longpress is executed and when a normal touch is done, but this is strongly theoretical.
3. I tested flashing a zip and it does work, which error message do you get?
Anyways, today is a new day, so I will get to work on this (I am on vacation right now fortunately).
Cheers!
TheSSJ said:
Hi,
unfortunately I don't have any. Basically I wrote a BoardConfig.mk based on the data provided by the Nexus Player (Asus Fugu, which is also Intel based). Then I took 2 modules (one for the display and one for the support of exfat partitions) and compiled a normal TWRP. The output folder holds the compiled img as well as the ramdisk in a simple folder. I put the ramdisk content into a simple zip file and included an update-script to have it unpacked properly. What the recovery-trigger exactly does is not clear to me. It seems it temporarily overwrites the logcat binary with itself and then gets executed at a reboot directly. The recovery trigger just unpacks the zip and executes the recovery binary if I understood correctly.
If you want I can upload my device configuration, it's better if there are more ppl looking at this
Thanks for the feedback!
2. Yeah, the lags are a pain, also because it seems to execute every touch twice and I don't know how to fix this at the moment (maybe it is sufficient to increase the time to determine when a longpress is executed and when a normal touch is done, but this is strongly theoretical.
3. I tested flashing a zip and it does work, which error message do you get?
Anyways, today is a new day, so I will get to work on this (I am on vacation right now fortunately).
Cheers!
Click to expand...
Click to collapse
If you can upload the device config to github I can try to take a look tonight or tomorrow and see if I can see anything wrong that would explain your "double ui".
Either way, it is good to upload it as you'll have a history saved of when it last worked if you screw it all up!
TheSSJ said:
Hi,
unfortunately I don't have any. Basically I wrote a BoardConfig.mk based on the data provided by the Nexus Player (Asus Fugu, which is also Intel based). Then I took 2 modules (one for the display and one for the support of exfat partitions) and compiled a normal TWRP. The output folder holds the compiled img as well as the ramdisk in a simple folder. I put the ramdisk content into a simple zip file and included an update-script to have it unpacked properly. What the recovery-trigger exactly does is not clear to me. It seems it temporarily overwrites the logcat binary with itself and then gets executed at a reboot directly. The recovery trigger just unpacks the zip and executes the recovery binary if I understood correctly.
If you want I can upload my device configuration, it's better if there are more ppl looking at this
Thanks for the feedback!
2. Yeah, the lags are a pain, also because it seems to execute every touch twice and I don't know how to fix this at the moment (maybe it is sufficient to increase the time to determine when a longpress is executed and when a normal touch is done, but this is strongly theoretical.
3. I tested flashing a zip and it does work, which error message do you get?
Anyways, today is a new day, so I will get to work on this (I am on vacation right now fortunately).
Cheers!
Click to expand...
Click to collapse
Is your problems due to recovery or modules you added? My tethered twrp doesn't have the problems yours does, so I wonder if it's the modules, your packaging perhaps and not the recovery?
Sent from my T1 using Tapatalk
TheSSJ said:
- Slow graphics, according to @Dees_Troy: "The graphics are a bit laggy because pixelflinger is not very well optimized for x86"
Click to expand...
Click to collapse
Dees_Troy is lying. TWRP graphic engine isn't optimized for any architecture. Even on my SGS4 (ARM) it's slow as snail. Higher resolution - more slower. I see, they've added some code for Qualcomm overlay support. I didn't try it yet, but support only for one CPU manufacturer is nothing. Especially, there is another way to accelerate at around 1000% by SIMD instuctions. Although i've liked TWRP originally, i see developers have no intentions to improve graphics which is the key feature. So, i've decided to throw away TWRP and look at Aroma File Manager.
It has very fast graphics engine with ARM NEON optimization (and with some effort it become SSE4.2 optimized). The only feature missing is backup/restore, but i'm working on that. Actually, Backup/Restore works now. Just thinking about better backup format.
sorg said:
Dees_Troy is lying. TWRP graphic engine isn't optimized for any architecture. Even on my SGS4 (ARM) it's slow as snail. Higher resolution - more slower. I see, they've added some code for Qualcomm overlay support. I didn't try it yet, but support only for one CPU manufacturer is nothing. Especially, there is another way to accelerate at around 1000% by SIMD instuctions. Although i've liked TWRP originally, i see developers have no intentions to improve graphics which is the key feature. So, i've decided to throw away TWRP and look at Aroma File Manager.
It has very fast graphics engine with ARM NEON optimization (and with some effort it become SSE4.2 optimized). The only feature missing is backup/restore, but i'm working on that. Actually, Backup/Restore works now. Just thinking about better backup format.
Click to expand...
Click to collapse
tar is the best.
Sent from my T1 using Tapatalk
vampirefo said:
tar is the best.
Sent from my T1 using Tapatalk
Click to expand...
Click to collapse
I know. The problem is how to split the archive. Currently i split by size. In this case you cannot use parts independently. For example, if you want to extract some file, you have to concatenate whole backup first and then extract.
The better way is to split tar at header boundary but so far in many decades of years nobody created such split tool. Also, if there is a file bigger than desired part size, it won't be split and may even produce error if target disk (where backup is saving to) is FAT and file size is bigger than 4GB (extreme case).
sorg said:
Dees_Troy is lying. TWRP graphic engine isn't optimized for any architecture. Even on my SGS4 (ARM) it's slow as snail. Higher resolution - more slower. I see, they've added some code for Qualcomm overlay support. I didn't try it yet, but support only for one CPU manufacturer is nothing. Especially, there is another way to accelerate at around 1000% by SIMD instuctions. Although i've liked TWRP originally, i see developers have no intentions to improve graphics which is the key feature. So, i've decided to throw away TWRP and look at Aroma File Manager.
It has very fast graphics engine with ARM NEON optimization (and with some effort it become SSE4.2 optimized). The only feature missing is backup/restore, but i'm working on that. Actually, Backup/Restore works now. Just thinking about better backup format.
Click to expand...
Click to collapse
@Dees_Troy actually is not lying pixelflinger_static isn't optimize for x86 and Intel used to add libenc to speed up pixelflinger a little, intel later decided to use the more recent version of libminui cause it doesn't use pixelflinger_static and from what i read it a whole lot faster. i imagine @Dees_Troy and team-win are looking into moving away from pixelflinger because of it's draw backs but that is a very big task.
i plan to build against the windriver android-5.0.0_r2.0.1 source this evening cause it includes the icc tool chain when i built the new recovery.launcher against it , it was much much much much much faster hope it has the same affect on twrp
vampirefo said:
Is your problems due to recovery or modules you added? My tethered twrp doesn't have the problems yours does, so I wonder if it's the modules, your packaging perhaps and not the recovery?
Sent from my T1 using Tapatalk
Click to expand...
Click to collapse
I assume maybe I am missing some modules. There is a .ko file named fps_throttle...this led me to the conclusion that maybe the framerate is awefully high (or awefully low ), which could explain this flickering text maybe...
I will include all of the modules in my next build to see if it works better, thanks for the tip!
social-design-concepts said:
@Dees_Troy actually is not lying pixelflinger_static isn't optimize for x86
Click to expand...
Click to collapse
I think, you've missed the point. I've said current TWRP graphics isn't optimized for ALL platforms (besides very specific Qualcomm overlay which i had no chance to try). Nothing to do with x86. Even on ARM device it's very slow. In several years of TWRP existence, i didn't see any progress in GUI, so i don't hope it will be changed anytime soon.
From other side, Aroma File Manager uses NEON(which can be translated to SSE) optimization making interface very fast. Thus, you don't need any special compiler. But due to very different internal GUI engines, it's hard to port TWRP to Aroma GUI. Using 3rd party compiler give you other problems if you try to compile something requiring Android NDK.
Anyway, let me know if your approach with different compiler will make rocket from snail TWRP GUI

[UNOFFICIAL] TWRP 3.0.0-0 for the Pixel C (dragon-ryu) :: Current: 02-11-2016-1

This is UNOFFICIAL TWRP for the Pixel C. That said, the TeamWin team greatly helped me in getting this working. But at the same time, neither TeamWin nor me take any responsibility whatsoever for any undesired outcome resulting from any kind of use of this project and project files! If you don't exactly know what you're doing then just walk away and do something good. Don't touch any options of which you don't exactly know what they're for!
What works:
* So far, everything; encryption support should work, but some feedback on this would be welcome
Problems:
* The GUI will be sometimes slow, sometimes super slow. This is probably due to the high screen resolution of the Pixel C.
How to install:
- Unlock bootloader
- In the bootloader, run "fastboot flash recovery <.img file>"
- Reboot into Pixel C bootloader
- Boot into recovery (or later on/from Android through "adb reboot recovery")
If the recovery doesn't stick after booting into Android:
- Do the install procedure as above
- Do NOT reboot into Android
- Press Vol-Down + Power until you see the bootloader menu
- Select "Boot into Android Recovery"
- When in TWRP, mount system
- Using TWRP's File Manager, or using adb, delete the file "/system/bin/install-recovery.sh"
- Reboot
After doing this, OTAs won't work any longer, but they wouldn't work anyway after installing TWRP. Just so you know
DOWNLOAD
twrp-3.0.0-0-dragon-ryu-02-11-2016-1.img
SHA1 hash: 3e97aae6cc18975683eda2bd3732faaecec14166
Changelog
:: 01-19-2016-1
- Removed screen timeout by default, since the GUI is very slow and the screen unlock slider is very hard to use
- Added an option to fix the Fastboot Full Cap flag directly from TWRP; you find the option in "Advanced". If the Pixel C should ever not let you flash in fastboot, boot into TWRP, select Advanced -> Fix Fastboot, swipe to confirm, and you're set.
:: 02-11-2016-1
- Rebased on twrp/android-6.0 branch (i.e. upgraded to TWRP 3.0.0-0)
The recovery is based on the Pixel C stock kernel.
Awesome! I can survive without root for the time being but being able to enable multiwindow would be amazing!
Thanks!
Edit: I am getting a FAILED (remote: unsupported command) error and cant flash this. Anyone know a work around?
Worked fine for me with "fastboot flash recovery [image name]" did you unlock your bootloader? Also root works just fine, you just have to boot from your PC.
Sent from my Pixel C using Tapatalk
brando56894 said:
Worked fine for me with "fastboot flash recovery [image name]" did you unlock your bootloader? Also root works just fine, you just have to boot from your PC.
Sent from my Pixel C using Tapatalk
Click to expand...
Click to collapse
I did unlock my bootloader but can't get anywhere. Tried updating my sdk, drivers everything. I guess I will have to keep playing with it.
Edit: I relocked my bootloader, and then unlocked it again and now it is working. If anyone else runs into this give it a try.
it successfully installed on my pixel c. is reachable as the Android Recovery option. and boots to bootloader to allow boot of boot.img
this is a good thing. thanks to all involved.
it's been 1 month since release and good way to celebrate.
Good work. Thanks you
hooray thanks! just to clarify: I need encryption disabled to use twrp or just to flash SuperSU?
I'm currently using phhusson's noverity boot-img to boot and with a modified vendor img root is working fine while encryption is enabled ... just having to boot via fastboot every time is a bit awkward. And since I don't know what happens if the device got stuck and reboots itselfe without the modfied boot it would be awesome to have at least a nandroid backup
doumer said:
hooray thanks! just to clarify: I need encryption disabled to use twrp or just to flash SuperSU?
I'm currently using phhusson's noverity boot-img to boot and with a modified vendor img root is working fine while encryption is enabled ... just having to boot via fastboot every time is a bit awkward. And since I don't know what happens if the device got stuck and reboots itselfe without the modfied boot it would be awesome to have at least a nandroid backup
Click to expand...
Click to collapse
Hey... You can use TWRP even with encryption enabled, you just can't write anything to /data.
However for the next build I'm going to enable TWRP's decryption option and see if it works with the Pixel C. If it does I'll post a new build this evening (European Time).
I tried the systemless SuperSU on a decrypted /data partition but it wouldn't work (bootloop), clearly there's a lot of ground to cover here, but like I said maybe the decryption functionality will help us here.
EDIT: I'm also working on a boot.img with disabled forced encryption. Looks like we're going to get proper root very soon.
cheep5k8 said:
This is UNOFFICIAL TWRP for the Pixel C. That said, the TeamWin team greatly helped me in getting this working. But at the same time, neither TeamWin nor me take any responsibility whatsoever for any undesired outcome resulting from any kind of use of this project and project files! If you don't exactly know what you're doing then just walk away and do something good. Don't touch any options of which you don't exactly know what they're for!
What works:
* Well, basically everything IN TWRP works, it's just that without a kernel that disables forced encryption this is not of very much use. I tried flashing SuperSU, but it wouldn't work properly.
Problems:
* The GUI will be sometimes slow, sometimes super slow. This is apparently still a problem with how TWRP uses the graphics mode that is used on the Pixel C. Best is if you immediately disable the screen lock once you boot into TWRP because the unlock slider is abysmally sluggish.
How to install:
- Unlock bootloader
- In the bootloader, run "fastboot flash recovery <.img file>"
- Reboot into Pixel C coreboot bootloader
- Boot into recovery (or later on/from Android through "adb reboot recovery")
DOWNLOAD
2.8.7.0-01082016-1
Click to expand...
Click to collapse
Hello thank you for this. Yesterday I tried to build as well twrp but it wasn't fully working.
I just imported this config with TW_INCLUDE_L_CRYPTO := true && TW_INCLUDE_CRYPTO := true
I didnt copy paste the twrp.fstab I added but added its path to BOAR_smthing.
Also I used omnirom's android-6.0 revision with dragon's device tree.
The recovery seems to boot, as
Code:
adb devices
returns XXXXXx recovery.
Also I can reach the device's shell with adb shell. Just the screen stays black.
I was wondering if I missed something. Is your device tree available online ?
Khaon said:
Hello thank you for this. Yesterday I tried to build as well twrp but it wasn't fully working.
I just imported this config with TW_INCLUDE_L_CRYPTO := true && TW_INCLUDE_CRYPTO := true
I didnt copy paste the twrp.fstab I added but added its path to BOAR_smthing.
Also I used omnirom's android-6.0 revision with dragon's device tree.
The recovery seems to boot, as
Code:
adb devices
returns XXXXXx recovery.
Also I can reach the device's shell with adb shell. Just the screen stays black.
I was wondering if I missed something. Is your device tree available online ?
Click to expand...
Click to collapse
Not yet. I'm going to upload it later on to the TWRP devs for official inclusion.
You need to merge the minui patch so TWRP can use DRM for video on the Pixel C; there is no fb0 device.
there were some new boot images out today. i flashed one of them. when i boot to recovery the sdcard is not able to be mounted. do you have any suggestions on what i need to do or look at in order to get it fixed?
dkryder said:
there were some new boot images out today. i flashed one of them. when i boot to recovery the sdcard is not able to be mounted. do you have any suggestions on what i need to do or look at in order to get it fixed?
Click to expand...
Click to collapse
Because /data is (force-)encrypted. I uploaded a new TWRP build with various fixes but decryption doesn't work.
What I also found out is that the boot image for the Pixel C is NOT an Android boot image (!), but a ChromeOS one. This puts a lot of things in doubt, for example I am not sure if systemless SuperSU can handle this.
But, I'm working on all that (working on boot img without forced encryption right now, but so far it doesn't want to boot completely)
OK, so, I'm running the device unencrypted now, but there are many issues still to resolve.
OK guys, if you really want actual SuperSU, and other root stuff, and decrypted /data, here's how it works but it's complicated and will only work tethered as far as I can tell.
First, download this boot image: dragon-boot-encryptable-01092016-1.img
Now here are the steps:
- make sure you have a stock boot.img handy in case something goes wrong (as usual I can not take responsibility but chances of bricking are extremely slim if you know what you're doing)
- boot into fastboot
- flash the above boot image to boot ("fastboot flash boot dragon-boot....")
- flash the TWRP recovery (latest version) ("fastboot flash recovery twrp-dragon-...")
- hold power+vol down pressed.. the device will turn off, keep it pressed even as it turns off, it will turn on again and you are in the coreboot menu
- select "Android Recovery" which will start TWRP
- in TWRP, select system as read only when it asks ("never write onto the system partition").. my boot image does not disable dm-verity which seems to be still in effect, so if you change /system, the Pixel will refuse to boot (even though it's unlocked... no idea)
- once in TWRP, go to "Wipe" and then choose at the bottom "Format Data" (just wiping will not work)
- when that's done stay in the recovery
- get SuperSU 2.66 from somewhere and flash it through TWRP (using sideload for example)
- when it's done, go to "Backup" in TWRP and only backup boot (the kernel) - no password - no compression
- somehow copy the backed up kernel from the device to your computer ("adb pull" for example), but in no case let the Pixel boot into Android
- when that's done, tell TWRP to boot back into the bootloader
Now get ready to be real quick...
- boot (just boot, not flash) the TWRP backed up boot image (it's 32MB large and called boot.emmc.win, but it's all good): "fastboot boot boot.emmc.win" (and now you have to be rather quick)
- It will boot up for a second and then go back to the "The OS will boot in 30 seconds screen"
- Again press power+vol down and hold it, even as the device turns off, until you're in the coreboot bootloader
- There, choose fastboot again
- And once again boot the boot.emmc.win image ("fastboot boot boot.emmc.win")
- Now let it boot up
- If everything went OK you should be in Android, with decrypted /data, and SuperSU should be installed and working
If you want to avoid being encrypted again (although SuperSU should survive that) you will have to boot tethered everytime using that boot.emmc.win image.
Known Issues: Somehow because /data is decrypted, "Security" settings in Android will crash. Hopefully you don't need anything in there. You might also want to skip setting a lock pattern or pin when doing the initial setup, it might crash too.
So far, I tried installing AdAway using root which worked just fine.
If someone figures out how make this untethered: you da real MVP!
Thank you sir!! I will report back if I encounter any undocumented issues.
OK so I've managed to install Xposed, was pretty straightforward except for the tethered boot. Still looking into making it untethered.
since your modified boot and no encryption it seems to be smoother in graphics. in any event, the thing worked in format of data and install of the supersu zip. so, well done.
cheep5k8 said:
How to install:
- Unlock bootloader
- In the bootloader, run "fastboot flash recovery <.img file>"
- Reboot into Pixel C coreboot bootloader
- Boot into recovery (or later on/from Android through "adb reboot recovery")
DOWNLOAD
2.8.7.0-01082016-2 UPDATE: Includes various fixes from first build; decryption of data does NOT yet work
Click to expand...
Click to collapse
So, followed these instructions and whenever I try to reboot into recovery I get the no command screen. Am I missing something? lol
Edit: So figured thats the stock recovery stuff. Got to the stock recovery but can't get into twrp
2nd Edit: I redownloaded the file and didnt rename it shorter this time and now it works...weird
cheep5k8 said:
Not yet. I'm going to upload it later on to the TWRP devs for official inclusion.
You need to merge the minui patch so TWRP can use DRM for video on the Pixel C; there is no fb0 device.
Click to expand...
Click to collapse
Thank you for those informations .
Thank you so much for this! Aside from the laggy UI, which isn't an issue since we got TWRP (f yes!!!), this is amazing. Do you foresee any issues flashing fonts? I am not familiar with ChromeOS and Android structure combination as it seems there is a lot of talk about. Flashing a file that replaces the stock fonts with the ones of my choosing hypothetically should not pose a problem to /system/fonts/, correct? Thank you for your work

How do you unpack and repack boot.img?

NOTE: Unfortunately I've had to remove links from this post because I'm a new user. I'll add them back in once I have enough posts.
I've been trying to edit a file in boot.img from the CyanogenMod 12.1 (huashan) nightlies but I'm experiencing some issues finding the right tools/methods for the job.
Most scripts I've found expect an Android Magic number at the beginning of the file but this simply isn't there. It seems there is no header at all that matches the specification from bootimg.h (missing link) though I did discover the cmdline argument at the end of the file with a hex editor.
After searching and experimenting for hours I found a script here (missing link) which enabled me to extract the kernel and ramdisk images despite the missing header but now I don't know how to repack the files into a boot.img of the same structure.
I've tried the following but it results in a boot.img that is about 40% larger than the orginal (despite me only adding one line of code) and has an entirely different structure (with an Android Magic number, etc.).
Code:
mkbootimg --base 0x00200000 --pagesize 2048 --kernel boot.img-kernel.gz --ramdisk newramdisk.cpio.gz -o newboot.img
I found this resource (TWRP, missing link) which mentions that Xperia devices have special boot images (or something like that, I didn't understand all of it) - this might explain why the boot.img structure is so different - but I can't find any further documentation on this or instructions on how to deal with the format.
The Xperia devices have a recovery-in-boot arrangement. This means that the recovery is booted using the regular kernel / boot image in the device. Team Win has worked with the FreeXperia device maintainers to come up with a way to extract the ramdisk from the FOTAKernel partition and use the ramdisk from that partition instead of the recovery that is included in the boot image of your device. This means that if you install current CM nightlies and flash TWRP to the FOTAKernel partition, you will be able to use TWRP instead of the CWM or CM recovery that normally comes in a CM boot image. Other boot images including stock kernels can be repacked to include this extraction utility to allow you to use TWRP from the FOTAKernel partition. This setup allows you to choose what recovery you want to have installed and allows you to update your recovery more easily. Unfortunately this setup requires that the boot image that you have installed include the ramdisk extraction utility.
Click to expand...
Click to collapse
So now I'm at a loss at how to continue. I would much appreciate any pointers, ideas or help in general.
@infernalpostcard , hopefully this tool made by @Adrian DC will help you out.
https://github.com/AdrianDC/android_huashan_bootimg_editor
Raienryu said:
@infernalpostcard , hopefully this tool made by @Adrian DC will help you out.
https://github.com/AdrianDC/android_huashan_bootimg_editor
Click to expand...
Click to collapse
Thanks. This looks really promising. I'm trying it out now...
EDIT: It worked! This is exactly what I needed. Unfortunately what I was actually trying to achieve (apply a fix to break a boot-loop my phone gets in, due to an encrypted filesystem) didn't work so I'll have to come up with new ideas.

[GUIDE][XT1789-06+][EU/intl.] How to safely BLunlock/TWRP/Root/BusyBox/Xposed

WARNING #1: operations indicated on this post might potentially brick your device, make it unusable, to cause explosions, eruptions of nearest volcano and a lot of similar disasters.
For sure they will void your warranty in most countries and need all of your data permanently deleted, so make a copy of anything valuable before starting and don't do any operations if you are not a trained guy and sure about what you are going to do.
These are *not* operations for rookies. I will not be responsible in any case about eventual damages. XDA is your friend: if unsure, please ask! :fingers-crossed:
WARNING #2: operations elencated on this post are indicated and first hand tested as working only on Moto Z2 Force (Nash) XT1789-06 GSM/3G/LTE dual sim 6GB RAM 64GB storage unbranded international version on sale on German market with Nougat v.7.1.1 onboard.
They will probably work on most of unlockable bootloader & SIM unlocked versions, included US -04 versions too, but you'll test them yourself.
They are not intended for (US mainly...) CDMA versions (-01 & -03 if I don't go wrong...) since of a bit different hw/fw so avoid to apply them "as is" on those devices.
WARNING #3: there will probably be better methods to obtain same results and, for sure, there would be more in future. This is only a "recap" of what I've found working and applied first hand on my unbranded XT1789-06 Nash - with, IMHO, great results... - on November 2017.
I think this could be useful for many.
WARNING #4: I'm Italian, English is not my first Language, so... be patient!
1. INTRODUCTION
On this guide you will not find anything particularly new and/or not already present on this section of XDA.
So, why this guide? For some reasons...
First of all, to date every guide posted here is for a single operation (e.g. root, TWRP, etc...) and do not take in needed consideration interactions between single operations that, often, can be present, potentially dangerous and/or lead to unexpected behaviours.
More, for a single operation here there are often different posts with different guides/solutions and this could leads to errors and or doubts about what's better for our device...
Last but not the least, to date Nash developers here are mainly from US and so working on devices for the most part provided with branded fw and/or a bit different hw/fw respect to international unbranded versions sold on Europe, Asia, South America & Australia.
From my previous experience with my "old" Griffin (Moto Z) Motorola's fws are often interchangeable between devices with no (or only minimal...) issues at all, but, anyway, having a guide with operations first hand tested on same device is surely safer...
So, in this guide I'll link all best single guides posted here and I'll comment & link them to obtain a single complete "to do list" of works...
2. WHAT WE'LL GET
Following this guide we'll get a Moto Z2 Force with unlocked bootloader, latest available firmware (at present...) on board, a working TWRP recovery, complete root access, BusyBox support (needed for A LOT of interesting sw/tasks...) and Xposed support (I don't think I need to explain Xposed features & benefits here... ).
Taking in consideration how Moto's devices come with a "quite stock/vanilla" Android version on board, they are between the best devices to be rooted & Xposed provided to obtain a great customized system.
If you want to remain stock with your device eventually go with Samsungs (or similar...), but if you want a device that is a "blank canvas" for your customizations, Motorolas and this configuration would quite be the best you could want.
You are surely thinking about lack of Magisk and "SU hiding" solutions... obviously there are reasons for this.
Magisk: I have first hand seen how Magisk is a "very intrusive" software with its installation, it goes to modify *A LOT* of things on system partitions and this could leads to eventual issues/incompatibility.
More, it has its own rooting system (that in my humble opinion isn't better than SuperSU) that I preferred not to use (beneath I think it could be disabled... ) and that could conflict with SuperSU, if not now, maybe on successive Magisk updates (as it happened on my old Griffin... ).
Last but not the least, it seems to still have issues with particular partitioning present on our device (we'll see them later) and with TWRP flashing for same reasons...
Not to mention how, to date, it has really so few functions/modules we can't have using Xposed....
SUhide: there is a detailed guide on how to install succesfully SuperSU with its SUhide function on our device. On the same guide it's reported how that method is uncompatible with Xposed and leads to unsolvable bootloops if we setup both of them.
It is still not clear (to me...) if this is related to SUhide itself or to the different SU installation needed for SUhide to work but, anyway, I preferred Xposed obviously.
Not to mention that for Xposed have been developed some modules to succesfully hidden root (even if I don't know if they already works with Nougat... )
3. LET'S TAKE A LOOK TO OUR DEVICE
Knowledge is power. So, taking a look to our device particular features will help us to avoid errors and eventual issues...
Motorola developed our device with a new configuration/partitioning scheme seen before only on Google Pixels / Pixels XL, making our device probably the first "not Google" one to adopt it.
It is mainly marked by two news:
- there is no more a recovery partition :crying:
- there are two copies of boot and system partitions, called boot_a, boot_b, system_a & system_b and device is capable eventually to boot from every of them :cyclops:
Let's look them in details..
Recovery is obviously still present victory BUT it has no more its own partition, it is instead included in boot partition (where before there was only kernel and little more...) creating a potentially unwanted (by us tweakers, probably wanted by Google for the opposite reason! ) link between boot and recovery where safe rules would want them as unlinked as possible!
This leads to the need to flash a boot.img containing both kernel and recovery when we want to update only one of them (e.g. installing TWRP...) and this will have to be taken in account every time we would go to update kernel, TWRP but even when rooting (in fact, at first, developers were not able to gain root together with TWRP... issue then solved succesfully :highfive.
On Pixels their developers have found some methods to overcome this problem, but on our device, to date, we still don't have a complete solution to this issue. Anyway we are going in the right direction and it will be only matter of time in my opinion (especially since I'm "stressing" our developers to realize a similar solution...! ).
Double partitions for boot & system, often referred as "A/B partitioning" is a system introduced by Google to distribute OTAs in safer & seamless way, without interrupting user work during updates... (bah... ).
They are so totally unuseful as originally designed for US, since of going with TWRP/root, OTAs are no more a solution to upgrade and this partitioning scheme introduced some complications which have led to issues as with Magisk (as already seen...).
BUT as soon as we'll learn how to well manage them, new horizons will open (like updating fw on a partition still having the older one on the other for safety reasons and/or having two different fw versions and be able to choose what to boot from.. ). It's only matter of time...
Anyway in this guide we'll face them ever with safe in mind at the moment...
4. READY? LET'S GO WITH UNLOCKING BOOTLOADER!
If your device has unlockable bootloader (and if it is an international unbranded XT1789-06 it should have...!), you can easily unlock it with this good guide:
https://forum.xda-developers.com/z2-force/how-to/how-to-unlock-bootloader-t-mobile-t3654657
There is no more to say about this guide since it is well done, only some notes:
- guide title speaks of T-Mobile but obviously is suitable for international/unbranded too...
- please note that unlocking bootloader will wipe from your device all data & media storage (and they will be wiped again in successive steps, so *be sure* not having nothing valuable - e.g. your girl pics.. - before starting with procedures);
- install Motorola's latest drivers & fastboot provided on their site as hinted on guide. Don't skip this step to avoid potential issues in successive steps...
- if I don't wrong remember, step 8 of guide has to be repeated two times to confirm unlocking. Anyway look at your console messages and follow directions...
Reboot to system and make a fast configuration (we'll wipe them in minutes... ) to check all is ok and re-enabling usb debugging is preferred.
5. DOWNLOAD & UPDATE YOUR FW
I don't know with what firmware your device will come, BUT if it has anything *before* Nougat v.7.1.1 rel. NXPS26-122-68-1 we well go to update to this for following reasons:
- we need a (good) complete stock fw image to be flashed in case of problems;
- it is updated to September 2017 security patch;
- we have a TWRP with *this exact kernel* (they are linked in same image, remember?) for those (like me... ) which like a "so close to stock as possible" system...
This firmware can be downloaded from the following link: https://mirrors.lolinet.com/firmwar...ubsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip (about 2,35 GB..)
PLEASE NOTE: If you have newer firmware don't use this BUT try to download a matching version with your actual one.
Zipped file has to be fully unzipped into the folder containing fastboot executable (downloaded from Motorola!) on your PC.
If you get any error unzipping, *DON'T FLASH* anything and download again (eventually from another browser/PC).
Fastboot sequence I used is the following:
Code:
fastboot devices
pause
fastboot flash modem NON-HLOS.bin
pause
fastboot flash fsg fsg.mbn
pause
fastboot erase modemst1
pause
fastboot erase modemst2
pause
fastboot flash bluetooth BTFM.bin
pause
fastboot flash dsp adspso.bin
pause
fastboot flash logo logo.bin
pause
fastboot flash boot boot.img
pause
fastboot flash system system.img_sparsechunk.0
pause
fastboot flash system system.img_sparsechunk.1
pause
fastboot flash system system.img_sparsechunk.2
pause
fastboot flash system system.img_sparsechunk.3
pause
fastboot flash system system.img_sparsechunk.4
pause
fastboot flash system system.img_sparsechunk.5
pause
fastboot flash system_b system_b.img_sparsechunk.0
pause
fastboot flash system_b system_b.img_sparsechunk.1
pause
fastboot flash system_b system_b.img_sparsechunk.2
pause
fastboot flash system_b system_b.img_sparsechunk.3
pause
fastboot flash oem oem.img
pause
fastboot erase carrier
pause
fastboot erase cache
pause
fastboot erase userdata
pause
fastboot erase ddr
pause
fastboot reboot
That is ready to be put into a batch file to avoid errors and having the possibility to check results of every single flashing since of pause commands presence (press a key to continue to next file). Batch file has to be placed and started from same folder of fastboot & unzipped files to avoid errors.
Please note:
- I've added a fastboot devices command as first to check if your device is properly connected;
- I've used stock sequence of flashing BUT removed gpt (partitions) and bootloader for safety reasons (no need to flash them usually... and let Motorola upgrading your bootloader rarely is a good choice... )
If all flashes will go fine your device /data would be wiped (yes, again!) and phone will reboot after last command.
If something go wrong stop the sequence by CTRL+C and do not reboot your phone until you have understood/cleared/fixed what has gone wrong.
If fine, again... reboot to system and make a fast configuration (we'll wipe them in minutes... ) to check all is ok and re-enabling usb debugging is preferred.
6. INSTALL TWRP
This is a quite simple step, but you have to take a decision before you start...
I'll provide two different boot+TWRP image files as attachment to chose from (both of them realized by @joemossjr )
First one is composed by stock NPXS26 kernel and TWRP v.2 (it's a 3.1.1-0 in TWRP versions), while the second is composed by a kernel recompiled (with little modifications) from sources by joemossjr and TWRP v.3 (still a 3.1.1-0 in TWRP versions) with some little improvements (you can go to his thread for details on TWRP https://forum.xda-developers.com/z2-force/development/twrp-3-1-1-0-moto-z2-force-nash-t3687421 and to this one for details on Pantheon kernel https://forum.xda-developers.com/z2-force/development/kernel-pantheon-kernel-t3702208 ).
If you are on NXPS software version (flashed before) and want to remain "full stock" go with TWRPNPXS.zip, otherwise (you preferring newest firmware or want all newest features) go with TWRPREV3.zip.
Both files *have to be* decompressed, *can't be directly flashed* and your choice of them has to be flashed in fastboot mode with the command:
Code:
fastboot flash boot TWRPxxxx.img
where xxxx is matching your choice.
If all have gone fine, you can now reboot to recovery and make some backups if you prefer (please note you will need to place them to an sd card or to a plugged USB key, since internal memory will be fully deleted again soon...
PLEASE NOTE: during this phase still *don't enable* TWRP to Mount system as R/W ("Swipe to allow modifications for /system" message...) since it could lead to a not booting system if DM verity check is still enabled (it shouldn't since what @ChainfireXDA reported on Twitter, but it is better to be safe...).
A reboot to system to check all is still ok is preferred. If TWRP asks to install his app files on exit, *be sure* to decline/skip (ever! There is an option in TWRP to disable this request too!).
PLEASE NOTE: this way we are flashing ONLY ONE of the boot partitions with TWRP (usually boot_a) while the other (boot_b) is unaffected. This is a wanted behaviour to stay on "safe side".
PLEASE NOTE: On the linked thread @joemossjr put a flashable zip file to update it from inside TWRP itself which flash both boot_a & boot_b. So if you'll want to update to newer versions (and remain on safe side...) unzip that file too (instead to flash it in TWRP), extract boot.img contained inside and flash it with the same command indicated before.
Please note all newer versions will use Pantheon Kernel.
WARNING: If you will in future reflash kernel/TWRP to update them, you would lose both root & disabled forced encryption!!!
So, after every boot.img flashing *you will need*, before booting system, to boot TWRP and flash again SuperSU before reboot to system.
If you fail to do this you'll face bootloops and/or your /data partition will be corrupted. So a /data backup (on external storage!) before a kernel/TWRP update would be mandatory.
7. ROOT & DECRYPT DEVICE
In this step we will go to finally root the device and decrypt its /data partition. This operation *will delete all data again* on you device (downloaded files & pics too!).
Decryption of /data is needed for many reasons:
- to date TWRP is unable to work with compressed /data (and, anyway, it's ever dangerous to work with encrypted data backups/restore... )
- some advanced software you'll go to use could have issues with encrypted data
- a decrypted device is slightly faster
- you definitely will want it unencrypted... listen to me!
Since our phone will come "force encrypted" (it can't be disabled on stock fw!), we need SuperSU help on this and so we'll need to follow *at perfection* the following provided sequence!
Not all SuperSU are equals (more... they are all different! :silly so, tested working fine version to be used is this: http://download.chainfire.eu/1220/SuperSU/SR5-SuperSU-v2.82-SR5-20171001224502.zip?retrieve_file=1
If newer will be out, don't mind, you could ever upgrade it from inside a working system...
Steps are:
- boot to fastboot mode (from off, VOL DOWN + POWER)
- from fastboot mode select RECOVERY mode
- go to wipe menu and select /data FORMAT (not wipe or factory reset, FORMAT!)
- if you have placed downloaded SuperSU zip file on SDcard or USB key browse to it in TWRP Install menu (otherwise connect your phone to PC and trasfer it to internal memory and then browse for it), then Flash it.
- *do not* and I repeat it, *do NOT* clear cache/dalvik cache
- reboot to system
First boot could take a while and probably it reboots one (or two...) times, but at the end it will boot... :fingers-crossed:
You'll have to reconfigure again your system BUT this time, if all has gone fine, it's the good one, so you can do a better configuration if you want.
You will need a working Play Store for next steps, so add a data SIM and/or a wireless network and setup a Google account to enable it.
To check if all has gone fine you should have:
- a SuperSu icon into apps drawer
- on Settings - Security there should be an option to encrypt your system (DON'T chose it! :silly instead of the previous "encrypted" status..
It could be a good moment to download an useful Root check app. A good one is Root Check by JRummy Apps which is able to check Busybox & Xposed presence too (and more...).
8. BUSYBOX & XPOSED
If you have reached this point and all is fine, now it's very simple to complete.
Both Busybox & Xposed can in fact be installed from inside a working rooted system, so...
- download from Play Store BusyBox (free version) by Stephen (Stericson), open it, grant root permissions and press Install button without wait all the (unuseful) checks
- reboot
- enable in Settings - Security the "unknown sources"
- download from here https://forum.xda-developers.com/attachment.php?attachmentid=4319220&d=1509453299 latest Xposed installer/manager apk
- install it, open it and grant root
- select Xposed v.88.2 (or newer if available) for arm64 (if many options are showed be sure to select this, arm64!!!) and select Install (*NOT* via recovery... simply normal Install)
- when prompted for a reboot, accept it.
Please note first reboot could take a while and, again, it could self reboot one (or two times...). When at last it will reboot... gotcha!!! It's cigar time!!! :victory:
Well... it has been a LONG WORK to write this as simple & complete as possible. I hope to not have inserted any error and to have been enough clear on provided instructions.
If you'll find any errors please report to me for corrections.
Newer & better methods are welcome too.
If you liked this, PLEASE USE THANKS BUTTON!
EneTec
MANY THANKS TO:
@seniorstew
@joemossjr
@jhofseth
@Uzephi
for their useful linked guides and/or great development! :good:
Reserved #1.
Reserved #2.
Awesome guide! One of the most intricate guides that goes over every last detail that I've read on XDA in a long time. Thank you. ?
...
Great guide, thanks for the notes re: Xposed...I kept trying to install from TWRP (habit)
3's&7's said:
Great guide, thanks for the notes re: Xposed...I kept trying to install from TWRP (habit)
Click to expand...
Click to collapse
Our device still needs some cautions & tips...
Issue with Modem/Radio
After following your guide to the letter, my phone would not connect to a mobile network and would say "Error while searching for networks" when I tried to force it to find one. I ended up following this guide to try and get back to a working setup:
https://forum.xda-developers.com/z2...m-stock-november-hybrid-rom-t-mobile-t3712795
Unfortunately, nothing is working. Any help would be greatly appreciated.
Thanks!
-Josh-
I figured it out. Had to use the Flash ALL Package from that other post. The modem firmware is very specific.
might be this is the reason i loose 4G+ (4G instead) signal after flashing lmfao
just Wow!! What a great post!!
Damn! Why did follow this guide!? I knew I didn't need to flash anything but boot/boot_a and stay on stock FW with only TWRP from Pantheon kernel!
Now I have a Moto Z2 Force (Dual SIM, UK, retail) without wifi, mac 02:00:00:00:00:00:00:00 and it cannot switch it on!
Any one have full stock image, at least of the boot partition from Dual SIM, UK?
PS: No need to link to Factory Image Moto Z2 Force (NASH) RETAIL. both of them aren't fixing anything for me.
hashnon said:
Damn! Why did follow this guide!? I knew I didn't need to flash anything but boot/boot_a and stay on stock FW with only TWRP from Pantheon kernel!
Now I have a Moto Z2 Force (Dual SIM, UK, retail) without wifi, mac 02:00:00:00:00:00:00:00 and it cannot switch it on!
Any one have full stock image, at least of the boot partition from Dual SIM, UK?
PS: No need to link to Factory Image Moto Z2 Force (NASH) RETAIL. both of them aren't fixing anything for me.
Click to expand...
Click to collapse
Bitdefender blocked it for me for the longest time, then after reinstalling minimal ADB and Fastboot, Motorola Manager, and allowing access to Windows File Explore through Bitdefender, it worked for me; check your antivirus, hope that helps.
Blocked what? And anyway, I don't have any antivirus. There is brain and Linux for that!
hashnon said:
Blocked what? And anyway, I don't have any antivirus. There is brain and Linux for that!
Click to expand...
Click to collapse
Oh my bad, lol
Ok, fixed it my self, this: https://forum.xda-developers.com/ne...0000000000-t3257465/post65960082#post65960082 gave me general idea what to do and what to check.
hashnon said:
Ok, fixed it my self, this: https://forum.xda-developers.com/ne...0000000000-t3257465/post65960082#post65960082 gave my general idea what to do and what to check.
Click to expand...
Click to collapse
Good to hear that, I got so mad when I went in and tried rooting my Z2F without reading this guide first on the very first day that I got it. ??
Deester4x4jr said:
I figured it out. Had to use the Flash ALL Package from that other post. The modem firmware is very specific.
Click to expand...
Click to collapse
This is intended/tested only on EU/intl. XT1789-06... on what version did you applied all this?
ilovemeow said:
might be this is the reason i loose 4G+ (4G instead) signal after flashing lmfao
Click to expand...
Click to collapse
This is intended/tested only on EU/intl. XT1789-06... on what version did you applied all this?
hashnon said:
Ok, fixed it my self, this: https://forum.xda-developers.com/ne...0000000000-t3257465/post65960082#post65960082 gave me general idea what to do and what to check.
Click to expand...
Click to collapse
This is intended/tested only on EU/intl. XT1789-06... on what version did you applied all this?
How do you fix your wifi issue exactly?

[Resurrection Remix] [Unofficial] [2018-08-19] Treble [Discontinued moved to PIE]

LAST PERSONALLY Verified as working and "stable"*: GAPPS, 8/19 GAPPS
First and foremost, I'm simply compiling this for the OnePlus 6 and am making some small tweaks to include Opengapps and not only Go Apps in the builds.
The parent for this by phhusson can be found at [Resurrection Remix] [Unofficial] [2018-05-19] Phh-Treble
Next the most important information where to get the most current build of the ROM: Google Drive
For now I suggest the version ending in -go such as: 'rr_6_1_180616_system-arm64-ab-go.img.xz' as the '-gapp' is in development, I expect a number of builds over the next few days as I finally the build scripts and then the rate to tapper off to every two weeks or as there are changes that seem to warrant it, I'm not building nightly for no reason, as RR 6.1 is reasonable stable at this time.
Note: Attached (build.sh) is the build script currently being used, it is a work in progress. and will be updated in case you more regular builds. You will need 12GB of Ram Ubuntu 16.04+ (I'm using 18.04 now, but I started with 16.04) and at least 360GB (SSD recommended) to build, and upto 6 hours for the initial run and then 2 for ever additional run.
Many thanks to phhusson for allowing me to post this based off of his work.
Changes, when I have something to report. Not all build will:
The 7/7 build includes a number of patches recommended by DocRambone.
Overlay support to force Apps fullscreen, Under Display->Advanced
Some cleanups to the UI for the round corners
Better LED support
The 7/8 build is the same as 7/7, but includes July security patches, I built it in order to match the official release.
The 7/24 build is again to match the official release
The 8/19 build is again to match the official release, note regression in status bar height I'm looking into.
Second post: will have details on what is working and not
Third Post: will have full instructions on installation, backup restore based on my experiences
* Stable is relative, for me if I consider it usable from day to day it is stable.
As of 8/11/2018
In the GAPPS version
Working:
Fingerprint
Camera (Front and Back) + Flash (Also got the OnePlus Camera working*)
Speaker
Wifi (Some cut outs seen, this is not unique to this ROM and is dependent on the access port some are worse than others, no clue why)
Bluetooth
GPS
Brightness
Slider for Notifications as of 6/18 build
Mobile Data/Voice (tested dual SIMM is working)
Google Apps
Root (using magisk 16.3), told but have not personally tested that 16.4 without changes works as well
Ambient (works serious effect on battery see next post)
Full Screen Aspect Ratio Display->Advanced 7/07/2018 build+
More fully functional LED Improved for at least mounting USB sticks in 7/7 build
USB Host - Fixed for at least mounting USB sticks in 7/24 build
Bluetooth Phone audio is on the local headset. - Fixed in 7/24 build
Seems working NFC working 5.1.11 Vendor and Boot, not working with previous to 5.1.9 Vendor and Boot I have nothing to connect to to fully test
Not Working:
The Notch hides content (need to wait for P)
Unknown:
Camera Quality: I do little with the camera and am no photographer, so I can say nothing about quality, only it installed and took pictures
VaSU# said:
volte kinda works you can receive messages and calls and can send messages but cant call "out"
Click to expand...
Click to collapse
Please let me know if anything is missing, or needs to be added
Instructions to flash, backup ...
WARNING: With 5.1.8 I had no WIFI, so I suggest sticking to 5.1.6 to 5.1.7 FOR THE MOMENT
Instructions to flash, backup ...
Total time required about 90 minutes
Pre-Reqs:
First and foremost:
Start with at least 5.1.6 (or greater, as of writing 5.1.7 was the lastest), there are Treble fixes in 5.1.6 we need.
Second
verify you have a good USB cable (the Red one shipped with the phone is best)
Three
download the oneplus drivers and abd
- USB Drivers: OnePlus 6 USB Drivers for Windows
- ADB/Fastboot: ADB/Fastboot latest mini
Install both to your local system
Four
Download the latest TWRP (get both the img and zip files)
TWRP for OnePlus 6
Five
Download the files(Treble OP6 Files 5.1.6) from:
GUIDE] How to flash Treble roms on OnePlus 6
Extract and keep: vbmeta.img (if you are on 5.1.X where is the boot version you can keep the boot.img as well, if not discard).
Six
Download the lastest Oxygen OS ZIP and bootloader from:
[OnePlus 6][ROM][OTA][Oxygen OS] Mirrors for official Oxygen OS ROMs and OTA updates
As of writing this is:
5.1.6 full image: OnePlus6Oxygen_22_OTA_010_all_1806070151_ad8b19ed516e78.zip
5.1.6 boot: OnePlus6Oxygen_22_OTA_010_all_1806070151_boot.img
Seven
Download Device ID:
Device+ID APK
Eight
Download Magisk for Treble:
Magisk modified for treble
Since as of 6/2018 the default magisk does not support Treble we need a special version I suggest: Magisk-v16.3-factory-faizauthar12-20180406.zip as teh latest I could find with support.
Nine
Recommended download fastboot installable 5.1.6 (or latest build):
[ROM][STOCK][FASTBOOT][OP6] Stock Fastboot ROMs for OnePlus 6
Ten
Include Overlay/Ambient Display.
Download APK at: [Overlay] Enable Night Light, Auto-Brightness, Ambient Display & more on Treble ROM
Eleven
OnePlus Camera:
OnePlus Camera APK's
Finally
Download RR 6.0 for Treble compiled after 7/08/2018:
Either download the gapps or go version (gapps is still a work in progress when I wrote this)
ROMs Google Drive
Getting Ready:
WARNING: you will loss all data on your phone, backup anything you want or need, first.
Make sure you can get to fastboot (enable "Advanced Reboot" in developers options and make sure that you can enter on a reboot by pressing volume-down and power at the same time)
Make sure you are on 5.1.6+ (5.1.6 was the latest firmware upon writing this)
Remove Any security you have set (just to be safe)
Reboot to fastboot (bootloader)
run:
Code:
fastboot oem unlock
"You will be greeted with a Unlock Bootloader Warning page, Hit the Vol button to select Yes and turn it Blue and Hit the Power Button to Execute the selection, allow your device to reboot"
Backup EFS
If you have not already I'd recommend backing up EFS (to do so you need to be rooted, or else use TWRP):
Preferred, if rooted simply open a terminal and run:
Code:
su
dd if=/dev/block/sdf2 of=/sdcard/modemst1.bin bs=2048
dd if=/dev/block/sdf3 of=/sdcard/modemst2.bin bs=2048
Copy these files someplace safe!
If not rooted reboot to fastboot (bootloader):
Ensure that the latest twrp is in the same directory as fastboot (C:\Program Files (x86)\Minimal ADB and Fastboot) and run (3.2.1 was the lastest as of writing this):
Code:
fastboot.exe boot twrp-3.2.1-0-enchilada.img
This will boot the phone into twrp
Allow modification
Select backup
select only EFS and Modem
enter a meaningful name
swipe to backup
click "Reboot System" -> "Do not Install" for TWRP if asked.
You can now locate the backup under /storage/TWRP/BACKUPS and move it to a safe location off the phone.
Backup the Phone
Recommended if you care: Backup your entire phone using TWRP as well:
Ensure that the latest twrp is in the same directory as fastboot (C:\Program Files (x86)\Minimal ADB and Fastboot) and run (3.2.1 was the lastest as of writing this):
- fastboot.exe boot twrp-3.2.1-0-enchilada.img
This will boot the phone into twrp
Allow modification
Select backup
Select Everything except EFS and Modem
enter a meaningful name
swipe to backup
click "Reboot System" -> "Do not Install" for TWRP if asked.
You can now locate the backup under /storage/TWRP/BACKUPS and move it to a safe location off the phone.
Installing RR:
Finally we are ready to install RR (or any other Treble ROM), on the OnePlus 6. You will need a build from 6/7/2018 or later to have the required Vender-Hal to be present.
You will need to locate and install the AB version for the OnePlus 6.
Note: I'm using RR from 6/13 as the base for the guide: system-arm64-ab-gapps.img
SEE FIRST POST FOR CURRENT DOWNLOAD LOCATION I compiled this using phhusson's (Orginial Build Scripts)
instructions and a bit of setup on Linux. However most Treble base ROM's should work so long as they are from after 6/7/2018 in a similar manor.
* Remember this will wipe your device and you will loss all data *
First
boot in to fastboot (bootloader):
We need to go back to TRWRP and wipe internal storage and data to be safe, as the -w option to do so when flashing is not working for me.
- fastboot.exe boot twrp-3.2.1-0-enchilada.img
This will boot the phone into twrp
Allow modification
Select Wipe
Advanced Wipe
Select Cache, Data and "Internal Storage"
Swipe to Wipe
Click back until you are at the main menu
Click on Reboot
Click on Bootloader -> "Do not Install" for TWRP if asked.
Second
Flash the new ROM:
Flash vbmeta.img to remove validation
Code:
fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
To be safe flash a default boot image (5.1.6 in this case)
Code:
fastboot flash boot_a boot.img
fastboot flash boot_b boot.img
Next reboot into recovery (you need to do this with volume down +Power, or selecting from bootload):
In stock recovery select English
Select Wipe Data and Cache
Reset system settings->yes->done
Wipe Cache->Yes->done
Erase everything->Thiscan not be undone, continue->done
back
Advanced
Reboot to fastboot->Reboot to fastboot
Now flash a the new ROM:
- fastboot flash system_a system-arm64-ab-gapps.img
- fastboot flash system_b system-arm64-ab-gapps.img
Three
reboot:
Code:
fastboot reboot
You will see the "andorid" boot screen (this is different that the Oxygen one) and being the first boot it could take a while. If you see no boot screen or it does not boot (give 10 minutes), then you likely need to repeat these steps again. If you boot into RR then continue.
You may get a Vender image mistake error ignore it it only appewars on boot.
Skip the Setup by clicking all four corners top left->top right->bottom right->bottom left (it my take more than one try), at this point you have no networking, that is what we want.
Suggestion make backup here as you have a working OS! -- Instructions to follow
Four
Move over required files: You now have RR installed and working:
Enable developer mode and then enable Advanced Reboot
Then copy over gapps-nano, Device+ ID.apk, magisk-manager apk and magisk installer zip to the phone
To get the magisk manager you need to extract it from the zip as I cloud not get the normal one to install. Extract the zip: Magisk-v16.3-factory-faizauthar12-20180406.zip copy common\magisk.apk to the phone
Five
Deal with: "Play Services not Certified by Google":
Install Device+ID (APK downloaed above) and Open
Once done open the second line shows the GSF ID for this device
Android Register GSF
Login using a gmail account (I suggest the one you use for the playstore)
Enter the GSF in the field, now we wait about 5 to 10 minutes for it to propigate
Reboot the phone as we want paly services to start fresh
First add a wIFI network.
Critical do not let any apps update until you have registered playstore, so if you see a notification saying downloading, select and click pause. Doing so with the updated 6/17 paystore resulted in a black screen where you would enter your password, no know work around other than reset if this happens.
click on playstore it should now start
Now login to your account and you should be go (it may take more than one attempt no idea why).
Now enable the update if previously paused
Update all Apps from the playstore before continuing, this may take a while give it 10 minutes
Optional: If you want remove Device+ID now (but I leave it as it is an easy way to get information).
You now have a working Playstore, if you have hung downloads then you may need to clear the cache for play services and the playstore I assume the unregistered might be the cause of them getting messed up.
Five
Install magisk:
Ensure you copied magisk zip and also the magisk manager apk to your phone, do not open, but click Done
Install the magisk manager, by locating the file in filemanager and selecting it.Reboot into fastbboot (bootloader) mode
Load TWRP:
Code:
fastboot.exe boot twrp-3.2.1-0-enchilada.img
Install
Select the magisk zip from the filesystem and flash
clear cache
Reboot->System (If asked about installing TWRP swipe to install)
Allow the phone to fully boot
Suggested: Reboot the phone
Suggested: disable checks for updates as 5.7 does not work with this build.
Root is now setup.
Six
Installer th onPlus camera:
Many people want the one plus camera, copy the apk downloaed above to the phone.
Open and install via a file manager
Seven
resize Data (as it will be only 11GB), the partitioon will be larger, depending on your devide se we will use TWRP and resize2fs to grow it.
Reboot into fastbboot (bootloader) mode
Load TWRP:
Code:
fastboot.exe boot twrp-3.2.1-0-enchilada.img
Advanced->Terminal
Code:
resize2fs /dev/block/sda17
Reboot System
Eight
Recommended, make a backup of your hard work:
Reboot into fastbboot (bootloader) mode
Load TWRP:
Code:
fastboot.exe boot twrp-3.2.1-0-enchilada.img
Select backup
Select Everything except EFS and Modem (as I'm unsure exactly which you need)
enter a meaningful name
swipe to backup
click "Reboot System" -> Swipe to reboot
Once back in RR copy the backup off the phone
Eight
Start using your OnePlus 6 with RR 6.0, rooted and with GAPPS
Nine
Upgrading:
Upgrading is simply replacing the system partitions and only these paritions (tested going from 6/13->6/16->6/17 builds)
Boot into fastboot (advanced reboot options)
Now flash the new system files:
- fastboot flash system_a new_system-arm64-ab-gapps.img
- fastboot flash system_b new_system-arm64-ab-gapps.img
Load TWRP:
Code:
fastboot.exe boot twrp-3.2.1-0-enchilada.img
Select Wipe
Advanced Wipe
Select Cache (and only Cache)
Swipe to Wipe
Reboot System
Ten
Restoring a Backup from TWRP
*This is a work in progress I can not work out how to do so safely*
Code:
fastboot.exe boot twrp-3.2.1-0-enchilada.img
Select Restore
Select the backup
Select Everything (other than EFS and Modem!)
Got to the main menu
Select Wipe
Advanced Wipe
Select Cache (and only Cache)
Swipe to Wipe
Reboot Fastboot
Eleven
Night Light, Ambient Display, requires Root:
My suggestion is not to do this if you care abut battery as I've seen major drain (even with Ambient display disabled, testing this).
Copy the apk downloaded framework-res__auto_generated_rro.apk to /vendor/overlays
Code:
mount -o rw,remount -t ext4 /vendor
cp <location of file> /vendor/overlay
chcon u:object_r:vendor_overlay_file:s0 /vendor/overlay;chcon u:object_r:vendor_overlay_file:s0 /vendor/overlay/framework-res__auto_generated_rro.apk
Reboot
Comments:
TWRP does not boot if flashed onto RR (the TWRP logo appears but it will not boot), this is currently only go to protect you from using the OnePlus Recovery and messing up RR. Flashing TWRP does not affect booting into RR.
TWRP DOES handle encryption without an issue, even a wrong first pin is not an issue
TWRP making a backup of Treble ROM, backup everything for now: Data, Boot, System, System Image, Vendor, Vendor Image.
If you have problems with hung downloads from the Playstore: Pending hung PlayStore
Wifi can be flaky (appearently this is a more general issue as even stock had some issues, I fixed them by only using either 2.4 or 5Mhz wireless, if I had both active I had constant disconnects.
Worst case, to recovery, back to Oxygen 5.1.6 if you end up in a boot loop stuck booting to rtecovery, etc:
- flash-all.bat
Reboot into recovery (you need to do this with volume down +Power, or selecting from bootload):
In stock recovery select English
Select Wipe Data and Cache
Reset system settings->yes->done
Wipe Cache->Yes->done
Erase everything->This can not be undone, continue->done
back
Advanced
Reboot to fastboot->Reboot
Load TWRP:
Code:
fastboot.exe boot twrp-3.2.1-0-enchilada.img
Copy the Oxygen full ROM back to the phone
Code:
adb push OnePlus6Oxygen_22_OTA_010_all_1806070151_ad8b19ed516e78.zip /sdcard
In TWRP
Install
Select OnePlus6Oxygen_22_OTA_010_all_1806070151_ad8b19ed516e78.zip
Go back to the root and select Advanced Wipe
Select Wipe
Advanced Wipe
Select Cache, Data and "Internal Storage"
Click on Reboot->Recovery (select Do not Install)
English
Wipe Cach and Data
Wipe Everything
Reboot
The phone will reboot same as the day it was made
If it does not then please refer to:
Mega Unbrick Guide for A Hard Bricked OnePlus 6
Note: Always boot fully at least once (I suggest twice and the first one is configuring android) before trying any steps above again.
Best of Luck, see a typo let me know
ERIC
thank you for this
[emoji102][emoji102][emoji102][emoji102][emoji102]
Sent from my ONEPLUS A6003 using Tapatalk
Thank you for putting so much hard work on this. Really much appreciated, will give it a try.
Might be a noob question, but due to treble, is the camera quality the same with the OnePlus app?
saintxseiya said:
Might be a noob question, but due to treble, is the camera quality the same with the OnePlus app?
Click to expand...
Click to collapse
No.
Great rom, I especially like the fact that I can choose to install without gapps (prefer fdroid). One thing that is missing is ambient display, hopefully it will be fixed sooner or later.
Stock OOS Cam on RR. Isn't that huge news? Wow! :good:
Abaddon said:
No.
Click to expand...
Click to collapse
Have you tried this yourself? Ignore the treble part of his comment, but why would stock cam on OOS vs stock cam on custom ROM give different results in terms of picture quality?
Pat123 said:
Stock OOS Cam on RR. Isn't that huge news? Wow! :good:
Have you tried this yourself? Ignore the treble part of his comment, but why would stock cam on OOS vs stock cam on custom ROM give different results in terms of picture quality?
Click to expand...
Click to collapse
same quality here
Pat123 said:
Stock OOS Cam on RR. Isn't that huge news? Wow! :good:
Have you tried this yourself? Ignore the treble part of his comment, but why would stock cam on OOS vs stock cam on custom ROM give different results in terms of picture quality?
Click to expand...
Click to collapse
Never said anything about results, only that it could be installed and works, (takes pictures), personally I do little with the camera and am not photographer, but it can be installed (link above) and installed.
Updated the working to remove any confusion.
Maibol said:
same quality here
Click to expand...
Click to collapse
Could you post some comparison pics? Including portrait shots.
Would be awesome.
saintxseiya said:
Could you post some comparison pics? Including portrait shots.
Would be awesome.
Click to expand...
Click to collapse
sorry bro celebrating today with the family too much beer .....
So seeing this not even a month after the release of the op6 makes me happy and hopeful that we get a fully working RR-OS for the OP6 in the near future !
Pat123 said:
Stock OOS Cam on RR. Isn't that huge news? Wow! :good:
Have you tried this yourself? Ignore the treble part of his comment, but why would stock cam on OOS vs stock cam on custom ROM give different results in terms of picture quality?
Click to expand...
Click to collapse
because Oneplus doesnt release blobs for camera
Pat123 said:
Stock OOS Cam on RR. Isn't that huge news? Wow! :good:
Have you tried this yourself? Ignore the treble part of his comment, but why would stock cam on OOS vs stock cam on custom ROM give different results in terms of picture quality?
Click to expand...
Click to collapse
It will never be the same as OOS stock. Because aside from there is no device tree provided by OnePlus, they will never release the camera blobs due to licensing issues. Once we get a stable and proper gcam port. It'll be better than the stock OOS cam or close
is a beautiful Rom, will there be an adaptation for twrp? I have to use the gapps, because at the go version Wear OS does not work. and in the gapp version would be nice if the smartbar was running. Unfortunately, the kill app does not work ( I can not use xposed, then my bank app will not work anymore
unix2208 said:
is a beautiful Rom, will there be an adaptation for twrp? I have to use the gapps, because at the go version Wear OS does not work. and in the gapp version would be nice if the smartbar was running. Unfortunately, the kill app does not work ( I can not use xposed, then my bank app will not work anymore
Click to expand...
Click to collapse
TWRP not for now as treble is build as an image, but you should be able to flash using twrp just switch to img (though I have not tested that).
The GApps version is posted the 6/18 is working great, see second post.
As for Banking I'm unsure if any Treble based ROM passed the checks, as with or without root, as they appear as unsigned.
As for smartbar, I'll give it a try when I get a chance, as I do not use it personally.
ERIC
So safetynet won't pass?

Categories

Resources