Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fire OS 8 on FireTV: Allow enabling SAF (for file exports/imports) #10643

Open
6 tasks done
k9janer opened this issue Dec 9, 2023 · 6 comments
Open
6 tasks done

Fire OS 8 on FireTV: Allow enabling SAF (for file exports/imports) #10643

k9janer opened this issue Dec 9, 2023 · 6 comments
Labels
Android TV Issue is related to Android TV bug Issue is related to a bug device/software specific Issues that only happen on some devices or with some specific hardware/software import/export

Comments

@k9janer
Copy link

k9janer commented Dec 9, 2023

Checklist

  • I am able to reproduce the bug with the latest version given here: CLICK THIS LINK.
  • I made sure that there are no existing issues - open or closed - which I could contribute my information to.
  • I have read the FAQ and my problem isn't listed.
  • I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
  • This issue contains only one bug.
  • I have read and understood the contribution guidelines.

Affected version

0.25.2

Steps to reproduce the bug

On a Fire TV Stick 4K Max 2nd Gen, it seems to be impossible to export/import settings as SAF can't be enabled on Fire TVs and without SAF, the app doesn't have the necessary permission.

This is possibly a side effect of the solution to my previous issue #6455.

This issue doesn't occur with FireOS 7 (Android 9) but it seems like FireOS 8 (Android 11) triggers it.

To reproduce:

  • Copy a settings file to your Fire TV (e.g. to /storage/emulated/0/NewPipe/NewPipeData.zip)
  • Install NewPipe
  • Go to sidebar - Settings - Content - Import database
  • Try to locate the file

You will see, that the file is not visible and can't be selected.

Now try to enable SAF to be able to select the file this way:

  • Go to sidebar - Settings - Download
  • You will see that it says "Starting from Android 10 only SAF is supported" but the toggle is turned off and it can't be enabled.

Other workarounds I tried don't seem to work either:

  • Using Total Commander to share the NewPipeData.zip file with NewPipe causes an error. NewPipe seems to only expect urls this way.
  • Renaming the NewPipeData.zip file to NewPipeData.zip.png DOES make it visible and allows me to proceed to the "This will override your current setup" dialogue, but NewPipe then refuses the file with a "No valid ZIP file" error message.

Expected behavior

It should be possible to use SAF on Fire TV if the non-SAF-path isn't viable.

If possible, please rework the solution in issue #6455 to EXCLUDE FireOS 8+ Fire TVs and allow them to use SAF.

Maybe it's not possible to navigate the SAF dialogue but it's still better to be able to navigate the menu with an external mouse then not beeing able to export/import settings AT ALL.

Actual behavior

No response

Screenshots/Screen recordings

No response

Logs

No response

Affected Android/Custom ROM version

Android 11 / FireOS 8.1.0.1

Affected device model

Fire TV Stick 4K Max (2nd Gen)

Additional information

No response

@k9janer k9janer added bug Issue is related to a bug needs triage Issue is not yet ready for PR authors to take up labels Dec 9, 2023
@k9janer
Copy link
Author

k9janer commented Dec 9, 2023

Update: I'm no developer but I just tried it by broadly disabling the check for a Fire TV in app/src/main/java/org/schabi/newpipe/settings/NewPipeSettings.java

    public static boolean useStorageAccessFramework(final Context context) {
        // There's a FireOS bug which prevents SAF open/close dialogs from being confirmed with a
        // remote (see #6455).
        if (DeviceUtils.isFireTv()) {
            return false; -> return true;
        } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
            return true;
        }

Now SAF is enforced and the import works without an issue. :)

As feared, I couldn't browse directories in the file open dialogue, however thankfully the first time I tried it, it opened in the recent section and so I could easily pick the file. (The second time I tried it, it opened in the Download directory where I also had that same NewPipeData.zip file).

Maybe this Fire TV check should be refined and limited to pre-Android 10?

@opusforlife2 opusforlife2 added device/software specific Issues that only happen on some devices or with some specific hardware/software Android TV Issue is related to Android TV and removed needs triage Issue is not yet ready for PR authors to take up labels Dec 9, 2023
@mangoheini
Copy link

