yashsingh1/xdaforums huggingface dataset:
[Fire TV Android Development] vprasinos:
So I also tried 5.2.7.2. No dice. Tried holding the home button for more than 1 minute. No dice. Lineage or Stock no dice. I am starting to wonder whether flashing ROMs somehow screwed my Bluetooth chip since the whole situation indicates a hardware problem.

In favour of the hardware problem points me the issue that when in Lineage I plug in the OTG cable with a wireless remote that I can control the stick (no back button though but I think this is solvable) I keep getting a screen "Bluetooth service has stopped" and points me to press "ok". When in settings trying to turn bluetooth on, it tries and then nothing. I can't keep Lineage because this dialogue is annoying and pops up every 15 seconds or so.

So how can I check if bluetooth service is running in either lineage or stock? This can happen in Lineage while system is running since I can connect to wifi but not on stock since I must pair first before entering the system.

Thanks
[Fire TV Android Development] Sus_i:
Maybe you see some errors in logcat, but you need to enable adb debugging for it. Since you cannot complete the setup, only way is via twrp and a build.prop edit.

Something like this worked for the Stock rom on 4k stick and I guess its the same for tank. You need to add/edit this lines in the build.prop file:

persist.service.adb.enable=1

persist.service.debuggable=1

persist.sys.usb.config=mtp,adb

@0815hoffi posted somewhere nice echo commands for use with twrp shell (ask him), but you can also adb pull/push the file and edit it in between...

On the 4k stick its possible to bypass the setup with that commands:

adb shell settings put global setup_wizard_has_run 1

adb shell settings put secure user_setup_complete 1

adb shell settings put global device_provisioned 1

I guess that works too for tank, but I've never messed with that on tank. In case it works, you can use your phone / i.e. the fireTV app as a remote (workarround).
[Fire TV Android Development] 0815hoffi:
@vprasinos

You can try to Flash TWRPtestDelALandOOBE.zip in TWRP.

It will remove Amazon Launcher and install Wolf-Launcher.

It also remove Amazon OOBE to bypass initial setup and

writes

to build.prop.

Use my Settings app to enable ADB and pair your remote ( needs root Access )

You can also try to use your TV remote to pair Amazon Remote .

( enable HDMI CEC on your TV and use TV Remote )

after that run:

adb shell settings put global setup_wizard_has_run 1

adb shell settings put secure user_setup_complete 1

adb shell settings put global device_provisioned 1
[Fire TV Android Development] vprasinos:
Thanks so much for this zip, my stick is almost usable again...

So as far as the remote pairing process still no dice. The wolf launcher shows though that bluetooth is enabled after boot (the bluetooth icon stays on next to the wifi icon then dissapears). It seems something else is going on. Could you please let me know where I can find the log file from the debuggable service?

I am using the HDMI CEC to control the stick and while this is a good alternative, when I connect the RKM wifi remote control with the OTG cable, I get no mouse appearing on the screen and no back button - also no home button. Where are the mappings I can configure? Have you done this before?

Thanks again for your efforts
[Fire TV Android Development] 0815hoffi:
🤷‍♂️ i dont know, maybe you can get it with.

# adb logcat

I think cec can't be remapped, but you can try with buttons remapper .

@Sus_i do you know the location of the logfile....
[Fire TV Android Development] vprasinos:
You got it wrong. I don't want to remap CEC, I want to remap a wifi tv remote control connected with OTG cable to tank. From my experience there should be a file with keymaps that needs to be created or changed.

Also adb logcat produces so much output at realtime that I cannot filter. It's like a 10-20 lines per second...
[Fire TV Android Development] 0815hoffi:
Logcat command-line tool | Android Studio | Android Developers

Logcat is a command-line tool that dumps a log of system messages, including stack traces, when the device throws an error and sends messages that you have written from your app with the Log class.

developer.android.com

Logcat -c clean

Logcat -d

Buttons remapper should work.

You must edit one of the kl files under

/system/usr/keylayout/Generic.kl

Change the Numbers....

I think you can identify the Nummer by running Logcat and then press the Button on your remote.

But you must find the correct kl file for your remote under system/usr/keylayout/...
[Fire TV Android Development] Sus_i:
I would use constantly saving to PC as txt file

adb logcat > logcat.txt

