yashsingh1/xdaforums huggingface dataset:
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] Adromir:
from the log:

/data | /dev/block/sda13 | Size: 113981MB Used: 7350MB Free: 91781MB Backup Size: 7350MB
Flags: Can_Be_Mounted Can_Be_Wiped Can_Be_Backed_Up Wipe_During_Factory_Reset Wipe_Available_in_GUI IsPresent Can_Be_Encrypted Has_Data_Media Can_Encrypt_Backup Use_Userdata_Encryption Is_Storage Is_Settings_Storage
Symlink_Path: /data/media/0
Symlink_Mount_Point: /sdcard
Primary_Block_Device: /dev/block/sda13
Length: -16384
Display_Name: Data
Storage_Name: Internal Storage
Backup_Path: /data
Backup_Name: data
Backup_Display_Name: Data
Storage_Path: /data/media/0
[B] Current_File_System: ext4
Fstab_File_System: f2fs[/B]
Backup_Method: files
MTP_Storage_ID: 65537

This looks problematic to me

And i think this is the vital part where the decryption fails:

I:File Based Encryption is present
keyname is ext4:423f7385778d3b23
Unable to find device keyring
Failed to install device key
e4crypt_initialize_global_de returned fail
keyname is ext4:423f7385778d3b23
Unable to find device keyring
Failed to install device key
e4crypt_initialize_global_de returned fail
keyname is ext4:423f7385778d3b23
Unable to find device keyring
Failed to install device key
e4crypt_initialize_global_de returned fail
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] joe2k01:
Hey I just opened a PR in your tree, it remove a bunch of useless lines from makefiles.
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] xdvs23:
Well I already have seen that.
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] moffa~:
I'm using fastboot version 3db08f2c6889-android on Ubuntu Linux 17.04. I've tried the 2 USB2 ports and the 1 USB 3 port (all type A) but it seems like fastboot might be broken - I can't even do a fastboot reboot.

Edit: Tried it using Windows 10 with fastboot version 0e9850346394-android and it worked instantly
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] xdvs23:
Did you try the fastboot package from APT?
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] moffa~:
I was using the adb tools package from https://developer.android.com/studio/releases/platform-tools.html

Using an older version on my desktop (Windows) it worked instantly... go figure.
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] benschhold:
hey [MENTION=6584600]xdvs23[/MENTION]

im using an oneplus 5 now too :)

did you allready extract the ramdisk file from the original boot.img?
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] xdvs23:
Nice to have you here

I have both stock recovery and china twrp extracted.
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] benschhold:
i guess the china recovery is just a port and not compiled?
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] xdvs23:
It is a kang of this: https://github.com/TeamWin/android_device_xiaomi_sagit with the difference that it has the prebuilt OP5 OOS kernel and a few changes specific to op5
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] benschhold:
did you try merge the files one by one from the china one to yours and just repack the file?

to see where the error is
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] xdvs23:
It's probably the kernel

I tried using the prebuilt kernel but I'm not sure if I did it right, do you know how exactly that works?
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] benschhold:
we better talk on some chat

i send you my hangouts link
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] hafiz.hasan:
Y not simply use the recovery which is working perfectly fine..I used it to backup.and flash h2os without any issues..
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] néonaloj:
Hi, thanks a lot for your hard work!!!

Did you try to contact someone to help you, such as [MENTION=702506]dees[/MENTION] troys or someone used with TWRP?

With other people, it would be easier, isnt 'it?

Again thanks for the job!

---------- Post added at 16:55 ---------- Previous post was at 16:54 ----------

The chineese one?
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] hafiz.hasan:
Yes..Chinese.
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] djsubterrain:
Because it's closed source, TWRP is supposed to be open source and available to all.
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] hafiz.hasan:
OK
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] TwinAdk:
I can hear the gears turning all the way over here :svetius:
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] rav101:
Google drive link for those that needed it:

https://drive.google.com/file/d/0B2WrJDB4uA-odWVfM3MxSmtyNkk/view?usp=drivesdk

This is a system and boot backup of 4.5.1 for anyone who is wondering.
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] dekefake:
An advice : if you format /userdata to ext4, the phone will bootloop. You need to use F2FS.
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] djsubterrain:
Nope, my phone already is EXT4, see my earlier screenshot (attached again below). There's also discussion on the OnePlus forums asking why EXT4 has been used again.
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] Manvender:
ADB sideload doesn't seem to be working.

