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

android: some runtime permissions / keys fixes. #5207

Merged
merged 3 commits into from Aug 15, 2019

Conversation

@pazos
Copy link
Contributor

commented Aug 14, 2019

  • do not request write settings permission at launch
  • do not uncompress assets if we don't have read and write permissions on external storage.
  • do not propagate mute key events to the frontend

Requires koreader/android-luajit-launcher#169
Related to #5205
Fixes #5206

@pazos pazos added this to the 2019.09 milestone Aug 14, 2019

@pazos pazos added Android bug labels Aug 14, 2019

@pazos pazos changed the title android: do not request write settings permission at launch android: some runtime permissions / keys fixes. Aug 14, 2019

@Frenzie Frenzie merged commit 84b06d2 into koreader:master Aug 15, 2019

1 check passed

ci/circleci Your tests passed on CircleCI!
Details
@poire-z

This comment has been minimized.

Copy link
Contributor

commented Aug 18, 2019

Small (but big :) bug introduced by this PR:

On my Android 6.0.1 phone, v2019.08-4-g0b8d154_2019-08-13 launches correctly, while v2019.08-9-gaae6acb_2019-08-14 crashes:

1302  1314 V KOReader: dl.lua - dl.dlopen - library lname detected /system/lib/libc.so
1302  1314 V KOReader: dl.lua - sys_dlopen - loading library /system/lib/libc.so
1302  1314 W linker  : /data/data/org.koreader.launcher/files/libs/libwrap-mupdf.so: unused DT entry: type 0xf arg 0xbbb
1302  1314 E KOReader: [NativeThread]: failed to run script: frontend/document/canvascontext.lua:42: attempt to call field 'isColorEnabled' (a nil value)
1302  1314 E KOReader: [NativeThread]: Stopping due to previous errors

Probably because of an early/wrong return:
50ce8d4#diff-c14ee0e93f7187eeb6f6fe8af52cf0b7R176
which causes android Device:init() to not call Generic.init(self) and not get the other settings (like isColorEnabled or hasMultiTouch).

Dunno if you want the if timeout > 0 elseif timeout == -1 wrapped by a if timeout then, or one of these 2 be the default when G_reader_settings:readSetting("android_screen_timeout") has not been defined.

@poire-z

This comment has been minimized.

Copy link
Contributor

commented Aug 19, 2019

pinging @pazos, in case you miss that ^
(the nightly apks would crash for new users or those that have neither played with the timeout setting)

@Frenzie

This comment has been minimized.

Copy link
Member

commented Aug 19, 2019

Which is probably most. ;-)

@pazos

This comment has been minimized.

Copy link
Contributor Author

commented Aug 20, 2019

🤦‍♂ Just commented in #5228 without idea of the issue.

@pazos pazos referenced this pull request Aug 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.