aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2016-05-11 16:10:03 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2016-05-11 16:10:03 +0100
commit936c12ca444e7ce80466434953515ba7b1611d73 (patch)
tree0081ce132529685e579af78ab92ff3cbb9040d54
parent4e9208b3bce2f9d3d74c31a3e569a5c56df0233f (diff)
Hook to enable app to be moved to SD card.188-sd-card
-rwxr-xr-xhooks/after_prepare/allow-sd-installation.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/hooks/after_prepare/allow-sd-installation.js b/hooks/after_prepare/allow-sd-installation.js
new file mode 100755
index 0000000..4a5af5e
--- /dev/null
+++ b/hooks/after_prepare/allow-sd-installation.js
@@ -0,0 +1,12 @@
+#!/usr/bin/env node
+
+var fs = require('fs');
+
+if (fs.existsSync('platforms/android')) {
+ var filename = 'platforms/android/AndroidManifest.xml',
+ manifest = fs.readFileSync(filename).toString();
+ if (manifest.indexOf('android:installLocation="auto"') == -1) {
+ manifest = manifest.replace(/<manifest/, '<manifest android:installLocation="auto"');
+ fs.writeFileSync(filename, manifest);
+ }
+}