Edit: My bad, works now.
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] Makrilli:
My userdata is f2fs, at least after wiping in twrp.
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] Mr.Ak:
I am also using Tipo-Great device! :D
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] djsubterrain:
Hmm, might be default then cos I did erase the userdata and then format it again via fastboot, didn't specify a filesystem though. Although there has been a discussion on the OnePlus forums asking why the default is EXT4 so I'm not sure. I think I'll leave it as is until we get a completely working TWRP to reformat it.
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] TommyRayHandley:
Saved my ass, thanks ???
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] dekefake:
My op5 refused to boot ext4 userdata. As soon as I formatted it to f2fs it worked flawesely. Running stock rooted
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] saintxseiya:
how did you flash this file?
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] Interceptor777:
Restore backup through TWRP
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] rav101:
You basically have to have TWRP/BACKUPS/(YOURPHONEID)/(ANYFOLDERNAME)/. The files must be saved in this folder format on your internal storage. Your phone id will be the id of your phone when you use ADB devices. Hope that helps.

---------- Post added at 07:28 PM ---------- Previous post was at 07:12 PM ----------

No problem dude.

Had the time and ability and happy to help. I'm also hoping it can help kick off development too??
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] oF2pks:
Don't you need TARGET_USERIMAGES_USE_F2FS := true

in boardconfig.mk https://github.com/xdevs23/android_device_oneplus_cheeseburger-twrp/blob/android-7.1/BoardConfig.mk ?
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] xdvs23:
Nope, user images are ext4
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] TwinAdk:
I unlocked and flashed twrp and then su, no format or anything, I'm on ext4.

Which is best for the OP5? The UFS 2.1 is insanely fast anyway!
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] néonaloj:
I suppose you didn't use the TWRP version from this thread, did you?
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] Senaxo:
It works everything without problems.

I now have TWRP and root :).

I did not have to format anything ;).
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] néonaloj:
Sorry for the same question, but wich version of TWRP?

Thanks!
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] dkryder:
so i'd like to ask if twrp-oneplus5-21.img is a "working" "english" version and perhaps a recent build? thank you.
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] xdvs23:
I'm working together with [MENTION=4729623]benschhold[/MENTION] to get this working. We found out what is wrong and are looking for a solution and trying out some of them.
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] TwinAdk:
Sorry no, the Chinese version. I have later flashed another twrp linked here, by someone stating it was the latest of yours, and that booted (asked for my lockscreen password and decrypted fine)
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] El Montezuma:
No, it's still a test version.

WIP in the title [emoji6]
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] TwinAdk:
[MENTION=6584600]xdvs23[/MENTION]

MD5 - 57ccd87d7c1e1c5b313e419214b6f02a

Filename - twrp-3.1.1-0-oneplus5.img
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] djsubterrain:
That's the chinese closed source one which is not preferable, cos if it's closed source then you don't know exactly what's in it. Having said that, it's the one we're having to use at the moment. Shouldn't be too long before we get a legit version though.
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] TwinAdk:
I'm switching the second its possible ;):highfive:

Closed source, Chinese and unrestricted access.... Somehow I don't like it! :laugh:
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] xdvs23:
Encryption is fixed... well, more workarounded than fixed, but it works: New image
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] hibby50:
Thanks for all your hard work, unfortunately I am lactose intolerant and can't eat cheese on my burgers :p lol. Why do you say its a workaround?

EDIT: working here!
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] rwallhtc:
Great news. Any ideas how we can get the recovery to stick.
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] hibby50:
flashing magisk v13 beta worked for me
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] rwallhtc:
Thanks I'll have a go now
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] xdvs23:
OnePlus actually names it cheeseburger, so I changed that now after persuading my laziness.

Workaround because it is hacky. Take a look at this hackery
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] xdvs23:
Thank you all as well as the very kind testers who helped getting this far.

I hope to get the rest sorted out so that it is not hacky anymore and then I can submit this to TWRP and have it go official.
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] hibby50:
lolol this is why I hate programming, I'm more of a hardware guy. But i've written my fair share of programs like that. "It works! IDK why it works but it works! I'll just save it and stop messing with it" (add one line of code) "32 compilations errors and 156 warnings... ****"
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] iamelton:
great news to hear! thx for the work..
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] xdvs23:
Well I actually know now what exactly is wrong and where to work on, just have to find out how exactly I have to change it.
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] hibby50:
good to know! if you need any logs or help with anything further shoot me a PM.
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] djsubterrain:
Is it DM-Verity related like the 3T nonsense was? Nice work btw

Confirmed working here too, gonna redo my backup since it was done with the Chinese version before.

