Closed ByteHamster closed 8 years ago
That's strange. Something is removing the permission. May be I should have a check somehow that the file is executable, but that's is not exposed in Java API.
On Sat, Jul 30, 2016, 10:28 PM ByteHamster notifications@github.com wrote:
The scan binary on the internal storage can not be executed on my device because the execute permission is missing. Every time I start the app, the permission is removed. If I start the app and then change the permission using a file manager, the app works fine.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/IvanVolosyuk/diskusage/issues/37, or mute the thread https://github.com/notifications/unsubscribe-auth/AG8PHZdIwWCPBAiNVyQM2x8It7AqLSjzks5qa0NsgaJpZM4JYy_U .
If I can help you in any way by providing logs or testing new versions, don't hesitate to ask. Are apps allowed to run chmod on their own files using a shell?
This is what I do: https://github.com/IvanVolosyuk/diskusage/blob/master/src/com/google/android/diskusage/datasource/fast/NativeScannerStream.java#L120
On Mon, Aug 1, 2016 at 7:47 PM ByteHamster notifications@github.com wrote:
If I can help you in any way by providing logs or testing new versions, don't hesitate to ask. Are apps allowed to run chmod on their own files using a shell?
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/IvanVolosyuk/diskusage/issues/37#issuecomment-236536888, or mute the thread https://github.com/notifications/unsubscribe-auth/AG8PHRyK__1uekwiUmYp_rWmXhKkQT7jks5qbcCrgaJpZM4JYy_U .
Looks like this is removing the permission. That would exactly match that fact that I need to start the scan once before it helps to set the permission manually.
There is a method called file.setExecutable(). Maybe this helps to set the permission. I don't exactly know if the method is available on Android, but the Oracle Java has it ;)
Just tried to compile the app and add setExecutable() - I am not able to compile. The import android.content.pm.IPackageStatsObserver
is not found. Additionally, I don't have the ndk set up. Actually, I have to study for an assignment, so fixing the build for me looks like too much work. It would be nice if you could add the method and send me the apk to try out.
Okay, that's what happens:
The scan works (yay!) but only the first time you use it. If you go back and select another folder to scan, there is the same exception as before you implemented setExecutable. The strange thing is, even though executing works, the execute permission is NOT set on the binary file in /data. I don't really know why the setExecutable method even works then. But it does (at least once), which is great. Thank you very much! If that does not break anything, it would be great if you could run setExecutable every time a scan is started to make it possible to go back and select another folder. Anyway, I am really happy that I can now use the app, as I have not found an alternative that does its job as convenient as DiskUsage. Thanks again for this great app and for your willingness to help me!
By the way, do you know why the most recent version on F-Droid is 3.4.2 from 2013? I thought they build it automatically, directly from GitHub, as soon as you change the versionCode.
Wrong. They check git tags.
The scan binary on the internal storage can not be executed on my device because the execute permission is missing. Every time I start the app, the permission is removed. If I start the app and then change the permission using a file manager, the app works fine.