and watch out with notepad++ during some pairing attempts...
[Fire TV Android Development] 0815hoffi:
Look like Amazon has released a new Fire OS 5.2.7.7 (662663920) for Tank.

update tank_full_tank 662663720 to 662663920

https://d1s31zyz7dcc2d.cloudfront.net/b14e3885e24d26616da8c0e97f3c5134/update-kindle-full_tank-288.6.6.2_user_662663920.bin

@vprasinos

I tested it today.

Then had the same Problem, after flash back from lineageos to fireos.

Not possible to pair remote.

This was my solution:

Reset Your Fire TV Remote

Press and hold the Home button. ...

Release the Home button.

Press the Menu button 9 times.

Remove the batteries from your remote.
[Fire TV Android Development] vprasinos:
Hi Sus_i, I did but I got a file of 2,5MB in just 30 secs. I can't make anything out of it. Maybe you could have a look?

Thanks
[Fire TV Android Development] vprasinos:
I tried it with 5.2.7.2 but not successful. Do I need to upgrade to 5.2.7.7 first? Should the stick be unplugged when I perform this or on and looking for the remote?
[Fire TV Android Development] 0815hoffi:
My Stick was connected at initial pairing screen.

But i have not released the homebutton.

Hold homebutton, press menu 10 - 15 times then my remote was connected.

Strange, but it worked 🤷‍♂️

But maybe you have a other Problem....
[Fire TV Android Development] 0815hoffi:
To reduce logcat you can try my debloat script

https://github.com/0815hoffi/FireTV-2k-4k-debloat/raw/main/2-Settings.cmd

I think it comes from the skipped oobe, that you have so much output at logcat...
[Fire TV Android Development] Febag92:
Just tested and everything works fine here, I did a full wipe to start fresh, installed the update and the latest Magisk.
[Fire TV Android Development] Sus_i:
The output is normal/ok.

I guess the Stick trys always to pair via wifi... while the remote is in BT mode.

Whats about hoffis reset button combination? Works for you?
[Fire TV Android Development] vprasinos:
No it didn't. No combo works for me. How did you find out that my stick tries to pair via wifi?
[Fire TV Android Development] vprasinos:
Need time to do that, I will try tomorrow and re-post the logcat
[Fire TV Android Development] 0815hoffi:
Ok you can try it, but one hint.

My script deletes very much Amazon Apps,

only way back is to reflash Stock rom.
[Fire TV Android Development] vprasinos:
So here's the logcat, after reboot and after debloating. It's significantly less now (only 220kb) and here are the relevant lines, while I perform a pairing process:

D/BluetoothAdapter( 2106): 279818164: getState() : mService = null. Returning STATE_OFF

(multiple times)

D/BluetoothUtility( 2106): Discovery has stalled. Assuming discovery did actually start.

D/BluetoothAdapter( 2106): 279818164: getState() : mService = null. Returning STATE_OFF

(multiple times)

W/ControllerProvider( 2106): Bluetooth didn't seem to come up. Skip reconciling device list

D/BluetoothAdapter( 2106): 279818164: getState() : mService = null. Returning STATE_OFF

(multiple times)

D/BluetoothUtility( 2106): Waiting for discovery to begin

D/BluetoothAdapter( 2106): 279818164: getState() : mService = null. Returning STATE_OFF

(multiple times)

D/BluetoothUtility( 2106): Discovery still hasn't started... trying again

D/BluetoothAdapter( 2106): 279818164: getState() : mService = null. Returning STATE_OFF

(multiple times)

D/BluetoothUtility( 2106): Discovery still hasn't started... trying again

D/BluetoothAdapter( 2106): 279818164: getState() : mService = null. Returning STATE_OFF

(multiple times)

D/BluetoothUtility( 2106): Discovery still hasn't started... trying again

D/BluetoothAdapter( 2106): 279818164: getState() : mService = null. Returning STATE_OFF

(multiple times)

D/BluetoothUtility( 2106): Discovery still hasn't started... trying again

D/BluetoothAdapter( 2106): 279818164: getState() : mService = null. Returning STATE_OFF

(multiple times)

W/ControllerProvider( 2106): Bluetooth didn't seem to come up. Skip reconciling device list

