|
@@ -0,0 +1,18 @@
|
|
1
|
+var fs = reuqire('fs');
|
|
2
|
+var MANIFEST_PATH = process.cwd() + '/android/app/src/main/AndroidManifest.xml';
|
|
3
|
+
|
|
4
|
+fs.readFile(MANIFEST_PATH, function(err, data) {
|
|
5
|
+
|
|
6
|
+ if(err)
|
|
7
|
+ console.log('failed to locate AndroidManifest.xml file, you may have to add file access permission manually.');
|
|
8
|
+ else {
|
|
9
|
+
|
|
10
|
+ data = String(data).replace(
|
|
11
|
+ '<uses-permission android:name="android.permission.INTERNET" />',
|
|
12
|
+ '<uses-permission android:name="android.permission.INTERNET" />\n <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> '
|
|
13
|
+ )
|
|
14
|
+ fs.writeFileSync(MANIFEST_PATH, data);
|
|
15
|
+
|
|
16
|
+ }
|
|
17
|
+
|
|
18
|
+})
|