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

Fire TV Stick 4K 6.2.8.1 r3_4054 No efuse/Old UI/Accessibility/NO OTA/PRE-ROOTED ROM

Search This thread

Skel40

Senior Member
Dec 27, 2019
286
137
Moto G 5G
With what?
Its a replacement of OTA in priv-app
I do not have any Amazon keys to sign the apk.
So you have to replace it you cannot just install it.
Wait few minutes i will elaborate
After installing the test, I get the following after removing DeviceSoftwareOTA from priv-app said below with adb

Exception occurred while dumping:
java.lang.IllegalArgumentException: Unknown package: com.amazon.device.software.ota
at com.android.server.pm.Settings.isOrphaned(Settings.java:4165)
at com.android.server.pm.PackageManagerService.isOrphaned(PackageManagerService.java:18609)
at com.android.server.pm.PackageManagerService.deletePackage(PackageManagerService.java:16012)
at com.android.server.pm.PackageInstallerService.uninstall(PackageInstallerService.java:904)
at com.android.server.pm.PackageManagerShellCommand.runUninstall(PackageManagerShellCommand.java:792)
at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:118)
at android.os.ShellCommand.exec(ShellCommand.java:94)
at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:18869)
at android.os.Binder.shellCommand(Binder.java:468)
at android.os.Binder.onTransact(Binder.java:367)
at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:2387)
at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:3141)
at android.os.Binder.execTransact(Binder.java:565)

To make sure it uninstalls. Wait I should've installed it on top of the existing stock app. Will do more testings. I'm 100% sure it was because of editing the .apk
 

SweenWolf

Senior Member
Mar 18, 2016
569
428
Paradise
Amazon Fire TV
After installing the test, I get the following after removing DeviceSoftwareOTA from priv-app said below with adb

Exception occurred while dumping:
java.lang.IllegalArgumentException: Unknown package: com.amazon.device.software.ota
at com.android.server.pm.Settings.isOrphaned(Settings.java:4165)
at com.android.server.pm.PackageManagerService.isOrphaned(PackageManagerService.java:18609)
at com.android.server.pm.PackageManagerService.deletePackage(PackageManagerService.java:16012)
at com.android.server.pm.PackageInstallerService.uninstall(PackageInstallerService.java:904)
at com.android.server.pm.PackageManagerShellCommand.runUninstall(PackageManagerShellCommand.java:792)
at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:118)
at android.os.ShellCommand.exec(ShellCommand.java:94)
at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:18869)
at android.os.Binder.shellCommand(Binder.java:468)
at android.os.Binder.onTransact(Binder.java:367)
at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:2387)
at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:3141)
at android.os.Binder.execTransact(Binder.java:565)

To make sure it uninstalls. Wait I should've installed it on top of the existing stock app. Will do more testings. I'm 100% sure it was because of editing the .apk
Do you have root?
If yes then just replace the files that way
Else use twrp, you can use the above twrp flashable zip as template
 

Skel40

Senior Member
Dec 27, 2019
286
137
Moto G 5G
Do you have root?
If yes then just replace the files that way
Else use twrp, you can use the above twrp flashable zip as template
Yes I have root. I'm doing this outside of TWRP. Should have thought of that. Thanks.

Edit. As it turns out I'm getting the same message when updating the app with the patch and when removing the system app. Don't know what I'm doing wrong here. I tried copying the package in TWRP and that didn't work.
 
Last edited:

SweenWolf

Senior Member
Mar 18, 2016
569
428
Paradise
Amazon Fire TV
I clean flashed 6.2.8.1
OOBE went smoothly, had no issues. It showed IR profile screen only once, like normal setup does.
AppMarket is downloading updates normally.
OTA Screen is either showing "Your FireTV is up to date" or its throwing "Update Error".
DRM is not crashing the stick.


[NOTE]
DO NOT USE THIS BOOT.IMG IF YOU ARE ALREADY HAVE MAGISK INSTALL, IF YOU DO THEN YOU WILL LOSE ROOT.
AND ONLY UPDATE USING TWRP, DO NOT USE FASTBOOT TO FLASH.