D/BluetoothAdapter( 2106): 279818164: getState() : mService = null. Returning STATE_OFF

(multiple times)

D/BluetoothUtility( 2106): Waiting for discovery to begin

D/BluetoothAdapter( 2106): 279818164: getState() : mService = null. Returning STATE_OFF

(multiple times)

D/BluetoothUtility( 2106): Discovery still hasn't started... trying again

D/BluetoothAdapter( 2106): 279818164: getState() : mService = null. Returning STATE_OFF

(multiple times)

D/BluetoothUtility( 2106): Discovery has stalled. Assuming discovery did actually start.

and the previous messages repeat over time. Is the bluetooth module dead? Is that why the bluetooth icon appears at the top bar of the wolf launcher and then dissapears just after boot time?
[Fire TV Android Development] vprasinos:
I took another logcat some mintues after completely different output. Here it is.

The style of this logcat is like

I/Vitals ( 244): performance:cool_activity_launch_time:KDMv3_Data=[['com.amazon.tv.settings.v2'!574.000000!574.000000!574.000000!1.000000!com.amazon.tv.settings.v2/.tv.controllers_bluetooth_devices.ControllersAndBluetoothActivity!{"d"#{"app_version"#"613035210"}$"m"#{"context"#"S1T0A1D0I0L1E0M0"$"prev"#"com.markus.firetools/.A4Activity"}}!{"d"#{"software_version"#"288.6.4.8_user_648595120"}}]!['com.wolf.firelauncher'!3331.000000!1632.000000!1699.000000!2.000000!com.wolf.firelauncher/.screens.launcher.LauncherActivity!{"d"#{"app_version"#"11723945"}$"m"#{"context"#"S1T0A1D0I0L1E0M99"$"prev"#"null"}}!{"d"#{"software_version"#"288.6.4.8_user_648595120"}}]];DV;1,KDMv3_Unit=ms;DV;1:HI
[Fire TV Android Development] Sus_i:
Only a guess based on your log mate

I/WifiControllerService( 1057): Group should be active because this ships with a WiFi remote and we've started discovering

D/WifiControllerService( 1057): Waiting for discovery to begin

I/WifiP2pService( 1057): DISCOVER_PEERS peerType =1

I/wpa_supplicant( 1392): P2P: Successfully set hidden SSID to 0 for interface p2p-wlan0-0

E/WifiP2pService( 1057): applyAutoGOHiddenSSIDState: remote_discovery_on=true wps_pbc_on=false wfd_on=false hiddenSSID=false

D/WifiControllerService( 1057): Start Wifi P2P Discovery succeeded

D/WifiControllerService( 1057): Discovery started
[Fire TV Android Development] Gast2:
how to disable dependency on amazon account?
[Fire TV Android Development] MiaXiao:
all the below Links are dead someone please upload the oldest one 5.2.6.8

September 21, 2019 - 5.2.7.1_r1 (md5sum: dcb2ec970f0f2937ef53bf6f4c824c28)

June 29, 2019 - 5.2.7.0_r1 (md5sum: ba6ca5312053628d4fc84d34b7c6cfd5)

March 30, 2019 - 5.2.6.9_r1 (md5sum: ff7669e329244dfebee2968777a37fc7)

March 17, 2019 - 5.2.6.8_r1 (md5sum: 8b68a96e4d6b908ddc9ee565d2ec2929)
[Fire TV Android Development] MiaXiao:
is there anyone who can upalod the old firmware?
[Fire TV Android Development] brentonv:
If you read through the post replies you would have found this mate

http://aftvhacks.de/downloads/rooting/fire-tv-stick-2/tank-5.2.6.8-rooted_r1.zip
[Fire TV Android Development] MiaXiao:
than

i just want to ask one question like i wanted to downgrade my tank stick to 5.2.6.8 i have done it via trrp but when it starts for the very first time after asking for wi-fi connection it auto download new version and go in recovery and update by itself.Is there anyway to bypass start-up setup after remote connection setup?
[Fire TV Android Development] MiaXiao:
or somehow if we can disable an APK installation though out system i want to disable any auto APK install after first run any app for that?
[Fire TV Android Development] WoOzGaME:
Hello, it's possible to install this version on a most recent version of Fire TV OS ? (I have the last version)
[Fire TV Android Development] jbvid:
Hi

By the 'most recent version' do you mean the Firestick 4k?

You need to be sure which version you have, FireStick 2 (2nd Gen), Fire tv 2, Firestick 4k. then look at the relevant thread about unlocking and root.

jb
[Fire TV Android Development] saurabhshri:
After installing any of these images (`adb shell twrp install <img.zip`), and doing `adb shell reboot`, generally how long do you have to wait for stick to start. I have tried flashing multiple times, it appears to finish successfully but I do not seem to be able to move past 'FireTV Stick' logo screen. I am not sure if it's the waiting period or I am in a bootloop.

I have created another thread with all the details and logs : https://xdaforums.com/t/firetv-stick-2nd-gen-tank-stuck-on-logo-unlocked-twrp-available.4288487/ if you guys can take a look?

Thanks!
[Fire TV Android Development] nitinsawant:
how to disable the updates immediately after flashing this rom?

whenever I install this rom and connecting to internet

it is updating to latest version of fire os.

how do i disable the updates from twrp or something like that?
[Fire TV Android Development] aiamuzz:
@rbox ...

FYI ... I tried to flash the latest Prerooted Stock ROM from the OP ... but I just couldn't log into the amazon prime account on it ... which means i couldn't get past the setup wizard.

STRANGELY though ... I tried logging in with 3 different Amazon Prime accounts ... All 3 accounts returned with Username/Password error ...

HOWEVER WHEN I TRIED TO LOGIN WITH A NON PRIME ACCOUNT, I COULD GET PAST THE PASSWORD SCREEN ONTO THE OTP SCREEN BUT THERE I FAILED IN SPITE OF ENTERING MORE THAN 10 OTP'S AMAZON KEPT MESSAGING ME WITH !!!

I WONDER WHY A NON-PRIME ACCOUNT COULD GO ALL THE WAY TILL THE OTP SCREEN BUT 3 DIFFERENT PRIME ACCOUNTS FAILED RIGHT AT THE USERNAME PASSWORD AUTHENTICATION !!!
[Fire TV Android Development] Marcyvee:
What's feature this prerooted rom has that the stock has not? Is there a review somewhere?

Is there the possibility to enable the chrome casting?

And lastly, can I install it on the last firestick firmware?
[Fire TV Android Development] slaynick:
Hi everyone, I can't use adb. I need to reinstall stock firmware. I used the guide to unlock boot. boorom-step, then fastboot-step. What do I do now? i have twrp active but i can't use otg for mouse and keyboard. How can I control via linux ???? with active twrp I can't go to adb, how can I go to recovery ???
[Fire TV Android Development] Marcyvee:
With twrp booted, run terminal on Linux and do:

sudo adb shell

Type your password and then the twrp commands, such as

twrp wipe data
twrp install /path
twrp reboot recovery
[Fire TV Android Development] Daimonion777:
Hello folks,

Does anyone know how to revert to prerooted 5.0.5 from LineageOS 12.1 on a Fire TV Stick 2?

Already did a wipe cache+Dalvik+System+Data via TWRP 3.2.3-0 and then

tried to install a montoya 5.0.5-rooted_r1.zip but unfortunately that doesn't work.

It shows me this:

Process updater ends with ERROR: 7

Failed to install zip '/usb-otg/Montoya 5.0.5/montoya-5.0.5-rooted_r1.zip'.
[Fire TV Android Development] Marcyvee:
Check of you have downloaded the tank or the montoya version of the rom. That's probably the reason of the error: 7. It must match with your firestick.
[Fire TV Android Development] Daimonion777:
Thanks for the information.

Do you maybe know where to get a tank prerooted 5.0.5 zip file?
[Fire TV Android Development] Marcyvee:
In the OP there are the download link. There are some newer.
[Fire TV Android Development] Sus_i:
Thats fine, because montoya is the name of the first fireTV stick...

You need to flash a rom for tank, a.k.a the second fireTV stick.

Btw, afaik there wasn't a 5.0.5 rom for tank at all.
[Fire TV Android Development] Daimonion777:
Oh, my person didn't know that. thanks for this information Sus_i 🙂
[Fire TV Android Development] Timewolf:
hi

i'm trying the same operation, but how can i adb in twrp? if i run adb shell i got no devices connected and i don't have an otg.
[Fire TV Android Development] Gast2:
Fire TV Stick 1 (Codename Montoya)

Fire TV Stick 2 (Codename Tank)

decide which one you have!

allow adb connections in sticky
[Fire TV Android Development] Timewolf:
how can i wipe and isntall without twrp?
[Fire TV Android Development] Gast2:
[UNLOCK][ROOT][TWRP][UNBRICK] Fire TV Stick 2nd gen (tank)

Read this whole guide before starting. This is for the 2nd gen Fire TV Stick (tank) Current relase: amonet-tank-v1.2.2.zip NOTE: Recent reports indicate a change that disables brom DL-mode The change seems to have been introduced with devices...

xdaforums.com
[Fire TV Android Development] Timewolf:
i've Tank

A mouse via USB-OTG

TWRP commandline via adb: https://twrp.me/faq/openrecoveryscript.htm

Via /cache/recovery/comman

im trying the third One, but on Ubuntu i dont have /cache
[Fire TV Android Development] Gast2:
you want to go to TVRP which is not installed via linux???
[Fire TV Android Development] Timewolf:
nevermind i bought an usb otg on amazon and now i can use twrp with a mouse :)
[Fire TV Android Development] Timewolf:
TWRP is installed i cannot interact without a mouse, neither via adb or via echo, but now i can use it with a mouse via otg
[Fire TV Android Development] Gast2:
That is unlikely ((

1. you need any system.

2. While in the system, enable adb access

3 and only then adb reboot reсoverу
[Fire TV Android Development] DP FH:
no update for recents builds?
[Fire TV Android Development] hasobist:
Deleted!
[Fire TV Android Development] asdfghjklqwert:
I have not been able to install the prerooted rom but I am able to install LineageOS. Any idea what i am doing wrong?
[Fire TV Android Development] hasobist:
Hello!

What's the error message you get?

If you can download it again and give it a try,may be incomplete download.

Before flashing Wipe Cache,Dalvik-Cache,system and flash the Rom followed by Magisk for root.

Hope it helps........

Cheers!
[Fire TV Android Development] asdfghjklqwert:
I am using the German instruction. When I try to reboot (step 7) I get an error but I disconnect power and reconnect & it does boot up to the Firestick setup screen. Then I try to install Magisk and get the below error. I can see the firestick folder on the computer.

:~$ adb install MagiskManager-v7.3.2.apk

Performing Push Install

adb: error: cannot stat 'MagiskManager-v7.3.2.apk': No such file or directory

:~$ adb install '/run/user/1000/gvfs/mtp:host=Amazon_Fire_G070L81882730JUB/Internal storage/MagiskManager-v7.3.2.apk'

Performing Push Install

/run/user/1000/gvfs/mtp:host=Amazon_Fi...ed. 4.8 MB/s (2840501 bytes in 0.565s)

pkg: /data/local/tmp/MagiskManager-v7.3.2.apk

Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]

:~$ adb install '/home/Desktop/fire/aftv hacks/MagiskManager-v7.3.2.apk'

Performing Push Install

/home/Desktop/fire/aftv hacks/Magis...ed. 6.5 MB/s (2840501 bytes in 0.418s)

pkg: /data/local/tmp/MagiskManager-v7.3.2.apk

Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]
[Fire TV Android Development] hasobist:
Hello!

Is your Firetv tank unlocked?

If so,try flashing Magisk in TWRP.

If you check few posts back ,you'll find the shared zip and apk of Magisk Manager.

Cheers!
[Fire TV Android Development] asdfghjklqwert:
It should be unlocked. I had LineagOS and magisk on it. I flashed magisk (adb shell twrp install /sdcard/Magisk-v19.3.zip). then I reboot and try install Magisk Manager (adb install /sdcard/MagiskManager-v7.3.2.apk) but get the below error.

:~$ adb install /sdcard/MagiskManager-v7.3.2.apk

Performing Push Install

adb: error: cannot stat '/sdcard/MagiskManager-v7.3.2.apk': No such file or directory

When i look at the stick i can see the fine

:~$ adb shell

shell@tank:/ $ cd /sdcard

shell@tank:/sdcard $ ls

Alarms

Android

DCIM

Download

LOS.zip

Magisk-v19.3.zip

MagiskManager-v7.3.2.apk

Movies

Music

Notifications

Pictures

Podcasts

Ringtones

TWRP

app-release.apk

app-release.zip

tank-5.2.7.1-rooted_r1.zip

tank-5.2.7.1-rooted_r1.zip.md5
[Fire TV Android Development] asdfghjklqwert:
now i tried to install magisk manager in twrp

:~$ adb install '/home/Desktop/fire/aftv hacks/MagiskManager-v7.3.2.apk'

Performing Push Install

/home/do/Desktop/fire/aftv hacks/Magis...ed. 5.4 MB/s (2840501 bytes in 0.501s)

/sbin/sh: pm: not found
[Fire TV Android Development] asdfghjklqwert:
does it being "unauthorized" have something to do with it?

:~$ adb devices

List of devices attached

G070L81882JUB unauthorized

:~$ adb disconnect

disconnected everything

:~$ adb kill-server

:~$ adb usb

* daemon not running; starting now at tcp:5037

* daemon started successfully

error: device unauthorized.

This adb server's $ADB_VENDOR_KEYS is not set

Try 'adb kill-server' if that seems wrong.

Otherwise check for a confirmation dialog on your device.

:~$ adb install /sdcard/MagiskManager-v7.3.2.apk

error: device unauthorized.

This adb server's $ADB_VENDOR_KEYS is not set

Try 'adb kill-server' if that seems wrong.

Otherwise check for a confirmation dialog on your device.

error: device unauthorized.

This adb server's $ADB_VENDOR_KEYS is not set

Try 'adb kill-server' if that seems wrong.

Otherwise check for a confirmation dialog on your device.

Performing Streamed Install

adb: failed to stat /sdcard/MagiskManager-v7.3.2.apk: No such file or directory
[Fire TV Android Development] hasobist:
Hello!

Oh yeah!

tank-5.2.7.1-rooted_r1.zip

Rename the above pre-rooted to say Firetv-Tank-5.2.7.1.zip and try flashing and the 5.2.7.3 is better.......

If you can, I did post the Magisk manager .zip and the .apk to a fellow member, if you can find it in my previous post ,if no will try finding it for you.

Cheers!
[Fire TV Android Development] hasobist:
Hello!

Yes ,that may be the reason.

Good to authorise when the dialog pops up just confirm,you can do so when your device is connected to TV and run the commands in Ubuntu or any Linux based OS,to confirm use your remote and OK,your all good.

Cheers!
[Fire TV Android Development] asdfghjklqwert:
I renamed and flashed the .3 version but i keep getting ung up on step #7 of the German guide "install Magisk Mgr". I found your old post and downloaded the files but I can't install. I do have Magisk on the TV.

:~/Desktop/fire/aftv hacks$ adb install /sdcard/MagiskManager-v22.apk

Performing Push Install

adb: error: cannot stat '/sdcard/MagiskManager-v22.apk': No such file or directory

:~/Desktop/fire/aftv hacks$ adb install '/home/do/Desktop/fire/aftv hacks/MagiskManager-v22.apk'

Performing Push Install

/home/do/Desktop/fire/aftv hacks/Magis...ed. 4.1 MB/s (6720493 bytes in 1.574s)

pkg: /data/local/tmp/MagiskManager-v22.apk

Failure [INSTALL_FAILED_ALREADY_EXISTS]

Step #7

Install Magisk Manager

So that you can better manage the rooting functions of Magisk, we recommend that

you install the Magisk Manager. Here you can e.g. Withdraw apps root rights again or

hide rooting from individual apps. Installing the Magisk Manager is as follows.

Your Fire TV should now boot as normal as before and the Fire TV start screen

should be visible. Connect again via adb with your Fire TV Stick 2 by entering the

following in the Ubuntu terminal:

adb disconnect

adb kill-server

adb usb

adb install /sdcard/MagiskManager-v7.3.2.apk

In difficult cases, you even have to switch off ADB debugging in the fire TV settings

and switch it on again 5 seconds later ... Please also consider, that from firmware

5.2.6.7 the connection via ADB on the Fire TV Stick 2 must be confirmed itself.

Sometimes your Fire TV also asks whether USB debugging should be allowed.

When the installation is complete you will receive a message.