How to open a file located in a non-sdcard directory in Tasker? How can one open a file located in a subfolder of the rootfolder, using tasker, in LineageOS 14.1?

My attempts so far have been to:


Create a new task in tasker. 
Check if tasker has root permission with variable named "root available": %ROOT. This returns yes. Therefore, I assume Tasker has root permission. 
create the action: "open file"
This only allows the accessing the /storage/ of either the internal or external drive.
Therefore, I manually entered the path to the file located in the rootfolder I am trying to access as: /data/misc/wifi/wpa_supplicant.conf and ran the task, but it returns the error: file not found.



So I tried /data/misc/wifi/wpa_supplicant.conf and ran the task, but it returns the same error.
I tried to open the file with fdroid's app: editor, without opening a file explorer to open the file. But I am unable to pass the file location as an argument to the app editor when I create a task to do it.
The inbuilt Open File action doesn't seem to work for non-/storage file paths because it is hardcoded (I presumed from its error logs) to only load a file located under /storage/emulated/0. Even if you mention the absolute location using file://, it would still append /storage/emulated/0 to the file path and throw an error. 

Because Open File action simply sends an intent, we can do that manually ourselves. The Send Intent action is pretty good for this, except it also fails with non-/sdcard file paths. Tasker implements FileProvider (a way to securely share files with other apps). The action could work but Tasker's manifest file provisions for not exporting the file provider, which means other apps cannot make use of it. Since Tasker converts even absolute file path (with file://) into a file provider URI, there is no way out for us to load a non-/sdcard file using that action too,  except to ask Tasker's developer to fix this, or the user themselves tweaks the manifest file. 

The solution, however, is available using command-line. Use the action:

Code &rarr; Run Shell:


Command: 

am start -a android.intent.action.VIEW -d "file://FILE_PATH" -t "text/plain" -f 0x13000000 -n android/com.android.internal.app.ResolverActivity


file:// is intended as is. In your case, the file path should be file:///data/misc/wifi/wpa_supplicant.conf.

text/plain can be replaced with text/* too if you don't know your file's mime-type. 

(You can know about am here.) I don't know what that flag (0x13000000) does in particular. 
tick Use Root


Running the task would now give you the bottom sheet with all the apps which can load a file with mime-type text/plain. However, when testing  this, only QuickEdit app was able to load that file successfully, so I recommend using it unless you get this working with an another editor.