• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

Fire HD 8 (2018 ONLY) unbrick, downgrade, unlock & root

Search This thread

kellyvotrenom

Member
Aug 9, 2019
32
5
no response? is this thread dead?

in any event - same as last time. Put it aside for a week, came back to try one more time and got as far TWRP installed.

Now flashing 6300.zip fails. it says 'failed to mount/vendor (No such device)

Anyone have a suggestion?
 

Michajin

Senior Member
Oct 23, 2012
1,263
508
no response? is this thread dead?

in any event - same as last time. Put it aside for a week, came back to try one more time and got as far TWRP installed.

Now flashing 6300.zip fails. it says 'failed to mount/vendor (No such device)

Anyone have a suggestion?
Flash lineage.... Have you tried rebooting (reboot recovery). You dont need to install 6300 once you have TWRP installed you can install any rom.
 

kellyvotrenom

Member
Aug 9, 2019
32
5
Going to answer my own post here - finally got #2 working.

After trying 20-30 times to get bootrom-step.sh to run with no luck, I put the tablet aside for a week. Yesterday I came back to it to try and sort out my problems and on the first try, it connected and ran. I think I tried a USB port on the computer that I hadn't tried before so one bit of advice - try all ports with different cables. BTW, I was certain that the short was good in the previous attempts.

After that fastboot-step.sh ran fine. Sideloading the .zip files went fine. However, flashing the zips was not straight ahead. Flashing 6300.zip kept failing with error ''failed to mount/vendor (No such device)' other posts I found on the web suggested that might not be a problem and the prompt previous to that kept saying done (I tried flashing 6300.zip multiple times) so I forged ahead. Magisk flashed ok, Finalize.zip did not. I kept getting a fail and the error of .updater process ended iwth 255'. Could find no applicable advice so I tried reflashing Finalize and finally got it work. When I rebooted I was running 6.3.0.0

Finally, I had problems installing LineageOS at first because (as it shows in the video) I failed to do an Advanced wipe before I tried to flash LOS. It is important to select Advanced wipe and select System, Data and Cache.

Don't know if anyone is watching this thread. If so and you feel that any of this is useful please crosspost. Thanks
 

Tres_Tigers

Member
Apr 26, 2021
19
4
VWWdRf9.jpg

Changelog:
v2 - Fixed the issue with the screen


Make sure to read this guide completely before starting. It requires you to open the tablet, however you don't need to solder or use any advanced tools.

This is only for Fire HD 8, 8th generation, also known as karnak or KFKAWI. It's now confirmed to work on both 16GB and 32GB models.

You will lose all data on the tablet, make a backup of important data before you start. If you've enabled encryption, it's probably a good idea to disable it before you proceed with the guide.

What you need:
- a Linux installation. Since I had to rush it, this guide is only for Linux. Once I get a chance to test it on Windows I'll update the guide.
- microusb cable to connect your tablet to the PC
- some way to open the tablet (pry tool, opening picks, etc)
- something conductive (metal tweezers, a paper clip, a piece of wire, etc)
- amonet.tar.gz
- 6300.zip: https://mega.nz/#!FI1HSI5T!2zUAeiW9I-eH3Ph0Ar10_2nioNIm0ilSnNYgOG9YPNE
- Magisk-v18.0.zip: https://github.com/topjohnwu/Magisk/releases/download/v18.0/Magisk-v18.0.zip
- finalize.zip

Install python3, PySerial, adb and fastboot. For Debian/Ubuntu something like this should work "sudo apt install python3 python3-serial android-tools-adb android-tools-fastboot".

Extract amonet.tar.gz, open a terminal and navigate to it.

You might need to run the scripts on your PC under sudo if you're getting permission errors.

0. Shut your device down and disconnect it from USB! Also, disconnect all other Android devices you might have connected from your PC. Also, if you have ModemManager installed, you MUST disable or uninstall it before you begin
1. Use a pry tool to remove the back shell from the tablet. Start at the bottom and work your way up. There are no cables between the back shell and the motherboard.
2. On the left side of the board there are 4 test points labeled DAT0, RST, CMD, CLK. We only care about the bottom one, CLK.
3. Plug in one end of the microusb cable, either to the PC or to the tablet, whatever's more convenient.
4. On your PC, run `./bootrom-step.sh`. It should print "Waiting for the bootrom".
5. Using your conductive apparatus, short the CLK test point to the ground. This means you should connect one side of your paperclip to the CLK pin and the other to the metallic shield or a side of the PCB. Firmly hold it in place so that there is connection. (See )
6. Plug in the other end of the microusb cable.
7. You should see a new device appear on your PC

Code:
[10894.058045] usb 3-2.4.1: new full-speed USB device number 9 using xhci_hcd
[10894.239684] usb 3-2.4.1: New USB device found, idVendor=0e8d, idProduct=0003
[10894.239690] usb 3-2.4.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[10894.241330] cdc_acm 3-2.4.1:1.0: ttyACM0: USB ACM device

This *must* be the device you see. If you see a "preloader" device instead, you didn't hold the paperclip strong enough. Unplug it, shut down your Fire (pull out USB cord and wait; if it doesn't shut down, you might have to disconnect the battery) and try again starting at step 4.

