disable android auto backup

This commit is contained in:
Gabriel Bazán 2016-08-08 12:20:01 -03:00
parent b432ce0fc1
commit 5607fee192
3 changed files with 28 additions and 2 deletions

View File

@ -209,6 +209,12 @@ if [ $CURRENT_OS == "ANDROID" ]; then
cp android/project.properties $PROJECT/platforms/android/project.properties
checkOK
mkdir -p $PROJECT/scripts
checkOK
cp scripts/* $PROJECT/scripts
checkOK
cp -R android/res/* $PROJECT/platforms/android/res
checkOK
fi

View File

@ -19,7 +19,7 @@
<preference name="SplashScreen" value="copayscreen" />
<preference name="ShowSplashScreenSpinner" value="false" />
<preference name="AutoHideSplashScreen" value="false" />
<preference name="FadeSplashScreen" value="true" />
<preference name="FadeSplashScreen" value="true" />
<preference name="FadeSplashScreenDuration" value="1" />
<preference name="BackgroundColor" value="#2C3E50" />
<preference name="StatusBarOverlaysWebView" value="false" />
@ -29,7 +29,9 @@
<preference name="windows-target-version" value="8.1"/>
<preference name="Orientation" value="default" />
<platform name="android">
<hook type="after_run" src="scripts/afterRun.js" />
</platform>
<platform name="ios">
<!-- iOS 8.0+ -->

18
cordova/scripts/afterRun.js vendored Normal file
View File

@ -0,0 +1,18 @@
module.exports = function(ctx) {
var fs = ctx.requireCordovaModule('fs'),
path = ctx.requireCordovaModule('path'),
xml = ctx.requireCordovaModule('cordova-common').xmlHelpers;
var manifestPath = path.join(ctx.opts.projectRoot, '/platforms/android/AndroidManifest.xml');
var doc = xml.parseElementtreeSync(manifestPath);
if (doc.getroot().tag !== 'manifest') {
throw new Error(manifestPath + ' has incorrect root node name (expected "manifest")');
}
doc.getroot().find('./application').attrib['android:allowBackup'] = "false";
//write the manifest file
fs.writeFileSync(manifestPath, doc.write({
indent: 4
}), 'utf-8');
};