r/kustom•
rob64

[Help] My local wg() formulas seem to have broken after the latest update!

Help

My widgets rely on a lot of information from JSON files generated in Tasker, but after the latest update, the wg() functions are throwing errors like the following:

err: java.io.ioexception: unable to read file content://com.android.externalstorage.documents/tree/primary%3aautomation/document/primary%3a%2fstorage%2femulated%2f0%2fautomation%2fresources%2fcolors.json

The formula in question should be concatenating "file://" to a Tasker variable with the value "/storage/emulated/0/Automation/Resources/colors.json", but it seems to be trying to coerce it into a content URI now instead. Anyone else experiencing this? KWGT is my primary interface for all my Tasker stuff and I really need to get this working again.

EDIT I figured it out. Turns out that under the new restrictions, local file paths are treated as though the folder you selected for KWGT (etc) is the root; in other words, as far as a Kustom app is now concerned, the entire storage of the device is limited to the assigned folder. If you chose to have it create a 'Kustom' subfolder, take note that that is not the root, but the folder that contains it. So, in my example, since I conveniently choose my 'Automation' folder as Kustom's root...

'file:///storage/emulated/0/Automation/Resources/colors.json'

Should now be

'file:///Automation/Resources/colors.json'

Posted Jun 10, 2023, 6:32 AM UTC · edited

34
AutoModeratorMOD•

Problem? Include make & model of phone, OS version, app version.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1
akaJustRobinaka u/Tight_Company•

have you tried putting the file into kustom folder? maybe it's storage problem since new android version limits how app access file. Maybe you can try to retrieve the file through flow? I think someone mentioned it could be used to bypass the restriction.

1
rob64OP•

That's a very good point. I'll give that a try. God I hate what Android has become.

1
rob64OP•

I did end up figuring it out; see my edit.

1