|
@@ -13,15 +13,14 @@ var package = JSON.parse(fs.readFileSync(PACKAGE_JSON));
|
13
|
13
|
var APP_NAME = package.name;
|
14
|
14
|
var APPLICATION_MAIN = process.cwd() + '/android/app/src/main/java/com/' + APP_NAME.toLocaleLowerCase() + '/MainApplication.java';
|
15
|
15
|
|
16
|
|
-if(!fs.existsSync(APPLICATION_MAIN)) {
|
17
|
|
- throw 'RNFetchBlob could not found link Android automatically, MainApplication.java not found in path : ' + APPLICATION_MAIN
|
18
|
|
-}
|
19
|
|
-
|
20
|
16
|
var VERSION = checkVersion();
|
21
|
17
|
console.log('RNFetchBlob detected app version .. ' + VERSION);
|
22
|
18
|
|
23
|
19
|
if(VERSION >= 0.29) {
|
24
|
20
|
console.log('RNFetchBlob patching MainApplication.java .. ');
|
|
21
|
+ if(!fs.existsSync(APPLICATION_MAIN)) {
|
|
22
|
+ throw 'RNFetchBlob could not link Android automatically, MainApplication.java not found in path : ' + APPLICATION_MAIN
|
|
23
|
+ }
|
25
|
24
|
var main = fs.readFileSync(APPLICATION_MAIN);
|
26
|
25
|
if(String(main).match('new RNFetchBlobPackage()') !== null) {
|
27
|
26
|
console.log('skipped');
|