Access to system files

Post your questions and help other users.

Moderator: Martin

User avatar
Klusek
Posts: 2
Joined: 12 Mar 2016 14:02

Access to system files

Post by Klusek » 14 Mar 2016 08:51

I want to use "File Observer" trigger and "Google Drive Upload Files" Actions but they do not have access to files in system/data (I don't see any folder there), Even if you enter the path manually.

Is this normal or perhaps I do something wrong?

I have root, Secure Settings and any other needed stuff ;)

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Access to system files

Post by Martin » 14 Mar 2016 19:05

Hi,

Some paths like /data are not accessible by regular apps like Automagic. Automagic does not support to access such files directly but you could copy the files to another location with an action Execute Root Command where regular apps have permission to read the files. Listening to file system events in such paths is also not supported.

Regards,
Martin

User avatar
Klusek
Posts: 2
Joined: 12 Mar 2016 14:02

Re: Access to system files

Post by Klusek » 14 Mar 2016 21:12

Thank you very much. Your suggestion helped me a lot , so that I was able to solve my problem.

natong
Posts: 80
Joined: 29 Aug 2015 05:24

Re: Access to system files

Post by natong » 24 Mar 2016 13:01

I just updated my phone to Android 6.0. My File Observer can't monitor /sdcard/Pictures. Is there any limit on Android 6.0?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Access to system files

Post by Martin » 24 Mar 2016 21:02

Hi,

What device model are you using? Is /sdcard/ a real physical sd card? I think that Android does not support the file observer events on external sd cards.

Regards,
Martin

natong
Posts: 80
Joined: 29 Aug 2015 05:24

Re: Access to system files

Post by natong » 25 Mar 2016 12:43

Martin wrote: What device model are you using? Is /sdcard/ a real physical sd card? I think that Android does not support the file observer events on external sd cards.
I using Lenovo K3 Note, official ROM, non root.

Internal storage = /sdcard = /mnt/sdcard = /mnt/m_internal_storage
External storage = /storage/428A-F2FD = /mnt/m_external_sd

Monitor on /sdcard/abcd is working well.
but can't monitor on /sdcard/Pictures/Screenshots
Maybe some stock app lock down these folder.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Access to system files

Post by Martin » 26 Mar 2016 19:01

That's interesting. I can reproduce this issue with the built-in screenshot feature on a Nexus device. Maybe it's some kind of security feature to avoid that apps listen for screenshots.
You could try to detect the notification with trigger Notification on Statusbar displayed if the screenshot app on your device also shows such a notification (package: com.android.systemui, Text contains text Screenshot).

natong
Posts: 80
Joined: 29 Aug 2015 05:24

Re: Access to system files

Post by natong » 17 Apr 2017 11:32

Just update news about File Observer. I saw these statement on Dropsync app.
Instant upload sometimes does not work on Android 6.0/7.0
There is a bug in Android 6.0/7.0 which breaks file change monitoring (technically speaking FileObserver class). Instant upload relies on this system function to work. It’s not that file change monitoring stops working completely. Sometimes it works, sometimes it does not. Changes on SD card definitely cannot be detected. We implemented a limited workaround which works quite well for photos but not for other file types.

This is a system level bug apps cannot do anything about. It must be fixed by Android team.

srichter
Posts: 3
Joined: 09 Jan 2018 16:32

Re: Access to system files

Post by srichter » 09 Jan 2018 19:54

Martin wrote:Hi,

Some paths like /data are not accessible by regular apps like Automagic. Automagic does not support to access such files directly but you could copy the files to another location with an action Execute Root Command where regular apps have permission to read the files. Listening to file system events in such paths is also not supported.

Regards,
Martin
Are there any plans to add this functionality for rooted users? I would love to be able to monitor the file /sys/class/switch/tri-state-key as it will allow me to create flows to interact with the alert slider on my OnePlus 3T

Thanks

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Access to system files

Post by Desmanto » 10 Jan 2018 17:06

srichter wrote: Are there any plans to add this functionality for rooted users? I would love to be able to monitor the file /sys/class/switch/tri-state-key as it will allow me to create flows to interact with the alert slider on my OnePlus 3T

Thanks
The tri-state-key is to check the interruptions mode right? If yes, there is trigger Interruptions Mode, which you can use to do something based on the mode. There is also action Set Interruptions mode.

I don't know how file/folder listening normally works. Probably it is done via media storage database, which already monitor all file changes. But for any folder outside of user accessible ones, we have to use root command. It is possible to loop and cat the content of that file. But it will definitely kill your battery, since the flow is running all the time.

Other alternative (if interruptions mode doesn't work) is to create your own widget for slider. When you change the mode in this widget slider, use root command to change the tri-state-key to make it sync.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Post Reply