need quick trigger

Post your questions and help other users.

Moderator: Martin

Post Reply
Friend1
Posts: 52
Joined: 03 May 2017 06:00

need quick trigger

Post by Friend1 » 18 Sep 2018 07:03

Hi Desmanto,

I created a flow to secure by password my special folder (not real folder, containing apps) but, trigger UI Event works slowly on Lollipop.
Any ideas for change trigger with another? Trigger Activity Started not work reliably on Android 5.0 and lather. Any suggestion?
Second question: How to prevent this folder from deletion? Thanks.

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

Re: need quick trigger

Post by Desmanto » 19 Sep 2018 06:42

Depends on the restriction you want. There is actually no perfect method to totally protect it. All protection mostly depends on the knowledge of potential perpetrator, which in most cases are our close one : families and friends.

In these cases, plausible deniability method usual works best. The method will let the user seems to do whatever they want, but actually don't execute it. Since I don't know the complete available app, restriction you want and many other factor, I try to suggest some possible solution.

Proxy Shortcut
UI Event and app task started and ended works quite slow in terms of protection (up to 1000 ms before detection in newer android). In order for the detection to be on time, just like in my navigation apps flow, I would use shortcut. I would just use MiXplorer as example. You need a launcher which can hide the app (MiXplore) from drawer. Then create a flow to launch MiXplorer, but not using usual Action Launch App. Use Action Start Activity
Action : android.intent.action.MAIN
Explicit Component
Package Name : com.mixplorer
Class Name : (leave blank for MiXplorer or pick the main activity if required)
Flag List : There is default FLAG_ACTIVITY_NEW_TASK. Check again FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS

We use Start Activity instead, because we want the "exclude from recent". This will prevent the user from switching back to MiXplorer, bypassing the use of shortcut. After you have remove the shortcut from launcher and exclude from recent, the only way to open this app is thru the shortcut you will create using Automagic, use the same icon as the app.

Since the only way to open the app is from the Automagic shortcut, you can be 100% sure you can activate any protection you want after the user press the shortcut, no delay.

Delete protection
As for delete protection, there is no way to protect the folder. Internal storage use vfat, which can't be set for permission. To really protect it, you have to use root and save it certain /data folder. You can change the permission to be undeleteable, but of course root enabled file manager still can delete it.

Better use the same plausible deniability as above. If the folder size is small, you can simply create a copy in zip format in some other folder. You can hide it somewhere in /sdcard/android/data/anypackagenamefolder. Then every changes, you will update the zip too. (using other flow). If the user delete this folder, the file really deleted. But after they exit from MiXplorer, use another flow to unzip back the content and recreate the folder at the same place.

But if it is big, you can use an invisible widget with click enabled to cover the toolbar, preventing them from tapping the delete toolbar.

Still can be bypassed
All of this can be bypassed by many method. Shortcut can be bypassed using different shortcut activities maker. The deletion can be bypassed by installing other file manager (unless you protect the package installer too). They can still plug into PC and use adb to delete the file. That's why the best protection doesn't exist, as it depends on the potential perpetrator.
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