From f4e0f7290fbe0b7341066a8acc557d2e2e610ac7 Mon Sep 17 00:00:00 2001 From: Kadek Juliana Parwanta Date: Fri, 4 Aug 2023 19:56:04 +0800 Subject: [PATCH 1/2] add requestLegacyExternalStorage --- plugin.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugin.xml b/plugin.xml index e6f5a2c7..666d6e09 100644 --- a/plugin.xml +++ b/plugin.xml @@ -92,6 +92,10 @@ + + + + From 355b20bce9ebe673aff34078725a612ee1b420d9 Mon Sep 17 00:00:00 2001 From: Kadek Juliana Parwanta Date: Fri, 4 Aug 2023 20:25:31 +0800 Subject: [PATCH 2/2] add before plugin install hook --- before_plugin_install.js | 35 +++++++++++++++++++++++++++++++++++ plugin.xml | 3 ++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 before_plugin_install.js diff --git a/before_plugin_install.js b/before_plugin_install.js new file mode 100644 index 00000000..d29efa58 --- /dev/null +++ b/before_plugin_install.js @@ -0,0 +1,35 @@ +var fs = require("fs"); +var path = require("path"); +var rootdir = process.env.PWD; +var valuesPath = "/platforms/android/app/src/main/res/values/"; +var themesFile = "themes.xml"; +var destFile = path.join(rootdir, valuesPath, themesFile); +var destDir = path.dirname(destFile); + +module.exports = function (context) { + console.log("*************************************"); + console.log(`before_plugin_install running`); + console.log("*************************************"); + + if (fs.existsSync(destDir)) { + if (!fs.existsSync(destFile)) { + console.log("*************************************"); + console.log(`creating new ${destFile}`); + console.log("*************************************"); + fs.writeFile( + destFile, + '\n\n\n', + function (err) { + if (err) { + console.error("writeFile error" + err); + } + console.log(`${themesFile} created!`); + } + ); + } else { + console.log(`skipping, file ${themesFile} exists`); + } + } else { + console.log("skipping, android platform not found"); + } +}; \ No newline at end of file diff --git a/plugin.xml b/plugin.xml index 666d6e09..29893121 100644 --- a/plugin.xml +++ b/plugin.xml @@ -92,6 +92,7 @@ + @@ -140,7 +141,7 @@ - +