At the moment we can't simply wrap those with SentryFileInputStream.Factory.create(openFileInput(filename), filename), because the filename has to be made up using Context.getFilesDir() or be the absolute file path, and in this case it's just a simple name. Android doesn't allow to create an instance of FIOS with just a simple name.
In other words, we'd need to change the code to SentryFileInputStream.Factory.create(openFileInput(filename), new File(context.getFilesDir(), filename)).
There are 3 options we can go with about that:
Disable instrumentation for Context.openFileInput/Context.openFileOutput
Use reflection and retrieve the path from the delegate. This is usually an absolute path, hence, creating a new File/FIOS will work and Android won't complain.
Create a subclass of SentryFileInputStream in the sentry-android-core module that will make up the filename properly using Context. A problem is that we need to access Context.
The text was updated successfully, but these errors were encountered:
romtsn commentedDec 13, 2021
At the moment we can't simply wrap those with
SentryFileInputStream.Factory.create(openFileInput(filename), filename), because the filename has to be made up usingContext.getFilesDir()or be the absolute file path, and in this case it's just a simple name. Android doesn't allow to create an instance of FIOS with just a simple name.In other words, we'd need to change the code to
SentryFileInputStream.Factory.create(openFileInput(filename), new File(context.getFilesDir(), filename)).There are 3 options we can go with about that:
Context.openFileInput/Context.openFileOutputSentryFileInputStreamin thesentry-android-coremodule that will make up the filename properly usingContext. A problem is that we need to access Context.The text was updated successfully, but these errors were encountered: