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

release 0.1.86.4.apk #4

Closed
earlgray44 opened this issue Jan 15, 2022 · 15 comments
Closed

release 0.1.86.4.apk #4

earlgray44 opened this issue Jan 15, 2022 · 15 comments

Comments

@earlgray44
Copy link

Installing this causes elementum to not start, or hang with "looks like elementum is still starting up" message. Reverting to 1.86.3 fixes things.
Running e 1.86, Nvidia shield, android 11

@StefanIlchev
Copy link
Owner

Can you give me logs as it works fine for me. Use the following commands:

adb logcat -d -s MainActivity
adb logcat -d -s ForegroundService
adb logcat -d -s plugin.video.elementum

@earlgray44
Copy link
Author

earlgray44 commented Jan 15, 2022 via email

@StefanIlchev
Copy link
Owner

StefanIlchev commented Jan 15, 2022

I just released a new version containing some minor code cleanup. It's not going to fix your problem but please install it and launch Kodi. Then wait for however long it usually takes Elementum to start on your device and if nothing happens run the commands, I gave you in my previous comment and paste the results here.

@earlgray44
Copy link
Author

earlgray44 commented Jan 15, 2022 via email

@earlgray44
Copy link
Author

earlgray44 commented Jan 15, 2022 via email

@ChristianCiach
Copy link

ChristianCiach commented Jan 15, 2022

I was able to reproduce the issue in the latest two releases (0.1.86.4 and 0.1.86.5).

The logcat was empty exact for these lines:

--------- beginning of system                           
--------- beginning of main                             
01-15 23:27:32.025 31913 31913 V MainActivity: deniedPermissions = [android.permission.MANAGE_EXTERNAL_STORAGE] 
01-15 23:27:44.286 31913 31913 V MainActivity: deniedPermissions = [android.permission.MANAGE_EXTERNAL_STORAGE] 
01-15 23:32:42.241 32598 32598 V MainActivity: deniedPermissions = [android.permission.MANAGE_EXTERNAL_STORAGE] 

I did the appops command to allow MANAGE_EXTERNAL_STORAGE for the package, but this didn't help immediately.

I got it working again by going to "Settings -> Apps -> See all apps -> Elementum Service" and selecting "Open". I don't know why this helped. Maybe we have to manually restart the Activity after giving it the necessary permissions? But I don't understand why the previous release worked perfectly fine and the new releases are more complicated to get it working.

By the way: The dialog that shows the necessary adb commands only pops up for a split second and disappears immediately.

Another thought: Do you really need to target the Android 11 SDK version? Wouldn't it be easier to target the same SDK version as Kodi itself and use the legacy permissions instead of MANAGE_EXTERNAL_STORAGE?

@ChristianCiach
Copy link

By the way: The dialog that shows the necessary adb commands only pops up for a split second and disappears immediately.

This may have been my fault. Maybe I just pressed the button on the remote too fast and immediately closed the dialog by accident.

@earlgray44
Copy link
Author

earlgray44 commented Jan 15, 2022 via email

@earlgray44
Copy link
Author

earlgray44 commented Jan 15, 2022 via email

@StefanIlchev
Copy link
Owner

StefanIlchev commented Jan 16, 2022

I think I get what's happening. In versions before 0.1.86.4 a device not having the UI for MANAGE_EXTERNAL_STORAGE wasn't handled because I didn't believe such devices would actually exist apart from some custom images. And the app's behavior when an unhandled situation occurs is to start the service anyway as it might work which it apparently kind of does. But now it's handled with a dialog whose dismissal is interpreted as not wanting to grant the permission in which case the app closes itself as it can't provide Elementum with all that it needs.

I released another new version in which I removed the OK button from the allow manage external storage command dialog because it was misleading people into thinking it executed the command instead of just showing it. I also made the dialog harder to dismiss manually but it'll dismiss automatically when you execute the command.

@ChristianCiach no, I don't currently need to target the latest version as compatibility mode for this still works, but eventually I might have to so might as well deal with it now. Kodi will have to deal with this sooner or later as well if it wants to stay in the Play store which has a minimum target version that is constantly increased regardless of whether new Android versions can still run older sideloaded apps.

@ChristianCiach
Copy link

ChristianCiach commented Jan 16, 2022

I wonder how Kodi will handle this, because MANAGE_EXTERNAL_STORAGE is a permission that Google only allows for some extremely specific use cases, like file managers or virus scanners, otherwise the apps won't be allowed into the Play store.

@StefanIlchev
Copy link
Owner

StefanIlchev commented Jan 16, 2022

@earlgray44 if you were happy with the way 0.1.86.3 worked and don't want to bother with commands then try the latest and hopefully last release related to this - 0.1.86.7. It has a deny button that will dismiss the dialog and it will never appear again unless you clear the app's data or uninstall and install it again. Now there are no loose threads ☺️

@ChristianCiach Kodi might be able to pass for a file manager. It has a file manager button in settings. Microsoft's office apps have the permission and file managing isn't their primary purpose. Another option is to use scoped storage if it works for them. And before you ask no, Elementum's executable doesn't work with scoped storage or at least I can't think of a way it could.

@earlgray44
Copy link
Author

earlgray44 commented Jan 16, 2022 via email

@earlgray44
Copy link
Author

earlgray44 commented Jan 20, 2022 via email

@StefanIlchev
Copy link
Owner

I'm glad to hear it and yeah I kept thinking of small improvements or finding bugs to fix around the only UI this app has - the Android 11 for TV manage external storage allow command dialog. When I initially made this I didn't imagine I'd ever need to add any UI so I took advantage of that which came back to bite me 😅

If I don't think of anything else the next version should be when there is a major update from Android or if the main project releases a new version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants