Browse Source

Hook to enable app to be moved to SD card.

188-sd-card
Matthew Somerville 6 years ago
parent
commit
936c12ca44
  1. 12
      hooks/after_prepare/allow-sd-installation.js

12
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);
}
}
Loading…
Cancel
Save