yashsingh1/xdaforums huggingface dataset:
[BLU R1 HD Guides, News, & Discussion] jasonmerc:
I read something about being able to do that. Antonio mentioned it briefly. I believe you need a special command and you need to know the hex memory location of recovery, which we already do. It should be possible, but idk if we can with this thing's weird locked bootloader and unsigned code prevention.

EDIT: Listen to bullet
[BLU R1 HD Guides, News, & Discussion] mrmazak:
reading back all parts

running into trouble using bullet 25 scatter file.

scatter file length for last three partitions give alignment error. (hex is not in 4096 integer i assume)
[BLU R1 HD Guides, News, & Discussion] bullet25:
I probably don't have correct enough lengths in hex for the last three then. Like I said, I really have no idea what I'm doing, but it worked enough to recover a bricked device and we know we can at least flash a boot/recovery images with it.
[BLU R1 HD Guides, News, & Discussion] lopestom:
This is a good ideia if systgem.img modified work with scatter modified.

[MENTION=5312578]mrmazak[/MENTION] have system.img from device but is need confirmation if that file is really system. So after (if is rigth) he can test repack modified system.img with SPFT...

[MENTION=5006327]jasonmerc[/MENTION] can have the system.img with same process.
[BLU R1 HD Guides, News, & Discussion] waingro808:
Guys and gals, this might sound crazy, but I haven't had ads on my lockscreen for the last 24 hours. I used XDA Debloater tool to block all packages EXCEPT com.amazon.phoenix After I did this, I'm pretty sure I did have ads (I don't really pay attention to them), but then a few hours later I noticed the ad wasn't there anymore. After several reboots and 24 hours, it's still not there. I never logged in Amazon and never took the OTA update.

See screenshots. Hope this lasts and maybe someone else can replicate.
[BLU R1 HD Guides, News, & Discussion] bibikalka:
OK, I could readback the system image, and download it back to the R1 multiple times (using the scatter file posted earlier, and SPFT). However, I was unable to inject SuperSu fully, there seem to be some other security related things on Android 6.0, so adding SuperSu is not straightfoward. I tried to replicate the permissions to the best of my ability, but could not get it to work yet :(
[BLU R1 HD Guides, News, & Discussion] bullet25:
I know that 6.0 has some thing about system apps where it doesn't give correct permissions unless its first boot. Maybe flash the modified system image then in stock recovery preform a factory reset? A factory reset should keep the system partition in tact without rewriting it to stock right?
[BLU R1 HD Guides, News, & Discussion] lopestom:
Need read to learning: http://xdaforums.com/general/general/lenovo-k4-note-marshmallow-twrp-root-t3368937
[BLU R1 HD Guides, News, & Discussion] jasonmerc:
Well, Antonio and Mazak got TWRP to boot (fastboot boot not flash). Mount points are wrong, but it booted.
[BLU R1 HD Guides, News, & Discussion] triggerlord:
Waht, isn't that what I said? :P
[BLU R1 HD Guides, News, & Discussion] bullet25:
Yes but those are the unlocked boot loader phones if irc.

The Amazon variant won't allow that.
[BLU R1 HD Guides, News, & Discussion] triggerlord:
It looks like the FM radio is enabled. (I thought this was interesting.)
[BLU R1 HD Guides, News, & Discussion] bibikalka:
OK, that's cool ! I will then stop my patching attempts for /system & SuperSu and wait for proper TWRP !
[BLU R1 HD Guides, News, & Discussion] mrmazak:
Tepr booted

Not sure how long it will be for next step. But twrp is booted and seems to work with non prime version.
[BLU R1 HD Guides, News, & Discussion] triggerlord:
Seems like we need to gain root on the prime version and enable the "oem unlock" function (it's in the build.prop or something).

ORRRRRRR use flash fire.
[BLU R1 HD Guides, News, & Discussion] jasonmerc:
Big news guys, [MENTION=4939713]lopestom[/MENTION] just made a completely functioning TWRP recovery for the vanilla R1, with working root bash shell. He's building for the Prime one next. All we need to know how to do is flash it to test for Prime.
[BLU R1 HD Guides, News, & Discussion] bullet25:
Nice, nice, nice. Could maybe SPFT still work? Maybe the last "test" recovery was corrupt somehow and that's why it would kick back to android?
[BLU R1 HD Guides, News, & Discussion] jasonmerc:
What I did:

Flash TWRP with SPFT

Force off, reboot to fastboot

Force off once again, reboot to recovery

TWRP HAS BOOTED ON MY DEVICE

[MENTION=3471223]bullet25[/MENTION] you may be right about corrupt recovery. Either way, we have one working that seems to work with all mount points. Gonna see if I can remove the bootloader unlock restriction once I get the OK from Antonio.
[BLU R1 HD Guides, News, & Discussion] bullet25:
Sweet, what are the chances we might see a download soon? :)
[BLU R1 HD Guides, News, & Discussion] triggerlord:
For clarity. You're saying it booted on the prime version?
[BLU R1 HD Guides, News, & Discussion] jasonmerc:
[MENTION=7143715]triggerlord[/MENTION] it booted on my Prime version. You heard me right.

[MENTION=3471223]bullet25[/MENTION] Once I backup all my system partitions I'll speak to him about it. I'd think this will be released very soon.
[BLU R1 HD Guides, News, & Discussion] bullet25:
Working TWRP for both variants and yet somehow we don't have a sub forum yet...
[BLU R1 HD Guides, News, & Discussion] jasonmerc:
Once I advertise on the first post in big bold letters that we have root (if it flashes) and recovery, a sub forum will surely follow soon.

Imagine if this made front page XDA news. That's certainly possible...
[BLU R1 HD Guides, News, & Discussion] triggerlord:
Do you know if it works with the v6.4 update?
[BLU R1 HD Guides, News, & Discussion] jasonmerc:
I have the V6.4 update :)
[BLU R1 HD Guides, News, & Discussion] bullet25:
Interesting, I don't yet. I'd like to see if I have an issue getting the TWRP to boot that way or if something accidentally changed in the 6.4 update to allow it to boot.

Maybe the original test recovery wasn't bad.
[BLU R1 HD Guides, News, & Discussion] jasonmerc:
It was a corrupt recovery most likely. I had the same issue as you with V6.4. If possible, I'd stay downgraded for as long as possible.
[BLU R1 HD Guides, News, & Discussion] bullet25:
Okay nevermind. Ignore what I said. :p
[BLU R1 HD Guides, News, & Discussion] triggerlord:
Hyyyyyyyyyyyyyype :silly:
[BLU R1 HD Guides, News, & Discussion] jasonmerc:
Just flashed the SuperSU zip in TWRP. So far so good. A few reboots so far, keep your fingers crossed.
[BLU R1 HD Guides, News, & Discussion] jasonmerc:
Ladies and gentlemen, we have root!!!

Download this file, flash the included recovery that Antonio made with the included scatter file Bullet made. Make sure you are using the latest SP Flash Tools V. 1628. Please note this is only for the Prime variant, the vanilla variant recovery will be coming soon. MrMazak will probably post about that.

Also note this was only tested on the 16gb variant of the Prime Phone. We are not sure if this will work on the 8gb variant. Flash at your own risk!

Extract the contents of the zip I posted to the same directory. They must be in the same directory to work. Turn off your R1 and unplug it from your PC.

To flash with SP Flash Tools, simply open the tool, load the scatter file you got from the zip, and a check box should be next to the recovery section of the flashing screen. Make sure flashing is set to Download Only, and click Download. Make sure your R1 is completely off, and plug it in to your computer. After a second or so it will start flashing.

At first boot, mount system as READ ONLY, and make a nand backup of your device. Backup ALL PARTITIONS, data and cache optional. DO NOT FLASH ANYTHING UNTIL YOU HAVE MADE A BACKUP OF THESE PARTITIONS AND YOU HAVE STORED THAT BACKUP SOMEWHERE SAFE! Copy the backup to your PC, then mount system read-write in the Mounts menu and flash the SuperSU recovery zip. Reboot immediately after flashing. It will boot loop once or twice, then you will boot with root access.

Big thanks to [MENTION=4939713]lopestom[/MENTION] for working with me for multiple days to get this to work. We would not be where we are right now without him. Also thanks to [MENTION=5312578]mrmazak[/MENTION] for risking his Vanilla R1 to help bring a custom recovery to the rest of us! And let's not forget about [MENTION=3471223]bullet25[/MENTION] for his working scatter file for our device!

EDIT: Alternate download link, brought to you by [MENTION=4592012]Oscar_david[/MENTION] https://www.dropbox.com/s/82vull03ywxbmxj/TWRP_Scatter_R1_Prime.zip?dl=0

EDIT 2: For those of you that may need more in-depth instructions, [MENTION=1620588]jacewt[/MENTION] made a more detailed post explaining all of the steps: https://tapatalk.com/shareLink?url=...hare_tid=3418354&share_fid=3793&share_type=t﻿
[BLU R1 HD Guides, News, & Discussion] waingro808:
Wow, you guys are awesome!
[BLU R1 HD Guides, News, & Discussion] jasonmerc:
Mazak will soon follow with the vanilla variant of recovery. His methods will be using fastboot rather than SPFT, as frankly you should use fastboot if you can as it's a lot safer. Prime Phone users can't use fastboot so for us we need SPFT.

The same goes for the vanilla recovery: it was only tested on a 16gb variant. 8gb users be warned and flash at your own risk!
[BLU R1 HD Guides, News, & Discussion] bullet25:
Backing up the phone now. Hells yeah. I'm probably going to pick up another one of these now!

Now we need to get working on unlocked bootloader and Cyanogenmod.

EDIT: Also confirmed working on the shipped, non-updated OTA.
[BLU R1 HD Guides, News, & Discussion] triggerlord:
What happens if you enable oem unlock in the prop file?
[BLU R1 HD Guides, News, & Discussion] jasonmerc:
Working on it now. Will also enable in the /dev/__properties__ file.
[BLU R1 HD Guides, News, & Discussion] Oscar_david:
This just made my day!

Quick question, just to clarify: doest it make a difference for those of us who did the ota update?

Also, I'm not a big fan of mega. Would it be alright if I host the file on box?

Thanks.
[BLU R1 HD Guides, News, & Discussion] jasonmerc:
[MENTION=3471223]bullet25[/MENTION] confirmed it works on an older OTA. [MENTION=7143715]triggerlord[/MENTION] and I confirm it works in the latest OTA. Feel free to host wherever you want and post the link, I'll add it to my post as well.
[BLU R1 HD Guides, News, & Discussion] triggerlord:
It works on the latest update! :D
[BLU R1 HD Guides, News, & Discussion] Varxxyy:
tutorial please?
[BLU R1 HD Guides, News, & Discussion] jasonmerc:
Go back a page, there's instructions.

I couldn't find anything regarding oem unlock in build.prop, but whenever I set the allow oem unlock in the /dev/__properties__ file to 1 and save, my phone locks up and freezes. I force reboot and it resets it to 0. This will be a tricky one.

EDIT: Booting to fastboot and trying to issue an oem unlock doesn't work, as for some reason my pc cant detect the phone. I'll try updating ADB.

EDIT2: Updating ADB did nothing. Just noticed a green dead pixel on my screen and now I can't unnotice it. Damn you warranty policies.
[BLU R1 HD Guides, News, & Discussion] bullet25:
Ay yes. All the roots.
[BLU R1 HD Guides, News, & Discussion] Varxxyy:
a bit more in depth im confused. sorry.
[BLU R1 HD Guides, News, & Discussion] jasonmerc:
Can you change the build.prop property and see if you can unlock bootloader? It'll erase user data and you'll have to root again, but imagine how worth-it it'll be.

Antonio made a video for another device on how to use SP Flash Tools. I'll try to post it soon.
[BLU R1 HD Guides, News, & Discussion] Varxxyy:
thanks!
[BLU R1 HD Guides, News, & Discussion] emc2cube:
Backup in progress.

Nice work everyone!
[BLU R1 HD Guides, News, & Discussion] triggerlord:
I think I'm not using the correct version of SPFT. It won't load the scatter file.
[BLU R1 HD Guides, News, & Discussion] mrmazak:
For NONE prime R1HD

the attached recovery img is TWRP 3.0.2-1 for the no prime RiHD.

prerequisite to using is to have knowledge of ADB and fastboot usage.

I have multiple drivers installed for both but standard google adb drivers should be all you need.

this will do. http://xdaforums.com/showthread.php?p=48915118#post48915118

** first make backup of boot, and recovery partitions with SPFT.

unfortunatly readback of partitions requires manually entering memory hex locations, generic guide on using read back here.

1. become developer on device and enable developer options.

2> enable adb

3. enable oem unlocking

4. open cmd or terminal and command adb reboot bootloader

5, phone should have rebooted, now verify connection with fastboot devices

6. fastboot oem unlock (this will factory reset device and wipe the date partition)

7. setup device with setup wizzard or just skip through

8. become developer again and enable usb debuging again

9. adb reboot bootloader

10. fastboot boot (enter the location of your downloaded recovery img)(you can drag the file from explorer to the terminal window and the path will be filled in)

11. twpr recovery should have booted

12. DO NOT modify system at this point!!!!!

13. make FULL backup of all partitions

14. now you have a functioning recovery and have not changed phone at all

15. up to you at this point to flash supersu.zip to have root. If so download from http://xdaforums.com/showthread.php?t=1538053

enjoy

file md5: 3c3792c0a36b214de40d4ef155eb33a5
[BLU R1 HD Guides, News, & Discussion] calm_depression:
Your a legend.
[BLU R1 HD Guides, News, & Discussion] bullet25:
Just tried. It stayed in the build.prop file but it still is on a 0 with adb shell getprop. It has to be the /dev/__properties__ file controlling it.

even tried a adb shell su setprop sys.oem_unlock_allowed 1. It sets the prop but on a reboot its back to 0 and even clearing the settings data and going back into dev options its still not there.
[BLU R1 HD Guides, News, & Discussion] jasonmerc:
There's a prop in build.prop about antibricking that's set to 2 by default. I set it to 0 and it still gave me issues. I'm about to shower, so you should set it to 1 and try again.

EDIT: Try to copy it to the SD card, edit it there and save, then do a DD command to move it back to original location.
[BLU R1 HD Guides, News, & Discussion] Varxxyy:
so where do i put files?
[BLU R1 HD Guides, News, & Discussion] jasonmerc:
Make sure you are on the latest SPFT. It is build 1628. Build 1620 should also work.
[BLU R1 HD Guides, News, & Discussion] triggerlord:
I've got it to download the recovery but it doesn't boot it. Is there a key combo I'm missing?
[BLU R1 HD Guides, News, & Discussion] bullet25:
Anti bricking setting stayed at 1 but the sys.oem unlock went back to 0
[BLU R1 HD Guides, News, & Discussion] krchi:
Is it working on the ota updated R1 HD or the stock firmware?

Edit: Nvm I figured it out, I'm gonna give it a try to see if maybe afterwards I can tinker with system and fix wifi.
[BLU R1 HD Guides, News, & Discussion] triggerlord:
NVM, I figured it out.
[BLU R1 HD Guides, News, & Discussion] bynarie:
ad removal?

So now that we have root, how do we permanently get rid of the ads? I've deleted almost every amazon package, including com.amazon.phoenix and still see ads. BTW - Excellent job with finding a way to port and flash TWRP. Now we are set.
[BLU R1 HD Guides, News, & Discussion] bullet25:
Okay, I've tried many different ways. Either something is overwriting the build.prop of sys.oem_unlock_allowed on boot or its not controlled by build.prop. It resets to 0 every boot

I have work in the morning so I'm going to bed. If I'm able to I might be able to try some stuff at work tomorrow if we have some downtime, if you have suggestions.
[BLU R1 HD Guides, News, & Discussion] mrmazak:
i dont have the prime so i need to ask. Have you looked in the default.prop
[BLU R1 HD Guides, News, & Discussion] Varxxyy:
how do i change read/write?
[BLU R1 HD Guides, News, & Discussion] jasonmerc:
Are you on the 8gb or 16? This was untested on the 8, it may be a problem for it.

Hold power+Vol up till you get to a boot selection screen, then use volume keys to navigate to recovery and press power to boot to it.
[BLU R1 HD Guides, News, & Discussion] jasonmerc:
I'm gonna try a DD, see if it works.
[BLU R1 HD Guides, News, & Discussion] bullet25:
No, I didn't. Just tried it. Still did not work.

Maybe the setting can be found in the non prime version to know where it need to be changed.

Also by chance just tried the adb shell su setprop sys.oem_unlock_allowed 1 then right to fastboot and tried fastboot oem unlock. Did not work.

Now I'm really off to bed.
[BLU R1 HD Guides, News, & Discussion] jasonmerc:
Changed adb secure and secure to 0. Also changed debugging to 1 there. Let's reboot and find out if this works.
[BLU R1 HD Guides, News, & Discussion] Varxxyy:
help on read write situation?
[BLU R1 HD Guides, News, & Discussion] mrmazak:
sorry not ignoring you but you have no details. did you already do recovery, did you already do supersu......???

read write it fully working without anything else done after supersu
[BLU R1 HD Guides, News, & Discussion] Varxxyy:
did the scatter file. whats next?
[BLU R1 HD Guides, News, & Discussion] triggerlord:
Seems like I'm getting an endless bootloop.
[BLU R1 HD Guides, News, & Discussion] mrmazak:
http://xdaforums.com/showpost.php?p=67890278&postcount=486

this post covers it pretty good.

sorry but your still not detailed in your question and help is very hard if nobody knows what point your having issue with.

you say what next. but have not laid out you have already done
[BLU R1 HD Guides, News, & Discussion] jasonmerc:
Heads up, if you want to use Xposed you have to flash the ARM version, not ARM64.

Did you just flash SuperSU? Try wiping cache and flashing again. If that doesn't work then just restore from your NAND backup you made.
[BLU R1 HD Guides, News, & Discussion] Varxxyy:
need help flashing recovery. link to download?
[BLU R1 HD Guides, News, & Discussion] Oscar_david:
Alternate link for root file.

https://www.dropbox.com/s/82vull03ywxbmxj/TWRP_Scatter_R1_Prime.zip?dl=0
[BLU R1 HD Guides, News, & Discussion] triggerlord:
I restored my backup fine. Which SuperSu do I flash?
[BLU R1 HD Guides, News, & Discussion] jasonmerc:
Flash latest unstable build. Lemme see if I have it on my device still.
[BLU R1 HD Guides, News, & Discussion] triggerlord:
Regular or Systemless root?
[BLU R1 HD Guides, News, & Discussion] jasonmerc:
I'm not sure if it specified, but I'm 99% sure mine is regular.

download.chainfire.eu/supersu

Are you mounting system read write before flashing? Also make sure system is checked to be mounted in Mounts.
[BLU R1 HD Guides, News, & Discussion] Varxxyy:
Did the Phone Flash Tool for the recovery checkbox only. Im confused on what "Mounts menu and flash the SuperSU recovery zip" is and means. Lay it in steps please.

also how do i flash the SuperSU?
[BLU R1 HD Guides, News, & Discussion] triggerlord:
How do I mount as read/write? Just uncheck "Mount system partition as read only"?
[BLU R1 HD Guides, News, & Discussion] jasonmerc:
Ya hit the nail on the head boyo
[BLU R1 HD Guides, News, & Discussion] triggerlord:
Just flashed the version you linked. It is system-less root and IT WORKED!
[BLU R1 HD Guides, News, & Discussion] mrmazak:
you do realize that if you do something wrong your phone might become no better than a paper weight right.

And I, nor any other people here, take any responsibility for that. Based on your response I must ask why is it you want to root.
[BLU R1 HD Guides, News, & Discussion] tejashpatel:
Tutorial?

N00b here, can someone post a tutorial of the root&flash when you have time? Thanks!
[BLU R1 HD Guides, News, & Discussion] jacewt:
16GB Prime phone, with the most recent OTA update installed, rooted!

You guys are amazing.
[BLU R1 HD Guides, News, & Discussion] Varxxyy:
sorry, first time with an android. i really want to get rid of those ads.
[BLU R1 HD Guides, News, & Discussion] jasonmerc:
That stuff comes later and is in the recovery, not SP Flash Tools. Once you flash and boot to recovery you'll see.
[BLU R1 HD Guides, News, & Discussion] Varxxyy:
oh im just lost. a tutorial like the other guys said would be nice. the one you put up is confusing.
[BLU R1 HD Guides, News, & Discussion] DeltaP42:
I gotta say big, big ups to you, jasonmerc, for acting as the maestro here and getting all the right people working on this. Masterful job. I got my Prime R1 rooted now, systemless, and now it's time to have some fun! Thanks again!
[BLU R1 HD Guides, News, & Discussion] :
Omigoshomigoshomigoshomigoshomigosh

I have no computer capable of running Windows though :( Will the Linux version v5.1624 work?
[BLU R1 HD Guides, News, & Discussion] jasonmerc:
Only one way to find out
[BLU R1 HD Guides, News, & Discussion] jasonmerc:
I appreciate the gratitude, although I really can't take all the credit. [MENTION=5312578]mrmazak[/MENTION] risked his device as well, and [MENTION=3471223]bullet25[/MENTION] manually made the scatter that we used to successfully install recovery. And then, of course, there's [MENTION=4939713]lopestom[/MENTION]. If I'm the Maestro, he's the composer. He was the mastermind behind porting both recoveries, and he will even be working on porting the Prime boot image to allow bootloader unlock. He's spent days with me and MrMazak on Hangouts, even willing to troubleshoot and work in the wee hours of the morning. He doesn't even have an R1, and his dedication to this project has been phenomenal. Hats off to him, as well as everyone else involved in making this happen.

As for me, I'll be looking for partition mounts in terms of /dev/mmcblk. I know /boot is mmcblk0p7 from the SuperSU zip flashing, but I really need system, data and cache. My next personal project will be porting an AOSP ROM to the Prime Phone.
[BLU R1 HD Guides, News, & Discussion] :
Alright. I've actually got two of these things (felt buyers remorse on the update after taking it - my ads never did come back, but I was worried about what else Amazon could have messed up, so I went ahead and ordered an exchange, got a few days before I gotta send the other one back) So I'll try it out on the old one first. If things go well, I'll run it on the new one. :)

Update on Linux: It worked out fine using the latest Linux version. There are a couple things I learned though.

1. You must run the SP Flash Tool as root on your computer. Just sudo up when running it, and you'll be fine.

2. For some reason, you must enter debug mode and run a device test in SP flash tools before downloading. I have no idea why, but the flash failed before doing this and it worked fine afterwards.

3. Booting into Android will erase TWRP and restore the stock recovery. I discovered this by accident. Guess I should have expected it.

4. To boot into recovery, you must hold VolUp and Power while the phone is off, which will open the boot menu. Don't hold VolDn and Power, as this will enter some strange factory diagnostics mode, which was very confusing and I had a hell of a time getting out of.

I'm performing a backup right now. I'm so excited! :)
[BLU R1 HD Guides, News, & Discussion] triggerlord:
Awesome dude, I'll be looking forward to that. :D