8. The script you ran in step 4 should now tell you to remove the short. Remove the paperclip and press Enter as instructed.
9. The script will now proceed to downgrade your device and flash some essential files. Just let it be, it will take about 4 minutes. You should see the following output:

Code:
[2019-01-26 23:30:02.157670] Waiting for bootrom
[2019-01-26 23:30:20.438333] Found port = /dev/ttyACM0
[2019-01-26 23:30:20.439362] Handshake
[2019-01-26 23:30:20.441693] Disable watchdog

* * * Remove the short and press Enter * * *


[2019-01-26 23:30:22.636037] Init crypto engine
[2019-01-26 23:30:22.661832] Disable caches
[2019-01-26 23:30:22.662505] Disable bootrom range checks
[2019-01-26 23:30:22.685773] Load payload from ../brom-payload/build/payload.bin = 0x4690 bytes
[2019-01-26 23:30:22.693170] Send payload
[2019-01-26 23:30:23.527965] Let's rock
[2019-01-26 23:30:23.528832] Wait for the payload to come online...
[2019-01-26 23:30:24.260602] all good
[2019-01-26 23:30:24.261069] Check GPT
[2019-01-26 23:30:24.596346] gpt_parsed = {'proinfo': (1024, 6144), 'PMT': (7168, 9216), 'kb': (16384, 2048), 'dkb': (18432, 2048), 'lk': (20480, 2048), 'tee1': (22528, 10240), 'tee2': (32768, 10240), 'metadata': (43008, 80896), 'MISC': (123904, 1024), 'reserved': (124928, 16384), 'boot': (141312, 32768), 'recovery': (174080, 40960), 'system': (215040, 6354944), 'vendor': (6569984, 460800), 'cache': (7030784, 1024000), 'userdata': (8054784, 22722527)}
[2019-01-26 23:30:24.596619] Check boot0
[2019-01-26 23:30:24.841858] Check rpmb
[2019-01-26 23:30:25.051079] Downgrade rpmb
[2019-01-26 23:30:25.052924] Recheck rpmb
[2019-01-26 23:30:25.949978] rpmb downgrade ok
[2019-01-26 23:30:25.950284] Flash lk-payload
[5 / 5]
[2019-01-26 23:30:26.471797] Flash preloader
[288 / 288]
[2019-01-26 23:30:44.845804] Flash tz
[6732 / 6732]
[2019-01-26 23:33:08.502134] Flash lk
[685 / 685]
[2019-01-26 23:33:23.337460] Inject microloader
[4 / 4]
[2019-01-26 23:33:23.667547] Reboot to unlocked fastboot

If the script freezes at some point, you will have to restart it. Terminate the script, unplug USB, and try again starting at step 4. If after unplugging USB cable the device doesn't shut down, you might have to disconnect the battery. You can keep it disconnected until the script succeeds, but once it's done you must reconnect it before booting to fastboot.

9. You should see a success message: "Reboot to unlocked fastboot". Only proceed if you see the message.
10. Once the device boots to fastboot (check with "fastboot devices". You should see amazon logo on the screen.), you can run "./fastboot-step.sh". Then, flip the device over so that you can see the display.
11. At this point the device should boot into recovery, however it's possible that the screen will be off by default. Just press the power button twice and the screen should turn on.
12. We'll now upload required files to the recovery. On your PC, do:

adb push 6300.zip /sdcard
adb push Magisk-v18.0.zip /sdcard
adb push finalize.zip /sdcard

13. In the recovery, go to "Install", navigate to "/sdcard" and flash 6300.zip
14. Go to "Wipe" and do the default wipe, then reboot
15. At the Fire setup screen, select your language. On the next screen, Wifi setup, select any password-protected network, then instead of entering the password press "cancel". Now, back at the wifi setup screen, press "skip" and "skip" in the dialog pop-up again
16. Hold down the power button, press Restart and hold volume down to boot into recovery.

17. In the recovery, go to "Install", navigate to "/sdcard" and flash Magisk-v18.0.zip
18. Press back, select finalize.zip and flash it
19. Once finalize.zip is flashed, press "Reboot System"

20. Done. The device should now boot into a rooted 6.3.0.0 firmware. You should have Magisk manager installed, and root working. You will be able to boot into recovery by holding volume down.
21. At this point it should be safe to connect to wifi. If everything works okay, assemble your device.

Your device is now unlocked. You can flash a custom boot image, system image, etc. However, if you ever brick the device so bad the recovery does not boot, you will have to repeat these steps starting from the first one. Read below for what you should not do.

VERY IMPORTANT STUFF:
Only ever flash boot images from TWRP. Since nothing but TWRP is aware of the exploit, if you try to flash a boot image from Android, it won't have the exploit integrated into it! This includes Magisk as well, so do NOT install or uninstall it from Magisk Manager (However, installing modules should be fine; although it depends on the specific module).

Due to how the exploit works, it takes over the first 0x400 bytes of boot.img/recovery.img. When flashing zips from the recovery, it will transparently remove and then reinstall the exploit when needed. So long as you flash zips from the recovery, you should treat the boot image normally. However, this means that you cannot use any other apps (e.g. FlashFire) to flash the boot or recovery partitions.