Should it be prompting for a pass/pin on each launch?
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] TwinAdk:
Delete a file located in /system, can't remember its name. It's here on the forum somewhere!
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] xdvs23:
Not really verity related. There is a problem with encryption detection which only works halfway. So there's where the problem comes from.

I'm not sure but it should ask for the pass/pin on every launch. Wouldn't be very cool to store it as plaintext somewhere.
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] TwinAdk:
Like I said, switching TWRP! Congratulations!!! :highfive::laugh::victory:
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] saccentekennedy:
I've got the Chinese TWRP installed at the moment. Let's say for argument sake it's a little dodgy... I'd rather install this version, but I feel like it would be better to wait until it's been officially adopted and, stable isn't really the word since I'm sure it's stable, but, less fresh. Am I putting anything at risk leaving the Chinese TWRP on for a few more days?
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] xdvs23:
You can use this one without problems.

Testers reported that everything including backups, install, mounts, OTG, encryption, reboots, vibration, buttons and more is working.

I will send this in to TWRP to make it official as soon as I got everything cleaned up
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] 3DSammy:
Isn't that a question on how much you're personally ready to trust code that cannot be examined by the community? No one can tell you what the Chinese TWRP version contains so can't assess the risk for you and your phone. So ask yourself, "Do your Feel Lucky?".
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] xdvs23:
I can't actually prove it but I'm pretty sure that the TWRP contains modified source code from omni (which I had to do as well to get around encryption, but here are the changes I did).

Also the chinese guy behind it simply took an existing tree from another device and modified it for op5 without giving any credit.

Even though I haven't found anything malicious in it, at least in the non-binary parts, nobody can ensure that the modified sources are safe.
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] néonaloj:
Dev, you're a great guy! Not only did you work for hours and hours to get this to work, but you had to find a workaround for problems I don't even understand, lol.

So you deserve a good beer and a good night, at least!

Thanks a lot for the job, to you, your friend and everyone invovlved in this :)

I only have one little issue, I can't decrypt my OP5 as I did many times with my OP3... With this last, I always decrypted it writing "fastboot format data" in fastboot mode o.c.. With the OP5, it does erase the phone, but you're still encrypted. If someone has an idea? Thanks, and thanks again for the great job!
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] saccentekennedy:
So I've installed this version and I'm happy to say that it works perfectly, except for one thing. On my Nexus 6P, I was able to back up to and flash files from a USB OTG stick. Neither the Chinese TWRP nor this one will see the USB or mount it. Am I doing something wrong or is this a OnePlus thing to do with hardware?
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] djsubterrain:
You need to run the rom, set it up including setting a lock (preferably pin) and then use that pin when launching the TWRP and you should be fine, that's what I've done.
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] néonaloj:
Thanks for your reply, but in fact my english is very bad...

I was talking about the encryption thing, not the pass/pin code/schema asked at boot of twrp ;)
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] xdvs23:
Decryption should work just fine, no need for formatting anything.
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] 3DSammy:
Did you find a way around this issue? I have it while trying to flash this latest (working) recovery image. I also tried as suggested in the reply to you multiple USB ports but with no luck. For my install "Linux Mint" I'm using the latest adb package that works perfectly with my Nexus 5 phone. Displays "Android Debug Bridge version 1.0.32" in help although I cannot figure out how to get fastboot to reveal its version.

Any suggestions are welcome as I'm currently stuck with my own error:

sending 'recovery' (25068 KB)...
FAILED (remote: Requested download size is more than max allowed
)
finished. total time: 0.001s
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] xdvs23:
Windows probably works in this case (unfortunately), so I guess that's the only way out atm (damn oneplus)
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] xdvs23:
New image

This one should work, it contains some cleanup.
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] 3DSammy:
Thanks for the suggestion. So I'll have to wade into the deep end of the pool as I only have Windows as a Virtualbox image. Although I did all my Samsung Galaxy TabS 10.5" rooting and firmware updates using that VM windows image which always worked. I'll send an update if that works but I've run out of time for today and tomorrow is a family day.

Thanks so much for all your hard work as it's much appreciated.
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] benc88:
Cheeseburger sounds good to me! Let's give it a bite
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] moffa~:
If you run fastboot --version it'll display the version. I ended up getting it working by using my desktop with Windows 10 and fastboot version 0e9850346394. 1.0.32 is very old though. Not sure if the desktop fixed it (as opposed to a laptop) or the older fastboot version. I used the same cable to both machines.
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] xdvs23:
Would have been better if it was Double New York Beef Bacon Burger, no?

