JUCE is an open-source cross-platform C++ application framework for desktop and mobile applications, including VST, VST3, AU, AUv3, LV2 and AAX audio plug-ins.
Currently JUCE TemporaryFile(const File&, const int) constructor tries to create a new file next to the referent file (in the same directory), regardless of whether your process can read the directory or not, and this triggers wider range of JUCE APIs fail, for example, File::replaceWithText():
It is because File::exists() returns false on Android, because access() to the "parent directory" of the referent temporary file fails (it is not readable by current app process for security reason).
File::replaceWithText() is used by PluginDirecroryScanner::scanNextFile() to manipulate DeadMansPedalFile, thus any attempt to build plugin host over juce_audio_plugin_client will fail there.
I'm attaching the stacktrace that I have with master, but should be almost identical to develop as far as I observed the changes in juce_core.
What is the expected behaviour?
TemporaryFile instantiated by TemporaryFile(const File&, const int) constructor should not cause any operation failures such as overwriteTargetFileWithTemporary().
Detailed steps on how to reproduce the bug
Currently JUCE
TemporaryFile(const File&, const int)
constructor tries to create a new file next to the referent file (in the same directory), regardless of whether your process can read the directory or not, and this triggers wider range of JUCE APIs fail, for example,File::replaceWithText()
:https://github.com/juce-framework/JUCE/blob/e265be5a031a3ab8552502c00926c4b8d0cdba13/modules/juce_core/files/juce_File.cpp#L788
due to
TemporaryFile::overwriteTargetFileWithTemporary()
:https://github.com/juce-framework/JUCE/blob/e265be5a031a3ab8552502c00926c4b8d0cdba13/modules/juce_core/files/juce_TemporaryFile.cpp#L99
It is because File::exists() returns
false
on Android, becauseaccess()
to the "parent directory" of the referent temporary file fails (it is not readable by current app process for security reason).File::replaceWithText()
is used byPluginDirecroryScanner::scanNextFile()
to manipulate DeadMansPedalFile, thus any attempt to build plugin host overjuce_audio_plugin_client
will fail there.I'm attaching the stacktrace that I have with
master
, but should be almost identical todevelop
as far as I observed the changes injuce_core
.What is the expected behaviour?
TemporaryFile
instantiated byTemporaryFile(const File&, const int)
constructor should not cause any operation failures such asoverwriteTargetFileWithTemporary()
.Operating systems
Android
What versions of the operating systems?
Android 34
Architectures
ARM, 64-bit
Stacktrace
Plug-in formats (if applicable)
No response
Plug-in host applications (DAWs) (if applicable)
JUCE AudioPluginHost, modified for Android https://github.com/atsushieno/aap-juce-plugin-host-cmake
Testing on the
develop
branchThe bug is present on the
develop
branchCode of Conduct