To revert back to stock:
- download update package from amazon https://fireos-tablet-src.s3.amazon...ate-kindle-NS6301_user_1611_0001309035396.bin to your PC
- flash 6300.zip from twrp
- flash revert-stock.zip from twrp
- wipe data
- reboot to recovery; you should see amazon recovery now
- select "apply update from ADB" in the recovery menu
- run "adb sideload update-kindle-NS6301_user_1611_0001309035396.bin" on your PC


Another way to fix a brick:

- Download update package from amazon https://fireos-tablet-src.s3.amazon...ate-kindle-NS6301_user_1611_0001309035396.bin to your PC
- Download and unzip revert-stock.zip
- Do steps 0 to 9 from this guide (so everything until fastboot-step.sh)
- Wait for device to boot into fastboot mode (check with "fastboot devices")
- Run "fastboot flash boot boot.img" using boot.img from the revert-stock.zip
- Run "fastboot flash recovery recovery.img" using recovery.img from the from the revert-stock.zip
- Run "fastboot reboot recovery"
- Select "apply update from ADB" in the recovery menu
- Run "adb sideload update-kindle-NS6301_user_1611_0001309035396.bin" on your PC


Other misc information / troubleshooting:
- If you need to disconnect the battery, use a pair of tweezers to grab the wires and gently pull towards yourself. You can do bootrom-step.sh either with or without the battery connected, however fastboot-step.sh should be done with the battery connected.
- If your device is bricked (e.g. from a downgrade), just follow the steps as-is.
- If you're getting an error like "Serial protocol mismatch", or any other error in bootrom-step, try disabling or temporarily uninstalling ModemManager from your Linux
- To remount /system as rw use "mount -o rw,remount /system". ("mount -o remount,rw /system" will not work)

Thanks to: @hwmod @firetablethelp for testing different versions of the payload.
Special thanks to: aftv2-tools contributors https://gitlab.com/zeroepoch/aftv2-tools; the bootrom download protocol scripts are largely based on their work
Hey, I'm having an issue.
Everytime I run the program on Ubuntu/Manjato, I get zero response from my tablet.
On the other hand, when I short the tablet, it freezes up, and acts as if it can't do anything at all. The PC then doesn't even register that it has been plugged in.
I've tried it many ways in shorting it at different times, but it always resulted in the tablet freezing and requiring all sources of power to be disconnected before trying anything.
What could be the cause for my problems? I'm going crazy over this tablet not working when I try to do this method.
Is there any other method that would be safe and permanent?
The tablet, after giving up last night, updated to the most recent version of the Amazon Fire OS for it.

I have the 32 GB varient of the KFKAWI (karnak) Amazon Fire Tablet.
 

Falcon342

Senior Member
Aug 24, 2020
401
184
Hey, I'm having an issue.
Everytime I run the program on Ubuntu/Manjato, I get zero response from my tablet.
On the other hand, when I short the tablet, it freezes up, and acts as if it can't do anything at all. The PC then doesn't even register that it has been plugged in.
I've tried it many ways in shorting it at different times, but it always resulted in the tablet freezing and requiring all sources of power to be disconnected before trying anything.
What could be the cause for my problems? I'm going crazy over this tablet not working when I try to do this method.
Is there any other method that would be safe and permanent?
The tablet, after giving up last night, updated to the most recent version of the Amazon Fire OS for it.