I guess they ran out of ideas :D :laugh:
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] xdvs23:
As I already said, OnePlus did a terrible job at the bootloader, that's why we are having such issues. Correct me if I am wrong but that's the only thing that makes sense. Looking at the bootloader you can see that they put zero effort in it.
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] néonaloj:
I tried in fastboot mode "fastboot format userdata", as I did many times with my OP3, it erased the phone, but I'm still encrypted. If you have another solution?

(I never ever had to flash dm-verity thing, nor to format in TWRP, that's perhaps the solution?)

Thanks for all, for sure for the recovery, you're a great guy!
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] Interceptor777:
Just flash TWRP and format from there.
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] rwallhtc:
So i found this out a little earlier that if i take a backup of Boot, Data (excl. Storage), Recovery, System and System Image then delete the cache, data and system partitions then restore my backup the phone bootloops. if i just restore system and boot it starts like new. any input?

edit:- just tested and if i try to restore data (excl. Storage) it bootloops. all the other partitions seems to be just fine
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] xdvs23:
Try booting the ROM as suggested before and set up lockscreen security.

Then try TWRP again.

It should be able to decrypt your data.
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] xdvs23:
What exactly did you delete?
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] rwallhtc:
bit of a story

So i literally backed up the partitions:

Boot, Data (excl. storage), recovery, system and system image

as per suggestion before i installed the experience rom i wiped cashe, data and system. then i installed the rom. on boot it looped.

i restored my full backup and it looped.

i then downloaded the nandroid backup from earlier in the thread and restored just the system and boot partitions as that is all was backed up. obviously i played a little and found that if i try to restore the backup of "data (excl. storage)" then it causes a boot loop.

This means that it isnt backing up/ restoring apps and alike. its a fresh phone each time or a bootloop
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] Funk Wizard:
As discussed on my thread, for decryption please refer to this post on my thread.

[MENTION=6584600]xdvs23[/MENTION] Many Thanks buddy for all your efforts and working TWRP, I have shared your TWRP on my thread here | All Credits to You :highfive:

Made a switch from Chinese TWRP to the Cheeseburger-46 which works fine. I see that version 50 is out, should i upgrade or just stay with 46.
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] xperia_c4_hater:
Thanks soooo much to the dev and the testers! I didn't test, although I got it yesterday because of my inexperience. If I bricked it, I wouldn't know what to do.

Okay, I think I'm going to attempt this "stable enough" version of TWRP, but it seems that I must set a screen lock. Just to confirm, is that correct? Would I just be able to use "default_password" instead?
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] xdvs23:
You can upgrade and if you get problems, just go back to 46
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] xdvs23:
Maybe that could work too.

I'm not very sure because I'm rather new to this encryption stuff so I guess we all just have to share experiences to know what exactly to do when.
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] Funk Wizard:
Ok.. Many Thanks buddy, i look forward to the final Official TWRP from You soon :highfive:
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] Flint2:
Why don't you link TWRP to this thread's OP instead of direct download that is changing?
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] xdvs23:
That's a legit question. +1
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] Funk Wizard:
Done :good:
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] 3DSammy:
Well I tried my Win10 Virtualbox image and while "fastboot devices" correctly identifies the OP5, flashing the new TWRP recovery image fails with the same message as with my Linux fastboot attempt. My fastboot version in Win10 is different than yours being eac51f2bb6a8-android but I doubt that is the issue.

Guess I'll think on it and maybe even try a USB Win10 setup but I have my doubts.
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] moffa~:
I'm sure Linux should be fine. I tried fastboot via https://developer.android.com/studio/releases/platform-tools.html package but I didn't get anywhere. I tried again via Android Sdk and it seemed to work. Not sure if its because something was updated or fixed as they both are the same version number or maybe it's just because the flash took the first time.
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] 3DSammy:
One thing you mentioned was that you used a different machine with success. Does the failing machine have USB3 ports while the successful machine only USB2? My PC has both.
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] moffa~:
They both have usb 3 and usb 2 ports. I got it working using the usb2 on the desktop, I didn't try the usb 3 ones. I don't want to take this thread off-topic though.
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] hibby50:
FWIW when I got it to work it was on a different USB 3 port, same computer, my laptop only has USB 3
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] Robfozz:
I cant flash these recoveries at all. Fastboot gives me the download size too large error every time. Help?
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] windywolf1988:
First of all my sincere thanks to the OP!

And I am now porting the thread to official Chinese Oneplus BBS.

The author and OP link will be emphasized. If [MENTION=6584600]xdvs23[/MENTION] finds it unacceptable and I will delete the thread immediately.
[OnePlus 5 ROMs, Kernels, Recoveries, & Other Devel] goran_oh:
Great job!