(FLASHING ANY BOOT.IMG FROM FASTBOOT (HACKED BL) WILL RESULT IN A LOSS OF TWRP AS WHEN THE DEVICE BOOTS WITH ITS STOCK BOOT IMAGE (AFTER FLASHING IT VIA FASTBOOT) IT WILL RESTORE YOUR TWRP WITH THE STOCK ONE BY RUNNING "install-recovery.sh". IF IT IS SUCCESSFUL IN RESTORE STOCK RECOVERY AND YOU ALSO HAS STOCK ROM INSTALLED WITH EFUSE BURNER IN /system/bin THEN IT WILL BLOW THE EFUSE.
IF IT IS UNSUCCESSFUL IN RESTORING THE RECOVERY THEN YOU WILL FACE A BOOTLOOP AND YOU WILL HAVE TO UNLOCK YOUR STICK AGAIN, CONSIDERING YOUR FUSE IS INTECT.

That was bit of info about this stuff, that i know and have personally tested.
Screenshot (264).png
 

Attachments

  • DeviceSoftwareOTA.apk
    438.7 KB · Views: 18
  • boot.img
    7.4 MB · Views: 161
Last edited:
  • Like
Reactions: Skel40

SweenWolf

Senior Member
Mar 18, 2016
569
428
Paradise
Amazon Fire TV
Patch - 6.2.8.1 (NO FOTA)

V2 of this patch can be downloaded from here

Contents:
forcedotaupdator.apk : Disables updates on OOBE
fosservices.jar: Fixes Accessibility
services.jar: Fixes AppWidget
DeviceSoftwareOTA.apk: Disables OTA updates inside System

Requirements for this patch:
Unlocked Bootloader
Patched Boot Image (If you are using any prerooted images or you manually installed magisk then you already have a patched boot image, if you don't have any if them then download the patched image from here. It is extremely important or you'll get a bootloop.
To flash it just open TWRP select "Install Images" and select this image as boot and flash.)

TZ update - (TWRP)
It updates the TZ and also removes efuse related files.
I've extracted the TZ image from @rbox rom.

It fixes the DRM issue on newer roms

IMPORTANT NOTE
Do not flash any Stock Rom which contains efuse burner i.e. 6.2.8.0 or higher,
use a modified one which has the files removed and disable OTA updates also.
 

Attachments

  • Patch - 6.2.8.1 (NO FOTA).zip
    5.2 MB · Views: 151
  • TZ Update - (TWRP).zip
    4 MB · Views: 144
Last edited:

bluejaysrs

New member
Jul 6, 2018
3
0
Thanks for doing this, what’s the steps to install this?
Also does it block ads from IMDb tv and YouTube ?
 

Skel40

Senior Member
Dec 27, 2019
286
137
Moto G 5G
Send me the apk, if i get some free time I'll patch it.
Here's DeviceSoftwareOTA and the stock fosservices.jar from 6.2.7.7 3033. I dont know if the patched forced ota from the zip you provided above would be useful on this version. With testings I've made, it bypasses it on oobe.
 

Attachments

  • DeviceSoftwareOTA.apk
    435 KB · Views: 7
  • fosservices.jar
    1.1 KB · Views: 7

SweenWolf

Senior Member
Mar 18, 2016
569
428
Paradise
Amazon Fire TV
I now need some help combining the "copying system image" with @SweenWolf's forced ota zip he created by adding the script in the META-INF folder.
This is what I use, you might know I don't use Magisk, so you will not find it in here, you can add that manually.

Code:
(getprop("ro.product.device") == "mantis" || getprop("ro.build.product") == "mantis") || abort("This package is for \"mantis\" devices
this is a \"" + getprop("ro.product.device") + "\".");
ifelse(is_mounted("/system"), unmount("/system"));
ui_print("NS6281 (With Patches)");
ui_print("Copying system image...");
block_image_update("/dev/block/platform/soc/11230000.mmc/by-name/system", package_extract_file("system.transfer.list"), "system.new.dat", "system.patch.dat");
ui_print("Copying vendor image...");
block_image_update("/dev/block/platform/soc/11230000.mmc/by-name/vendor", package_extract_file("vendor.transfer.list"), "vendor.new.dat", "vendor.patch.dat");
mount("ext4", "EMMC", "/dev/block/platform/soc/11230000.mmc/by-name/system", "/system", "");
ui_print("Deleting efuse burner");
delete("/system/bin/efuse_check.sh",
       "/system/bin/ewriter");
unmount("/system");
ui_print("Updating TZ...");
package_extract_file("images/tz.img", "/dev/block/platform/soc/11230000.mmc/by-name/tee1_real");
package_extract_file("images/tz.img", "/dev/block/platform/soc/11230000.mmc/by-name/tee2_real");                      
mount("ext4", "EMMC", "/dev/block/platform/soc/11230000.mmc/by-name/system", "/system", "");
ui_print("Patching System Files");
delete("/system/priv-app/com.amazon.tv.forcedotaupdater.v2/com.amazon.tv.forcedotaupdater.v2.apk",
       "/system/priv-app/DeviceSoftwareOTA/DeviceSoftwareOTA.apk",
       "/system/framework/fosservices.jar",
       "/system/framework/services.jar",
       "/system/framework/oat/arm/fosservices.odex",
       "/system/framework/oat/arm/services.odex");
package_extract_dir("system", "/system");
set_metadata("/system/priv-app/com.amazon.tv.forcedotaupdater.v2/com.amazon.tv.forcedotaupdater.v2.apk", "uid", 0, "gid", 0, "mode", 0644);
set_metadata("/system/priv-app/DeviceSoftwareOTA/DeviceSoftwareOTA.apk", "uid", 0, "gid", 0, "mode", 0644);
set_metadata("/system/framework/fosservices.jar", "uid", 0, "gid", 0, "mode", 0644);
set_metadata("/system/framework/services.jar", "uid", 0, "gid", 0, "mode", 0644);
unmount("/system");
ui_print("Copying kernel...");
package_extract_file("boot.img", "/dev/block/platform/soc/11230000.mmc/by-name/boot");
ui_print("OS Installation Complete");
ifelse(is_mounted("/system"), unmount("/system"));
 
Last edited:
  • Like
Reactions: puppinoo and Skel40

Skel40

Senior Member
Dec 27, 2019
286
137
Moto G 5G
This is what I use, you might know I don't use Magisk, so you will not find it in here, you can add that manually.

Code:
(getprop("ro.product.device") == "mantis" || getprop("ro.build.product") == "mantis") || abort("This package is for \"mantis\" devices
this is a \"" + getprop("ro.product.device") + "\".");
ifelse(is_mounted("/system"), unmount("/system"));
ui_print("NS6281 (With Patches)");
ui_print("Copying system image...");
block_image_update("/dev/block/platform/soc/11230000.mmc/by-name/system", package_extract_file("system.transfer.list"), "system.new.dat", "system.patch.dat");
ui_print("Copying vendor image...");
block_image_update("/dev/block/platform/soc/11230000.mmc/by-name/vendor", package_extract_file("vendor.transfer.list"), "vendor.new.dat", "vendor.patch.dat");
mount("ext4", "EMMC", "/dev/block/platform/soc/11230000.mmc/by-name/system", "/system", "");
ui_print("Deleting efuse burner");
delete("/system/bin/efuse_check.sh",
       "/system/bin/ewriter");
unmount("/system");
ui_print("Updating TZ...");
package_extract_file("images/tz.img", "/dev/block/platform/soc/11230000.mmc/by-name/tee1_real");
package_extract_file("images/tz.img", "/dev/block/platform/soc/11230000.mmc/by-name/tee2_real");                     
mount("ext4", "EMMC", "/dev/block/platform/soc/11230000.mmc/by-name/system", "/system", "");
ui_print("Patching System Files");
delete("/system/priv-app/com.amazon.tv.forcedotaupdater.v2/com.amazon.tv.forcedotaupdater.v2.apk",
       "/system/priv-app/DeviceSoftwareOTA/DeviceSoftwareOTA.apk",
       "/system/framework/fosservices.jar",
       "/system/framework/services.jar",
       "/system/framework/oat/arm/fosservices.odex",
       "/system/framework/oat/arm/services.odex");
package_extract_dir("system", "/system");
set_metadata("/system/priv-app/com.amazon.tv.forcedotaupdater.v2/com.amazon.tv.forcedotaupdater.v2.apk", "uid", 0, "gid", 0, "mode", 0644);
set_metadata("/system/priv-app/DeviceSoftwareOTA/DeviceSoftwareOTA.apk", "uid", 0, "gid", 0, "mode", 0644);
set_metadata("/system/framework/fosservices.jar", "uid", 0, "gid", 0, "mode", 0644);
set_metadata("/system/framework/services.jar", "uid", 0, "gid", 0, "mode", 0644);
unmount("/system");
ui_print("Copying kernel...");
package_extract_file("boot.img", "/dev/block/platform/soc/11230000.mmc/by-name/boot");
ui_print("OS Installation Complete");
ifelse(is_mounted("/system"), unmount("/system"));
Thank you so much! This is exactly what I was looking for! I'll test out the script and make an experimental .zip soon
 
  • Like
Reactions: puppinoo

tokoam

Senior Member
Jun 24, 2007
927
167
Plantation
Patch - 6.2.8.1 (NO FOTA)
Contents:
forcedotaupdator.apk : Disables updates on OOBE
fosservices.jar: Fixes Accessibility
services.jar: Fixes AppWidget
DeviceSoftwareOTA.apk: Disables OTA updates inside System

Requirements for this patch:
Unlocked Bootloader
Patched Boot Image (If you are using any prerooted images or you manually installed magisk then you already have a patched boot image, if you don't have any if them then download the patched image from here. It is extremely important or you'll get a bootloop.
To flash it just open TWRP select "Install Images" and select this image as boot and flash.)

TZ update - (TWRP)
It updates the TZ and also removes efuse related files.
I've extracted the TZ image from @rbox rom.

It fixes the DRM issue on newer roms

IMPORTANT NOTE
Do not flash any Stock Rom which contains efuse burner i.e. 6.2.8.0 or higher,
use a modified one which has the files removed and disable OTA updates also.
So just to be clear if i install mantis-6.2.8.1-r2-tz-video-error fix-old-interface-pre-rooted.zip on main OP section I should be good ? I'm currently on rbox firmware 6.2.8.0 . It should not effect efuse doing so ? also would there be anything else I would need to flash after flashing ? I see this post and not quite sure if I need these files its all sorta confusing to me .
 

SweenWolf

Senior Member
Mar 18, 2016
569
428
Paradise
Amazon Fire TV
So just to be clear if i install mantis-6.2.8.1-r2-tz-video-error fix-old-interface-pre-rooted.zip on main OP section I should be good ? I'm currently on rbox firmware 6.2.8.0 . It should not effect efuse doing so ? also would there be anything else I would need to flash after flashing ? I see this post and not quite sure if I need these files its all sorta confusing to me .
I will try to make it less confusing,
it depends on what you want with the system

rbox's latest prerooted firmware is 6.2.8.1_r2 which contains updated TZ (why TZ update is needed? If you are on older OS like 6.2.7.1 which is compatible with tz then almost all aps will work except Prime Video, if you are on newer OS like 6.2.8.0 but are using older TZ then they will be incompatible with each other and you will not be able to watch any DRM contents, it will cause the Device to freeze)

I have not checked what OP has in the ROM, so Skel40 will better tell you about it.

About my post that you quoted, it contains files which will patch 6.2.8.1 only (assuming that the user has only updated the system partition, all of the prerooted images only updates system), you don't need to update other partitions,
The NOFOTA zip will disable System updates on the system, meaning that your stick will not check for update, even after factory resetting or when you are setting your device for the first time (in OOBE), your stick will skip any update and will always tell you your system is up to date (or will throw an error) every time you click on check for update in the "My FireTV Section".
It also enables "AppWidget" which is missing on our stick from ever.
It also fixed Accessibility so that you can use LauncherHijack/FireTVSettings/FTVLaunchX/AnyDesk/MATVT etc.
Accessibility allows you to have Custom launcher (without disabling amazon stock launcher), MATVT allows you to use remote as mouse (its alternative to Mouse Toggle).
It does not uses magisk so it doesn't matter if the system is rooted or not (it is flashed via TWRP)
Now because you are not disabling your stock launcher you can access all the settings
This zip will work on any 6.2.8.1 system (you need to have TWRP to flash it)
It needs the patched boot image so it can boot properly (the boot.img I provided is not patched by magisk so there will be no root, you can install magisk.zip to root if you want)

The TZ update is only for those who are on 6.2.8.0 or 6.2.8.1 and whose Netflix and prime are crashing and do not want to download the full system image. it will patch the OS (it will update the TZ and then remove the files which burns the efuse).

The boot image i provided has some things removed, It does not check if the system is tempered (magisk also removes that and is required to removed, if not removed them only stock images will run on your system and any modification to the system will make it non bootable)
Efuse and recovery service are removed, meaning system will not execute these commands
the function of efuse checker is to check and blow the efuse (my and pretoriano80's boot image will not run it even its present in the system).
the function of recovery is to check if the recovery is stock or not, if it is not stock then the system replaces it(TWRP) with stock (amazon)
as long as you have TWRP installed, recovery script will not do anything but i have removed it just to be safe.
This boot.img is taken from 6.2.8.1
 
Last edited:

Skel40

Senior Member
Dec 27, 2019
286
137
Moto G 5G
So just to be clear if i install mantis-6.2.8.1-r2-tz-video-error fix-old-interface-pre-rooted.zip on main OP section I should be good ? I'm currently on rbox firmware 6.2.8.0 . It should not effect efuse doing so ? also would there be anything else I would need to flash after flashing ? I see this post and not quite sure if I need these files its all sorta confusing to me .
Yes you should be good. The r2 is from rboxs rom to ensure the tz images are set. It won't effect the efuse when doing so because specifically in rbox's script, there's a script referenced in the first page of my OP that states the script to fully remove the efuse_check.sh and ewriter files before flashing so it's safe to flash. I don't just create flashable .zips with the efuse in place. I hope this doesn't confuse you more. If you have any questions, I'd be glad to respond back
 

tokoam

Senior Member
Jun 24, 2007
927
167
Plantation
Yes you should be good. The r2 is from rboxs rom to ensure the tz images are set. It won't effect the efuse when doing so because specifically in rbox's script, there's a script referenced in the first page of my OP that states the script to fully remove the efuse_check.sh and ewriter files before flashing so it's safe to flash. I don't just create flashable .zips with the efuse in place. I hope this doesn't confuse you more. If you have any questions, I'd be glad to respond back
Thank you for taking the time to answer my questions . So I’m a nut shell the main difference between your rom and rbox is essentially nofota and removal of efuse data ?
 

Skel40

Senior Member
Dec 27, 2019
286
137
Moto G 5G
Thank you for taking the time to answer my questions . So I’m a nut shell the main difference between your rom and rbox is essentially nofota and removal of efuse data ?
Yes. And no problem. Yeah. On the accessibility version I removed the files to ensure it doesn't burn the efuse while the other rom without the accessibility/fota has it in place until the script is recognized in TWRP to remove the efuse so it's basically the same thing on both
 

tokoam

Senior Member
Jun 24, 2007
927
167
Plantation
How do I uninstall Amazon live shopping it came up after installing the rom . Never had it previously any help would be helpful .
 

Top Liked Posts

  • There are no posts matching your filters.
  • 4
    Here's the latest release 6.2.8.1_r3_4054 of the pre-rooted rom I've combined into one patched ota removed zip which packs the downgraded older interface with accessibility settings working again. After flashing, clear data in settings/applications/Appstore to prevent issues with apps and reboot.

    There's no bugs in this rom that I know of.

    No efuse is present in this rom and is completely safe to flash. Remember to not flash stock images that are 6.2.8.0 and higher. Only flash the pre-rooted roms from @rbox so that the efuse doesn't burn.

    Nothing is removed in this rom, only re-edited for system app downgrades that include the com.amazon.tv.launcher (KFTV launcher), com.amazon.tv.settings.v2 (Amazon Settings), and lastly, com.amazon.venezia (Appstore) with options to hide cloud apps, to adjust AV Sync Tuning, as well with the Wi-Fi icons when connecting wirelessly altogether with the older interface.

    Things that don't work

    Amazon FreeTime
    Profiles
    Some apps that recognize a bootloader is unlocked and forcibly closes i.e Peacock TV
    OTA updates?? Of course ota updates no longer work. This rom removes the fota and any type of updates from occurring
    Amazon Live Shopping (The app does work, but the older UI somehow doesn't recognize it as one)

    For those that prefer using the newer interface with the same patches, download this rom from this link:

    4
    So just to be clear if i install mantis-6.2.8.1-r2-tz-video-error fix-old-interface-pre-rooted.zip on main OP section I should be good ? I'm currently on rbox firmware 6.2.8.0 . It should not effect efuse doing so ? also would there be anything else I would need to flash after flashing ? I see this post and not quite sure if I need these files its all sorta confusing to me .
    I will try to make it less confusing,
    it depends on what you want with the system

    rbox's latest prerooted firmware is 6.2.8.1_r2 which contains updated TZ (why TZ update is needed? If you are on older OS like 6.2.7.1 which is compatible with tz then almost all aps will work except Prime Video, if you are on newer OS like 6.2.8.0 but are using older TZ then they will be incompatible with each other and you will not be able to watch any DRM contents, it will cause the Device to freeze)

    I have not checked what OP has in the ROM, so Skel40 will better tell you about it.

    About my post that you quoted, it contains files which will patch 6.2.8.1 only (assuming that the user has only updated the system partition, all of the prerooted images only updates system), you don't need to update other partitions,
    The NOFOTA zip will disable System updates on the system, meaning that your stick will not check for update, even after factory resetting or when you are setting your device for the first time (in OOBE), your stick will skip any update and will always tell you your system is up to date (or will throw an error) every time you click on check for update in the "My FireTV Section".
    It also enables "AppWidget" which is missing on our stick from ever.
    It also fixed Accessibility so that you can use LauncherHijack/FireTVSettings/FTVLaunchX/AnyDesk/MATVT etc.
    Accessibility allows you to have Custom launcher (without disabling amazon stock launcher), MATVT allows you to use remote as mouse (its alternative to Mouse Toggle).
    It does not uses magisk so it doesn't matter if the system is rooted or not (it is flashed via TWRP)
    Now because you are not disabling your stock launcher you can access all the settings
    This zip will work on any 6.2.8.1 system (you need to have TWRP to flash it)
    It needs the patched boot image so it can boot properly (the boot.img I provided is not patched by magisk so there will be no root, you can install magisk.zip to root if you want)

    The TZ update is only for those who are on 6.2.8.0 or 6.2.8.1 and whose Netflix and prime are crashing and do not want to download the full system image. it will patch the OS (it will update the TZ and then remove the files which burns the efuse).

    The boot image i provided has some things removed, It does not check if the system is tempered (magisk also removes that and is required to removed, if not removed them only stock images will run on your system and any modification to the system will make it non bootable)
    Efuse and recovery service are removed, meaning system will not execute these commands
    the function of efuse checker is to check and blow the efuse (my and pretoriano80's boot image will not run it even its present in the system).
    the function of recovery is to check if the recovery is stock or not, if it is not stock then the system replaces it(TWRP) with stock (amazon)
    as long as you have TWRP installed, recovery script will not do anything but i have removed it just to be safe.
    This boot.img is taken from 6.2.8.1
    3
    What do you think, should we fix widgets too? [Try to fix]
    2
    Patch - 6.2.8.1 v2 (NO FOTA)

    FireTV IME:

    • Enables voice search
    Requirements:
    • v2 Patch
    • Alexa (Latest)
    Package Installer:
    • Fix white Action Bar
    Requirements:
    • v2 Patch

    Instructions:
    Flash Patch (6.2.8.1) v2 using TWRP and reboot.
    When the system is booted install the apps normally using any file manager.
    2
    I now need some help combining the "copying system image" with @SweenWolf's forced ota zip he created by adding the script in the META-INF folder.
    This is what I use, you might know I don't use Magisk, so you will not find it in here, you can add that manually.

    Code:
    (getprop("ro.product.device") == "mantis" || getprop("ro.build.product") == "mantis") || abort("This package is for \"mantis\" devices
    this is a \"" + getprop("ro.product.device") + "\".");
    ifelse(is_mounted("/system"), unmount("/system"));
    ui_print("NS6281 (With Patches)");
    ui_print("Copying system image...");
    block_image_update("/dev/block/platform/soc/11230000.mmc/by-name/system", package_extract_file("system.transfer.list"), "system.new.dat", "system.patch.dat");
    ui_print("Copying vendor image...");
    block_image_update("/dev/block/platform/soc/11230000.mmc/by-name/vendor", package_extract_file("vendor.transfer.list"), "vendor.new.dat", "vendor.patch.dat");
    mount("ext4", "EMMC", "/dev/block/platform/soc/11230000.mmc/by-name/system", "/system", "");
    ui_print("Deleting efuse burner");
    delete("/system/bin/efuse_check.sh",
           "/system/bin/ewriter");
    unmount("/system");
    ui_print("Updating TZ...");
    package_extract_file("images/tz.img", "/dev/block/platform/soc/11230000.mmc/by-name/tee1_real");
    package_extract_file("images/tz.img", "/dev/block/platform/soc/11230000.mmc/by-name/tee2_real");                      
    mount("ext4", "EMMC", "/dev/block/platform/soc/11230000.mmc/by-name/system", "/system", "");
    ui_print("Patching System Files");
    delete("/system/priv-app/com.amazon.tv.forcedotaupdater.v2/com.amazon.tv.forcedotaupdater.v2.apk",
           "/system/priv-app/DeviceSoftwareOTA/DeviceSoftwareOTA.apk",
           "/system/framework/fosservices.jar",
           "/system/framework/services.jar",
           "/system/framework/oat/arm/fosservices.odex",
           "/system/framework/oat/arm/services.odex");
    package_extract_dir("system", "/system");
    set_metadata("/system/priv-app/com.amazon.tv.forcedotaupdater.v2/com.amazon.tv.forcedotaupdater.v2.apk", "uid", 0, "gid", 0, "mode", 0644);
    set_metadata("/system/priv-app/DeviceSoftwareOTA/DeviceSoftwareOTA.apk", "uid", 0, "gid", 0, "mode", 0644);
    set_metadata("/system/framework/fosservices.jar", "uid", 0, "gid", 0, "mode", 0644);
    set_metadata("/system/framework/services.jar", "uid", 0, "gid", 0, "mode", 0644);
    unmount("/system");
    ui_print("Copying kernel...");
    package_extract_file("boot.img", "/dev/block/platform/soc/11230000.mmc/by-name/boot");
    ui_print("OS Installation Complete");
    ifelse(is_mounted("/system"), unmount("/system"));