I have the 32 GB varient of the KFKAWI (karnak) Amazon Fire Tablet.
(Quote from #1)

If the script freezes at some point, you will have to restart it. Terminate the script, unplug USB, and try again starting at step 4. If after unplugging USB cable the device doesn't shut down, you might have to disconnect the battery. You can keep it disconnected until the script succeeds, but once it's done you must reconnect it before booting to fastboot
 
Last edited:

Falcon342

Senior Member
Aug 24, 2020
401
184
is it possible to downgrade the firmware before starting . I believe this is causing the issue, I have done everything the guide asked and did not get past step 7.
No it is not possible to downgrade the firmware before starting,
there has been no reports that newer firmware has prevented this exploit from working,

What are you seeing at step 7? If your seeing preloader you need this:

(Quote from #1)
This *must* be the device you see. If you see a "preloader" device instead, you didn't hold the paperclip strong enough. Unplug it, shut down your Fire (pull out USB cord and wait; if it doesn't shut down, you might have to disconnect the battery) and try again starting at step 4

When was your tablet bought? if its a newer Fire 8 2018 then it has a hardware fix for this exploit.
 
Last edited:
Jun 2, 2021
6
1
No it is not possible to downgrade the firmware before starting,
there has been no reports that newer firmware has prevented this exploit from working,

What are you seeing at step 7? If your seeing preloader you need this:

(Quote from #1)
This *must* be the device you see. If you see a "preloader" device instead, you didn't hold the paperclip strong enough. Unplug it, shut down your Fire (pull out USB cord and wait; if it doesn't shut down, you might have to disconnect the battery) and try again starting at step 4

When was your tablet bought? if its a newer Fire 8 2018 then it has a hardware fix for this exploit.
I have a fire hd 8 8th gen I have owned for two years or less. I don't see preloader device, I just see 'waiting for bootrom'. also, sorry if I don't make any sense, I'm a noob at messing with android/ tech in general
 
Jun 2, 2021
6
1
any other bits of troubleshooting advice?
this is the stuff I'm using:
 

Attachments

  • Screenshot_20210603_140950.png
    Screenshot_20210603_140950.png
    1,018.7 KB · Views: 21
  • IMG_20210603_140657.jpg
    IMG_20210603_140657.jpg
    2.1 MB · Views: 26
  • IMG_20210603_140807.jpg
    IMG_20210603_140807.jpg
    1,002.7 KB · Views: 23
  • IMG_20210603_140717.jpg
    IMG_20210603_140717.jpg
    1.7 MB · Views: 21
  • MVIMG_20210603_140757.jpg
    MVIMG_20210603_140757.jpg
    895.3 KB · Views: 21
  • MVIMG_20210603_140730.jpg
    MVIMG_20210603_140730.jpg
    2.8 MB · Views: 22
Last edited:

kellyvotrenom

Member
Aug 9, 2019
32
5
Try different cables and ports, I've had it make a difference. Even though the general advice is that if you are stuck at "waiting for bootloader" you don't have a good short from clk to ground, I have my suspicions that it may also be a communicatons error. I am certain that I had a good connection this last time I tried and it kept hanging. I think changing ports on the computer helped the problem. I also believe I have seen in the posts to use a USB 2.0 over 3.0 port, but try them all. This has applied in other situations for me, like external drives and tablets that don't get recognized until you find the right combination of port and cable.

Also, did you remove Modem Manager?
 
  • Like
Reactions: Falcon342

Korin67

Senior Member
Feb 24, 2018
212
96
And if you have keeping the battery connected, one advice is temporally disconnect the battery plug. The power will be provided through the usb cable.
 
Last edited:
  • Like
Reactions: Falcon342

Tres_Tigers

Member
Apr 26, 2021
19
4
(Quote from #1)

If the script freezes at some point, you will have to restart it. Terminate the script, unplug USB, and try again starting at step 4. If after unplugging USB cable the device doesn't shut down, you might have to disconnect the battery. You can keep it disconnected until the script succeeds, but once it's done you must reconnect it before booting to fastboot
What do you not get out of 'when I short the tablet, it freezes up'?
The tablet itself is what's not working, it keeps freezing up and not working with the waiting script.
It doesn't even matter if it's plugged in, shorting it causes my tablet to freeze until the battery is reconnected.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    I've followed the instructions and can't get 6300.zip from the link. What is a safe source of that file?
    You dont need the 6300.zip if you are planning on using LineageOS (or aicp), What i did is once i got into TWRP i wiped "system" "data" and "cache" then flashed LineageOS 16 and havent noticed any major issues, (except for Wi-Fi, but there is a fix available for that)

    If you want FireOS i managed to get the file downloaded using the MEGA Android app.
    1
    Hi, I tried the procedure on page 1 above again today and journalctl -k -n 10 shows this when I have the bootrom-step program running and plug into USB, (no other androids connected to USB):
    Oct 02 17:05:21 thinktool kernel: usb 2-1.4: New USB device found, idVendor=0e8d, idProduct=0003, bcdDevice= 1.00
    Oct 02 17:05:21 thinktool kernel: usb 2-1.4: New USB device strings: Mfr=0, Product=0, SerialNumber=0
    Oct 02 17:05:21 thinktool kernel: cdc_acm 2-1.4:1.0: ttyACM0: USB ACM device


    So that looks good, but no change of the program:

    ./bootrom-step.sh
    [2021-10-02 17:11:21.446527] Waiting for bootrom

    The above results are the same with fire hd8 battery connector off or on. I did the most tests with the fire hd8 battery connector undone so it would shut down and be ready to try again. I had a good probe contact to the CLK pad and the RF shield before conecting the USB cable other end.


    This fire hd8 has fireOS 7.3.2.1
    7.3.2.1 is newer than mentioned in the howto's. Could that be a problem?
    Try to run the command as sudo (sudo ./bootrom-step.sh). I don't think your firmware version matters since you can access bootrom (see the 003 PID).
    1
    Hi, I tried the procedure on page 1 above again today and journalctl -k -n 10 shows this when I have the bootrom-step program running and plug into USB, (no other androids connected to USB):
    Oct 02 17:05:21 thinktool kernel: usb 2-1.4: New USB device found, idVendor=0e8d, idProduct=0003, bcdDevice= 1.00
    Oct 02 17:05:21 thinktool kernel: usb 2-1.4: New USB device strings: Mfr=0, Product=0, SerialNumber=0
    Oct 02 17:05:21 thinktool kernel: cdc_acm 2-1.4:1.0: ttyACM0: USB ACM device


    So that looks good, but no change of the program:

    ./bootrom-step.sh
    [2021-10-02 17:11:21.446527] Waiting for bootrom

    The above results are the same with fire hd8 battery connector off or on. I did the most tests with the fire hd8 battery connector undone so it would shut down and be ready to try again. I had a good probe contact to the CLK pad and the RF shield before conecting the USB cable other end.


    This fire hd8 has fireOS 7.3.2.1
    7.3.2.1 is newer than mentioned in the howto's. Could that be a problem?
    @Rortiz2 is correct the firmware version doesnt matter,
    the only thing that matters is that you bought the device before January 2020 because Amazon made a hardware change that blocked this exploit.

    Also as @Rortiz2 said run it using sudo, also run the ./fastboot-step.sh using sudo, (sudo ./fastboot-step.sh)

    (Note: Reconnect the battery before running ./fastboot-step.sh)

    another note once you make it the the end of ./fastboot-step.sh it will probably give the following error: (wording may not be correct)
    Code:
    fastboot: error unknown target "recovery"

    If you get that error run:
    Code:
    fastboot reboot emergency

    Then wait about 10 seconds then press the power button once (double press if the screen doesnt turn on)
    1
    Now I've gotten to step 15 and results don't match.

    When I select reboot system from TWRP, I get the fire logo and three dots marching like caterpillar footprints to the right -- forever it seems -- definitely for more than 20 minutes. Is it OK to go without the fire setup steps and flash Magisk-v18.0.zip and finalize.zip? They are loaded to /sdcard now.

    Tried that ans same symptom: three dots marching.

    Is this a problem? -->

    Code:
    Oct 03 12:31:15 thinktool kernel: usb 2-1.4: USB disconnect, device number 41
    
    Oct 03 12:31:20 thinktool kernel: usb 2-1.4: new high-speed USB device number 42 using ehci-pci
    
    Oct 03 12:31:20 thinktool kernel: usb 2-1.4: New USB device found, idVendor=0e8d, idProduct=2000, bcdDevice= 1.00
    
    Oct 03 12:31:20 thinktool kernel: usb 2-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    
    Oct 03 12:31:20 thinktool kernel: usb 2-1.4: Product: MT65xx Preloader
    
    Oct 03 12:31:20 thinktool kernel: usb 2-1.4: Manufacturer: MediaTek
    
    Oct 03 12:31:20 thinktool kernel: cdc_acm 2-1.4:1.0: Zero length descriptor references
    
    Oct 03 12:31:20 thinktool kernel: cdc_acm: probe of 2-1.4:1.0 failed with error -22
    
    Oct 03 12:31:20 thinktool kernel: cdc_acm 2-1.4:1.1: ttyACM0: USB ACM device
    
    Oct 03 12:31:22 thinktool kernel: usb 2-1.4: USB disconnect, device number 42

    Does seeing preloader mean start over?

    I CAN boot the TWRP still.

    Thanks, John
    The fact that your getting "preloader" (i think) shouldnt matter now that you have access to TWRP, i wouldnt proceed with Magisk and finalize.zip until you do the inital setup,

    Did you factory reset in TWRP after flashing 6300.zip?
    1
    I wanted to check which version of OS and chose device options and system, but it is blank black screen. It does return to the settings menu via the back triangle at the bottom of the screen. So not sure if still on 6.3.0.0. Isn't that bad that the updates tab under settings is blank?

    Now I'd like to try to use a magisk module, but: "Only ever flash boot images from TWRP. Since nothing but TWRP is aware of the exploit"

    I found a way to do it from twrp. I got magisk-xxxx.apk from github and renamed it with .zip ending and TWRP installed it.

    When I run magisk and use the safetynet test it fails. I'd like to use this fire hd8 to read ebooks, so any help getting it able to do that will be appreciated.
    This includes Magisk as well, so do NOT install or uninstall it from Magisk Manager (However, installing modules should be fine; although it depends on the specific module).
    (On LineageOS 16.0 i never had a module cause issues)

    For SafetyNet im not sure what you can do, there might be a Magisk module that can allow you to pass SafetyNet, and there is MagiskHide but since John Wu now works for Google MagiskHide will be removed due to conflict of interest,


    Updates are probably disabled causing the updates menu in Settings not to load, updates will most likely cause a hard/soft brick, i have read that its safe to update to 6.3.0.1 but anything later is a risk, there are some modified versions of 6.3.0.1 in earlier pages of this thread, (modified as in updates disabled, certain apps disabled, already rooted, etc), the modifications applied depend on which "version" you go with,

    --------------------------------------------------------------------------------------------------------------------------------

    What is a way to disable annoying adware on fire hd8 2018?

    I got only one app to stop using pm disable, and so far this is not rooted, so I guess that is what is needed next?

    Code:
    [email protected] [amazon-fire-hd8-2018]adb shell
    karnak:/ $ pm disable-user com.goodreads.kindle
    Package com.goodreads.kindle new state: disabled-user
    karnak:/ $ pm disable com.amazon.recess
    Error: java.lang.SecurityException: Shell cannot change component state for com.amazon.recess/null to 2
    1|karnak:/ $ pm disable com.android.printspoole
    Error: java.lang.IllegalArgumentException: Unknown package: com.android.printspoole
    1|karnak:/ $ pm disable com.android.printspooler                                                                                                                                                                       
    Error: java.lang.SecurityException: Shell cannot change component state for com.android.printspooler/null to 2
    1|karnak:/ $ pm disable com.amazon.camera
    Error: java.lang.IllegalArgumentException: Unknown package: com.amazon.camera
    1|karnak:/ $ pm disable com.amazon.unifiedsharegoodreads
    Error: java.lang.SecurityException: Shell cannot change component state for com.amazon.unifiedsharegoodreads/null to 2
    1|karnak:/ $ pm hide com.amazon.unifiedsharegoodreads
    Error: java.lang.SecurityException: Neither user 2000 nor current process has android.permission.MANAGE_USERS.
    1|karnak:/ $ su
    
    Permission denied
    To remove ads run:

    Code:
    adb shell pm disable-user --user 0 com.amazon.kso


    For :
    Error: java.lang.SecurityException: Shell cannot change component state for com.amazon.unifiedsharegoodreads/null to 2
    Try using:

    Code:
    adb shell disable-user --user 0

    instead of (adb shell) pm disable



    Not sure why your getting su errors, try:

    Code:
    adb kill-server
    
    adb start-server
  • 109
    VWWdRf9.jpg

    Changelog:
    v2 - Fixed the issue with the screen


    Make sure to read this guide completely before starting. It requires you to open the tablet, however you don't need to solder or use any advanced tools.

    This is only for Fire HD 8, 8th generation, also known as karnak or KFKAWI. It's now confirmed to work on both 16GB and 32GB models.

    You will lose all data on the tablet, make a backup of important data before you start. If you've enabled encryption, it's probably a good idea to disable it before you proceed with the guide.

    What you need:
    - a Linux installation. Since I had to rush it, this guide is only for Linux. Once I get a chance to test it on Windows I'll update the guide.
    - microusb cable to connect your tablet to the PC
    - some way to open the tablet (pry tool, opening picks, etc)
    - something conductive (metal tweezers, a paper clip, a piece of wire, etc)
    - amonet.tar.gz
    - 6300.zip: https://mega.nz/#!FI1HSI5T!2zUAeiW9I-eH3Ph0Ar10_2nioNIm0ilSnNYgOG9YPNE
    - Magisk-v18.0.zip: https://github.com/topjohnwu/Magisk/releases/download/v18.0/Magisk-v18.0.zip
    - finalize.zip

    Install python3, PySerial, adb and fastboot. For Debian/Ubuntu something like this should work "sudo apt install python3 python3-serial android-tools-adb android-tools-fastboot".

    Extract amonet.tar.gz, open a terminal and navigate to it.

    You might need to run the scripts on your PC under sudo if you're getting permission errors.

    0. Shut your device down and disconnect it from USB! Also, disconnect all other Android devices you might have connected from your PC. Also, if you have ModemManager installed, you MUST disable or uninstall it before you begin
    1. Use a pry tool to remove the back shell from the tablet. Start at the bottom and work your way up. There are no cables between the back shell and the motherboard.
    2. On the left side of the board there are 4 test points labeled DAT0, RST, CMD, CLK. We only care about the bottom one, CLK.
    3. Plug in one end of the microusb cable, either to the PC or to the tablet, whatever's more convenient.
    4. On your PC, run `./bootrom-step.sh`. It should print "Waiting for the bootrom".
    5. Using your conductive apparatus, short the CLK test point to the ground. This means you should connect one side of your paperclip to the CLK pin and the other to the metallic shield or a side of the PCB. Firmly hold it in place so that there is connection. (See https://i.imgur.com/7BXIb2y.jpg)
    6. Plug in the other end of the microusb cable.
    7. You should see a new device appear on your PC

    Code:
    [10894.058045] usb 3-2.4.1: new full-speed USB device number 9 using xhci_hcd
    [10894.239684] usb 3-2.4.1: New USB device found, idVendor=0e8d, idProduct=0003
    [10894.239690] usb 3-2.4.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
    [10894.241330] cdc_acm 3-2.4.1:1.0: ttyACM0: USB ACM device

    This *must* be the device you see. If you see a "preloader" device instead, you didn't hold the paperclip strong enough. Unplug it, shut down your Fire (pull out USB cord and wait; if it doesn't shut down, you might have to disconnect the battery) and try again starting at step 4.

    8. The script you ran in step 4 should now tell you to remove the short. Remove the paperclip and press Enter as instructed.
    9. The script will now proceed to downgrade your device and flash some essential files. Just let it be, it will take about 4 minutes. You should see the following output:

    Code:
    [2019-01-26 23:30:02.157670] Waiting for bootrom
    [2019-01-26 23:30:20.438333] Found port = /dev/ttyACM0
    [2019-01-26 23:30:20.439362] Handshake
    [2019-01-26 23:30:20.441693] Disable watchdog
    
     * * * Remove the short and press Enter * * * 
    
    
    [2019-01-26 23:30:22.636037] Init crypto engine
    [2019-01-26 23:30:22.661832] Disable caches
    [2019-01-26 23:30:22.662505] Disable bootrom range checks
    [2019-01-26 23:30:22.685773] Load payload from ../brom-payload/build/payload.bin = 0x4690 bytes
    [2019-01-26 23:30:22.693170] Send payload
    [2019-01-26 23:30:23.527965] Let's rock
    [2019-01-26 23:30:23.528832] Wait for the payload to come online...
    [2019-01-26 23:30:24.260602] all good
    [2019-01-26 23:30:24.261069] Check GPT
    [2019-01-26 23:30:24.596346] gpt_parsed = {'proinfo': (1024, 6144), 'PMT': (7168, 9216), 'kb': (16384, 2048), 'dkb': (18432, 2048), 'lk': (20480, 2048), 'tee1': (22528, 10240), 'tee2': (32768, 10240), 'metadata': (43008, 80896), 'MISC': (123904, 1024), 'reserved': (124928, 16384), 'boot': (141312, 32768), 'recovery': (174080, 40960), 'system': (215040, 6354944), 'vendor': (6569984, 460800), 'cache': (7030784, 1024000), 'userdata': (8054784, 22722527)}
    [2019-01-26 23:30:24.596619] Check boot0
    [2019-01-26 23:30:24.841858] Check rpmb
    [2019-01-26 23:30:25.051079] Downgrade rpmb
    [2019-01-26 23:30:25.052924] Recheck rpmb
    [2019-01-26 23:30:25.949978] rpmb downgrade ok
    [2019-01-26 23:30:25.950284] Flash lk-payload
    [5 / 5]
    [2019-01-26 23:30:26.471797] Flash preloader
    [288 / 288]
    [2019-01-26 23:30:44.845804] Flash tz
    [6732 / 6732]
    [2019-01-26 23:33:08.502134] Flash lk
    [685 / 685]
    [2019-01-26 23:33:23.337460] Inject microloader
    [4 / 4]
    [2019-01-26 23:33:23.667547] Reboot to unlocked fastboot

    If the script freezes at some point, you will have to restart it. Terminate the script, unplug USB, and try again starting at step 4. If after unplugging USB cable the device doesn't shut down, you might have to disconnect the battery. You can keep it disconnected until the script succeeds, but once it's done you must reconnect it before booting to fastboot.

    9. You should see a success message: "Reboot to unlocked fastboot". Only proceed if you see the message.
    10. Once the device boots to fastboot (check with "fastboot devices". You should see amazon logo on the screen.), you can run "./fastboot-step.sh". Then, flip the device over so that you can see the display.
    11. At this point the device should boot into recovery, however it's possible that the screen will be off by default. Just press the power button twice and the screen should turn on.
    12. We'll now upload required files to the recovery. On your PC, do:

    adb push 6300.zip /sdcard
    adb push Magisk-v18.0.zip /sdcard
    adb push finalize.zip /sdcard

    13. In the recovery, go to "Install", navigate to "/sdcard" and flash 6300.zip
    14. Go to "Wipe" and do the default wipe, then reboot
    15. At the Fire setup screen, select your language. On the next screen, Wifi setup, select any password-protected network, then instead of entering the password press "cancel". Now, back at the wifi setup screen, press "skip" and "skip" in the dialog pop-up again
    16. Hold down the power button, press Restart and hold volume down to boot into recovery.

    17. In the recovery, go to "Install", navigate to "/sdcard" and flash Magisk-v18.0.zip
    18. Press back, select finalize.zip and flash it
    19. Once finalize.zip is flashed, press "Reboot System"

    20. Done. The device should now boot into a rooted 6.3.0.0 firmware. You should have Magisk manager installed, and root working. You will be able to boot into recovery by holding volume down.
    21. At this point it should be safe to connect to wifi. If everything works okay, assemble your device.

    Your device is now unlocked. You can flash a custom boot image, system image, etc. However, if you ever brick the device so bad the recovery does not boot, you will have to repeat these steps starting from the first one. Read below for what you should not do.

    VERY IMPORTANT STUFF:
    Only ever flash boot images from TWRP. Since nothing but TWRP is aware of the exploit, if you try to flash a boot image from Android, it won't have the exploit integrated into it! This includes Magisk as well, so do NOT install or uninstall it from Magisk Manager (However, installing modules should be fine; although it depends on the specific module).

    Due to how the exploit works, it takes over the first 0x400 bytes of boot.img/recovery.img. When flashing zips from the recovery, it will transparently remove and then reinstall the exploit when needed. So long as you flash zips from the recovery, you should treat the boot image normally. However, this means that you cannot use any other apps (e.g. FlashFire) to flash the boot or recovery partitions.


    To revert back to stock:
    - download update package from amazon https://fireos-tablet-src.s3.amazon...ate-kindle-NS6301_user_1611_0001309035396.bin to your PC
    - flash 6300.zip from twrp
    - flash revert-stock.zip from twrp
    - wipe data
    - reboot to recovery; you should see amazon recovery now
    - select "apply update from ADB" in the recovery menu
    - run "adb sideload update-kindle-NS6301_user_1611_0001309035396.bin" on your PC


    Another way to fix a brick:

    - Download update package from amazon https://fireos-tablet-src.s3.amazon...ate-kindle-NS6301_user_1611_0001309035396.bin to your PC
    - Download and unzip revert-stock.zip
    - Do steps 0 to 9 from this guide (so everything until fastboot-step.sh)
    - Wait for device to boot into fastboot mode (check with "fastboot devices")
    - Run "fastboot flash boot boot.img" using boot.img from the revert-stock.zip
    - Run "fastboot flash recovery recovery.img" using recovery.img from the from the revert-stock.zip
    - Run "fastboot reboot recovery"
    - Select "apply update from ADB" in the recovery menu
    - Run "adb sideload update-kindle-NS6301_user_1611_0001309035396.bin" on your PC


    Other misc information / troubleshooting:
    - If you need to disconnect the battery, use a pair of tweezers to grab the wires and gently pull towards yourself. You can do bootrom-step.sh either with or without the battery connected, however fastboot-step.sh should be done with the battery connected.
    - If your device is bricked (e.g. from a downgrade), just follow the steps as-is.
    - If you're getting an error like "Serial protocol mismatch", or any other error in bootrom-step, try disabling or temporarily uninstalling ModemManager from your Linux
    - To remount /system as rw use "mount -o rw,remount /system". ("mount -o remount,rw /system" will not work)

    Thanks to: @hwmod @firetablethelp for testing different versions of the payload.
    Special thanks to: aftv2-tools contributors https://gitlab.com/zeroepoch/aftv2-tools; the bootrom download protocol scripts are largely based on their work
    21
    GPL Notice:
    - Source code for modified TWRP is available from https://github.com/xyzz/android_bootable_recovery
    - Source code for amonet/brom-payload is available from https://github.com/xyzz/amonet/tree/master/brom-payload

    Device tree to build TWRP: https://github.com/xyzz/android_device_amazon_karnak

    Additionally, source code of the full exploit chain is available from https://github.com/xyzz/amonet

    When I finish the writeup for this vulnerability, I'll update this post with a URL to the writeup.
    7
    Unless you hide root CTS will always fail. Not easy to do even with magisk.

    The 'Magisk Hide' option (enabled by default) is sufficient on my phone to pass CTS, and I'm not doing anything other than that to hide Magisk. I'm just using the defaults, as I am on the Fire, yet one passes and one doesn't. Only if I disable that option then CTS fails (and basicIntegrity).

    6.3.0.1 was bugged for me on first launch. I had to disable the Device Setup app via adb and then it was ok. On the plus side, it fixes the SD card setup bug (it stops asking what to do with it every boot) and the bug with some accessibility options being empty (can't toggle on/off).

    Here is a link to 6.3.0.1 for those not sure about zipping/editing the script. If anyone tries flashing it, and it doesn't work, be specific. Like does Magisk throw an error (if so, what does it say), or is there an issue post boot or.. etc?
    7
    OK, this is the paper that I had in mind. It's by XDA member @djrbliss from 2013 for the Galaxy S4. And this is the thread he made.
    Damn, if you were not aware of that work and came up with your exploit independently, that's even more amazing. My hat's off to you sir. ;)

    Interesting, definitely wasn't aware of this (and I guess neither was mediatek). So I guess what happened is both mediatek and qualcomm took Google's aboot which had no checks for boot.img load base, and added their own signature checking on top. Kinda amazing that it's been known for over 5 years.

    I also had to exploit it in a different way, I see in that blog he's overwriting a function with his code, but in my case I have to overwrite a function pointer and set up a rop chain to do cache flush before jumping to the payload. Either way, the end result is the same.
    7
    This is very promising could you please elaborate, what exactly needs to be modified to port this to other MTK-hardware.
    I have a fire 5th gen here and I can access brom-mode by pressing left mute button while pluging in.
    tried your scripts as is (commenting out the parts that change rpmb or flash partitions) and it get's stuck at
    Code:
    [2019-01-28 00:01:40.973289] Disable bootrom range checks

    Does the hash in load_payload.py (4dd12bdf0ec7d26c482490b3482a1b1f) need to be modified?
    I do have the kernel-sources for the device and am willing to investigate correct addressing etc.

    Also since this is a boot-rom exploit wouldn't it allow flashing a hacked preloader + lk which just ignore boot-signatures so we can just run a standard twrp?

    So first of all make sure you're accessing bootrom mode and not preloader mode (Although if the preloader supports read/write, the exploit should work there as well, I just haven't tested it since on hd 8 8th gen none of preloaders support these). I suggest soldering on a UART adapter, then use 115200 baud rate. When in bootrom dl mode, you should see "[DL] 00000BB8 444C0005 010701" (basically, the "[DL]" part is the important one)

    If it's a different soc, you will have to dump the bootrom and find the offset where range check data is stored (in my case, 0x102868). You might have to modify the 4dd12bdf0ec7d26c482490b3482a1b1f part as well, it's basically calculated as a xor of expected data and actual data it's written. Then, you'll also need to update the pointer I'm overwriting (0x1028A8 in my case, called ptr_send in brom-payload). Again, if executing under preloader it's gonna be completely different way to exploit it.

    Once all this is done, you should be able to load binary payloads and execute them in bootrom mode. You'll also need to edit brom-payload and set up proper pointers to send_dword/recv_dword/etc, these can be found by reversing your bootrom dump. At this point it should be possible to get emmc read/write.

    Finally, if you want a persistent unlock (and not just the ability to modify /system) you'll need to port lk exploit as well. So you'll have to figure if your lk is vulnerable to the same bug, port microloader, inject_microloader.py and lk-payload to use the proper offsets. It's a lot of work.

    I'll hopefully finish my writeup in the next weeks and post a link to it, that should be easier to understand since I'll explain the whole process from start to finish.

    You're right about being able to load a custom preloader/lk, however the bootrom exploit requires a PC connection and a bunch of USB commands (so in a way, it's "tethered"). The actual unlock exploit isn't using any bootrom bugs, but rather the lk bug, since that one works without a PC. In fact, the bootrom exploit is only used to flash stuff to eMMC (but, of course you could probably do more fun stuff with it) in my chain.