EFile : Only asks for permissions when required

Thank you :hugs:
Feel free to check it when you can.

hmmā€¦so you joined two days ago and think it is best :thinking:
Thanks anyway :slightly_smiling_face:

Great, works: Companion and APK!
You should also add this to your FileTools extension.

3 Likes

Btw, this also works with AI2 (nb184). Excellent!

2 Likes

Would it be possible to add a save block for the Canvas component?

1 Like

Yes it is possible :smiley:
Kindly wait till next update :slightly_smiling_face:

3 Likes

This extension has worked great for allowing reading and writing to the application specific directory after it was broken by the latest AI2 update. But, in my app, the
image
block points to:
/data/user/0/{app name}/files/
and not to:
/storage/emulated/0/Android/data/{app name}/files/

Using a Pixel 3 on Android 10
Same on Samsung Tab S6 on Android 10

And thatā€™s exactly how it should be.
See also here (point ā†’ 1.2.)

1 Like

Many thanks for the clarification, I was assuming ā€œGetPrivateDirā€ meant the app-specific directory. I will use the TaifunFile extension for that.

Anyone got the issue ā€œread fromā€ block doesnā€™t work for private dir? On companion itā€™s ok but on installed app component ā€œgot fileā€ component doesnā€™t work.

  1. My app checks if there are any .txt files downloaded with the help of taifun extension - file list block (file:///data/user/0/{package name}/files). App can see my files at privatedir path.
  2. Path to ā€œread fromā€ is just a textfile.txt without any /. But ā€œread fromā€ component doesnā€™t read the text.

issueblocks

For companion works, for packaged apk doesnā€™t.

issue2blocks

This block indicates my files exist.

EDIT: Reading from external storage works. Reading from internal storage doesnā€™t (on apk).

No, the EFile extension cannot save / read to / from the Private dir, neither with Companion nor with the APK.

Both yellow marked blocks save in the same dir (ā†’ ASD).

Only the File component can save / read to / from the Private dir:
/data/user/0/io.makeroid.companion/files/test2.txt
But for File component (mistakenly) WRITE_/READ_EXTERNAL permissions are required.
See also here:

The extension developer (vknow360) is aware of this because I pointed it out to him.
He told me, that he will add this method (save / read to / from Private dir) later ā€¦

1 Like

Yes, your are right! Both on companion and APK reading file from privatedir path doesnā€™t work. I had a mess trought my blocks cause of testing different approaches. Description of the extension suggests the same functionality as default file component, so I spent some hours thinking I was doing something wrong.

So thereā€™s no way to use private storage without permission. I need a ā€œsafeā€ space for my files, but I donā€™t like the idea of attacking my users with permissions when itā€™s not needed. I have to go back to my old method: download and delete those files continuously.

vknow360, we are waiting for the next version :smiley: . Great extension btw.

Iā€™m familiar with that topic. Good job for exposing that bug! And thanks for the answer!

1 Like

Yes, itā€™s the same with me.

Unfortunately, he said goodbye here.

Oops, thatā€™s bad. We have to wait for kodular ā€œmanagementā€ to make it work correctly. Writing extensions on my own will take too much time to learn, and we use kodular to spare time. ASD without permission is still a good deal.

I hope it is not a problem I am replying to an old comment. In your comment you say it is not possible to read/write from the Private dir with this extension. To which dir it is possible to use this extension?

you can read from the assets and you can read or write from/to the ASD without read or write permission
Taifun

1 Like

vknow, do u have plans to make private dir read/write works?

ChangeLog Version 4

New Blocks
image

Changes

  • LegacyMode will now specifiy where a filename without any / should be written to.Enabling it means files will be written in Application Specific Directory and disabling it means files will be written in Private Storage Directory.
  • It is no longer fully compatible with Kodular Companion.

Aix can be downloaded from Github repo:

1 Like

Bug, fileName is not filename, - is Path.
Path need fix for various android

blocks (49)

Thatā€™s intentional to keep it similar to File component as much as possible.

Can you elaborate what are issues?

all ok) :slightly_smiling_face: think way in different versions android