Update: I'm no developer but I just tried it by broadly disabling the check for a Fire TV in app/src/main/java/org/schabi/newpipe/settings/NewPipeSettings.java
[...]
Now SAF is enforced and the import works without an issue. :)
[...]

I'm also affected. Losing my whole viewing history stops me from migrating to my new FireTV Stick 4k max (2nd gen). :-(
Would be really nice to have this fixed.

@k9janer I'm even more no developer than you. What did you do exactly to test your findings and is this suitable as workaround on the firetv stick?

I noticed something else during my unsuccessful import attempts. If you export settings on the FireTV Stick 4k max (2nd gen), this file (next to the invisible one coming from my old stick) is then visible in the import window and the import seems to work. Even if you rename the file. However, I have not been able to move the contents of my old installation to Newpipe. Newpipe somehow "knows" its own exported file.

@k9janer
Copy link
Author

k9janer commented Dec 24, 2023

Well, I just loaded the project in Android Studio, changed the file as stated and created a signed apk file. Then I copied that to a USB stick and connected that to the FireTV Stick with a USB Y splitter cable to be able to access and install it with Total Commander. You have to uninstall the original version of NewPipe beforehand however. I copied my export file the same way from the old FireTV Stick to the new one. I haven't found a way to import settings without compiling a new version of NewPipe as all the workarounds I have tried (renaming the file, sharing it to NewPipe from a file manager) failed.

Instead of using an USB Y cable I guess you could also just upload the files somewhere but entering urls is painful with a remote.

However I noticed, that both NewPipe and STN crash because they keep running out of memory - NewPipe when updating my massive subscription list as it reaches channel ~180 and STN has to recover from an out of memory issue every few minutes or so with a 4K video.

To be honest, I have given up on the Fire TV Stick 4K Max 2nd Gen. It's version of Android 11 is just too buggy for me. I usually share videos from NewPipe to STN for the superior playback capabilities (HDR, framerate switching and so on) but the sharing menu is completely broken on FireOS 8. Also the SAF dialogue still can't be navigated and is now mandatory, there are the out of memory issues (maybe they are my fault though) and the device can't even adb debugg itself anymore so I can't easily disable apps with App Manager.

So I just returned back the the original 4K Max for now. It would be nice to have a device with Android 11 instead of the ancient Android 9 for security and app compatibility purposes but it's just not worth it with all the issues.

@mangoheini
Copy link

@k9janer Thank you so much for your detailed answer. Wasn't able to respond earlier because of an acute covid infection in my family.

Thanks for describing your steps but as you might expect, patching and compiling each NewPipe version on my own is not a thing I want to learn right now. ^^ I'll keep an eye on this issue and stay with my 4K Max (gen1) for the time being.

Please excuse my off topic question: I know App Manager. Have used it on other Android devices in the past but never thought of Firetvs. Is there a list of Apps available somewhere, that can be disabled safely on the 4K Max (gen1)? FireTVs need to be debloated more than any other device.

@k9janer
Copy link
Author

k9janer commented Jan 12, 2024

Compiling your own version of NewPipe is really easy though. :) I didn't even follow any guides, I just imported the project into Android Studio, changed the code snippet and created an apk. The program is pretty beginner friendly considering all its possibilities and there are no hurdles like dependencies or the like that I had to solve.

Regarding debloating, on my 4K Max 1. Gen I just disabled all the AMAZON SPECIFIC stuff, that didn't seem important like Amazon Kids, Whisper Sync, Alexa, Amazon Shopping, Device Metrics, IMDB, Freeview and so on. Be careful with CORE ANDROID stuff like the Web View and the like as this will likely break the OS. You can then block the remaining ads and tracking with a VPN app like NetGuard or RethinkDNS.

Looks like there is also a debloat toolbox you could use if you trust that app.

@IMMalebolgia
Copy link

Coming here from my recent issue as it seems to be a duplicate.

The one thing is that I can export my config to a file even on the Gen 2 and I can load that same file back in but the issue comes from a file that I have transferred from another device and those are invisible to the app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android TV Issue is related to Android TV bug Issue is related to a bug device/software specific Issues that only happen on some devices or with some specific hardware/software import/export
Projects
None yet
Development

No branches or pull requests

5 participants