Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: vcxOpenMainPool path #779

Closed
stephanhalbritter opened this issue Mar 20, 2023 · 5 comments
Closed

Android: vcxOpenMainPool path #779

stephanhalbritter opened this issue Mar 20, 2023 · 5 comments

Comments

@stephanhalbritter
Copy link

stephanhalbritter commented Mar 20, 2023

Hello,

using the Android libvcx wrapper, I ran into the following problem.

When running VcxApi.vcxOpenMainPool(poolConfig), it creates a folder $HOME/.indy_client/pool/. This is a problem on Android, as this location is world-accessible. It would also need special permissions given by the user to write there and would not be deleted when uninstalling the app.

In the walletConfig for VcxApi.vcxInitThreadpool(walletConfig) it's possible to set storage_config -> path to a path inside the app sandbox (e.g. with context.filesDir.absolutePath), skipping all the problems described above.

[Edit: to clarify, storage_config -> path does not skip the problem for vcxOpenMainPool. But without that parameter a similar problem would exist for vcxInitThreadpool]

I would be very glad if someone could give me a hint how to solve this.

@stephanhalbritter stephanhalbritter changed the title Android: vcxOpenMainPool write permissions Android: vcxOpenMainPool path Mar 20, 2023
@Patrik-Stas
Copy link
Contributor

Hi @stephanhalbritter

I am a bit confused when you refer to vcxInitThreadpool - but given the overall context, I suppose that was a typo and you meant to write openMainWallet instead of vcxInitThreadpool ?

So if I understand it right, you are suggesting that config for vcxOpenMainPool would accept optional attribute to specify the location of pool directory it creates? Sounds good to me!

@stephanhalbritter
Copy link
Author

Hi Patrik,

thanks for your answer! I used vcxInitThreadpool as an example for a method where it is already possible to specify the location of generated files. Otherwise vcxInitThreadpool would have the same problem as vcxOpenMainPool. Sorry for the confusion.

So yes, you understood it right. A config for vcxOpenMainPool to specify the location of the pool directory would be great. The current state really is a total blocker for us. In the end it would be nice to have such option for every method that is writing stuff to some directory/file to not have the same problem again.

Do you have plans to fix it?

@Patrik-Stas
Copy link
Contributor

Hi Stephan, I believe you are bit mistaken here as you hold onto vcxInitThreadpool as example but that function does not create any files, nor it accepts path in its config argument.

Nevertheless I think we are on the same page. We have currently other higher priority areas we focus on, but this would be great first contribution. I believe it shouldn't be challenging to implement either. Would you guys give it a shot?

Before you start changing signatures and digging into code, I encourage you to investigate where are these files being actually created. It seem to be happening in libvdrtools/indy_utils/src/environment.rs - see methods

wallet_home_path
pool_home_path
pool_path

There's also some special handling for android - see method android_indy_client_dir_path ;-) Take a look, it seems like no extra functionality needs to be implemented to get your problem solved

@stephanhalbritter
Copy link
Author

Thank you for your help, I really appreciate it. I also found an issue on the same topic on indy-sdk: hyperledger-archives/indy-sdk#2382

@Patrik-Stas
Copy link
Contributor

Since this seems to be solved, I am closing the issue. Feel free to reopen if needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants