diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-05-11 16:10:03 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-05-11 16:10:03 +0100 |
commit | 936c12ca444e7ce80466434953515ba7b1611d73 (patch) | |
tree | 0081ce132529685e579af78ab92ff3cbb9040d54 /hooks | |
parent | 4e9208b3bce2f9d3d74c31a3e569a5c56df0233f (diff) |
Hook to enable app to be moved to SD card.188-sd-card
Diffstat (limited to 'hooks')
-rwxr-xr-x | hooks/after_prepare/allow-sd-installation.js | 12 |
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); + } +} |