[DEV] update android debug value

This commit is contained in:
Edouard DUPIN 2014-01-03 21:07:19 +01:00
parent 0e08561a5d
commit 35230a0e95

View File

@ -237,83 +237,87 @@ class Target(lutinTarget.Target):
else:
debug.print_element("pkg", "AndroidManifest.xml", "<==", "package configurations")
tmpFile = open(self.get_staging_folder(pkgName) + "/AndroidManifest.xml", 'w')
tmpFile.write( "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n")
tmpFile.write( "<!-- Manifest is autoGenerated with Ewol ... do not patch it-->\n")
tmpFile.write( "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\" \n")
tmpFile.write( " package=\"" + compleatePackageName + "\" \n")
tmpFile.write( " android:versionCode=\"1\" \n")
tmpFile.write( " android:versionName=\""+pkgProperties["VERSION"]+"\"> \n")
tmpFile.write( " <uses-feature android:glEsVersion=\"0x00020000\" android:required=\"true\" />\n")
tmpFile.write( " <uses-sdk android:minSdkVersion=\"" + str(self.boardId) + "\" /> \n")
tmpFile.write( '<?xml version="1.0" encoding="utf-8"?>\n')
tmpFile.write( '<!-- Manifest is autoGenerated with Ewol ... do not patch it-->\n')
tmpFile.write( '<manifest xmlns:android="http://schemas.android.com/apk/res/android" \n')
tmpFile.write( ' package="' + compleatePackageName + '" \n')
tmpFile.write( ' android:versionCode="1" \n')
tmpFile.write( ' android:versionName="'+pkgProperties["VERSION"]+'"> \n')
tmpFile.write( ' <uses-feature android:glEsVersion="0x00020000" android:required="true" />\n')
tmpFile.write( ' <uses-sdk android:minSdkVersion="' + str(self.boardId) + '" ')
tmpFile.write( ' android:targetSdkVersion="' + str(self.boardId) + '" /> \n')
if pkgProperties["ANDROID_APPL_TYPE"]=="APPL":
tmpFile.write( " <application android:label=\"" + pkgName + "\" \n")
tmpFile.write( " android:icon=\"@drawable/icon\">\n")
tmpFile.write( " <activity android:name=\"." + pkgName + "\" \n")
tmpFile.write( " android:label=\"" + pkgProperties["NAME"])
tmpFile.write( ' <application android:label="' + pkgName + '" \n')
tmpFile.write( ' android:icon="@drawable/icon" \n')
if "debug"==self.buildMode:
tmpFile.write( ' android:debuggable="true" \n')
tmpFile.write( ' >\n')
tmpFile.write( ' <activity android:name=".' + pkgName + '" \n')
tmpFile.write( ' android:label="' + pkgProperties['NAME'])
if "debug"==self.buildMode:
tmpFile.write("-debug")
tmpFile.write( "\"\n")
tmpFile.write( " android:icon=\"@drawable/icon\" \n")
tmpFile.write( " android:hardwareAccelerated=\"true\" \n")
tmpFile.write( " android:configChanges=\"keyboard|keyboardHidden|orientation|screenSize\"> \n")
tmpFile.write( " <intent-filter> \n")
tmpFile.write( " <action android:name=\"android.intent.action.MAIN\" /> \n")
tmpFile.write( " <category android:name=\"android.intent.category.LAUNCHER\" /> \n")
tmpFile.write( " </intent-filter> \n")
tmpFile.write( " </activity> \n")
tmpFile.write( " </application> \n")
tmpFile.write( '"\n')
tmpFile.write( ' android:icon="@drawable/icon" \n')
tmpFile.write( ' android:hardwareAccelerated="true" \n')
tmpFile.write( ' android:configChanges="keyboard|keyboardHidden|orientation|screenSize"> \n')
tmpFile.write( ' <intent-filter> \n')
tmpFile.write( ' <action android:name="android.intent.action.MAIN" /> \n')
tmpFile.write( ' <category android:name="android.intent.category.LAUNCHER" /> \n')
tmpFile.write( ' </intent-filter> \n')
tmpFile.write( ' </activity> \n')
tmpFile.write( ' </application> \n')
else:
tmpFile.write( " <application android:label=\"" + pkgName + "\" \n")
tmpFile.write( " android:permission=\"android.permission.BIND_WALLPAPER\" \n")
tmpFile.write( " android:icon=\"@drawable/icon\">\n")
tmpFile.write( " <service android:name=\"." + pkgName + "\" \n")
tmpFile.write( " android:label=\"" + pkgProperties["NAME"])
tmpFile.write( ' <application android:label="' + pkgName + '" \n')
tmpFile.write( ' android:permission="android.permission.BIND_WALLPAPER" \n')
tmpFile.write( ' android:icon="@drawable/icon">\n')
tmpFile.write( ' <service android:name=".' + pkgName + '" \n')
tmpFile.write( ' android:label="' + pkgProperties['NAME'])
if "debug"==self.buildMode:
tmpFile.write("-debug")
tmpFile.write( "\"\n")
tmpFile.write( " android:icon=\"@drawable/icon\">\n")
tmpFile.write( " <intent-filter>\n")
tmpFile.write( " <action android:name=\"android.service.wallpaper.WallpaperService\" />\n")
tmpFile.write( " </intent-filter>\n")
tmpFile.write( " <meta-data android:name=\"android.service.wallpaper\"\n")
tmpFile.write( " android:resource=\"@xml/" + pkgName + "_resource\" />\n")
tmpFile.write( " </service>\n")
tmpFile.write( '"\n')
tmpFile.write( ' android:icon="@drawable/icon">\n')
tmpFile.write( ' <intent-filter>\n')
tmpFile.write( ' <action android:name="android.service.wallpaper.WallpaperService" />\n')
tmpFile.write( ' </intent-filter>\n')
tmpFile.write( ' <meta-data android:name="android.service.wallpaper"\n')
tmpFile.write( ' android:resource="@xml/' + pkgName + '_resource" />\n')
tmpFile.write( ' </service>\n')
if len(pkgProperties["ANDROID_WALLPAPER_PROPERTIES"])!=0:
tmpFile.write( " <activity android:label=\"Setting\"\n")
tmpFile.write( " android:name=\"." + pkgName + "Settings\"\n")
tmpFile.write( " android:theme=\"@android:style/Theme.Light.WallpaperSettings\"\n")
tmpFile.write( " android:exported=\"true\"\n")
tmpFile.write( " android:icon=\"@drawable/icon\">\n")
tmpFile.write( " </activity>\n")
tmpFile.write( " </application>\n")
tmpFile.write( ' <activity android:label="Setting"\n')
tmpFile.write( ' android:name=".' + pkgName + 'Settings"\n')
tmpFile.write( ' android:theme="@android:style/Theme.Light.WallpaperSettings"\n')
tmpFile.write( ' android:exported="true"\n')
tmpFile.write( ' android:icon="@drawable/icon">\n')
tmpFile.write( ' </activity>\n')
tmpFile.write( ' </application>\n')
# write package autorisations :
if True==self.check_right_package(pkgProperties, "WRITE_EXTERNAL_STORAGE"):
tmpFile.write( " <uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" /> \n")
tmpFile.write( ' <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> \n')
if True==self.check_right_package(pkgProperties, "CAMERA"):
tmpFile.write( " <uses-permission android:name=\"android.permission.CAMERA\" /> \n")
tmpFile.write( ' <uses-permission android:name="android.permission.CAMERA" /> \n')
if True==self.check_right_package(pkgProperties, "INTERNET"):
tmpFile.write( " <uses-permission android:name=\"android.permission.INTERNET\" /> \n")
tmpFile.write( ' <uses-permission android:name="android.permission.INTERNET" /> \n')
if True==self.check_right_package(pkgProperties, "MODIFY_AUDIO_SETTINGS"):
tmpFile.write( " <uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\" /> \n")
tmpFile.write( ' <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> \n')
if True==self.check_right_package(pkgProperties, "READ_CALENDAR"):
tmpFile.write( " <uses-permission android:name=\"android.permission.READ_CALENDAR\" /> \n")
tmpFile.write( ' <uses-permission android:name="android.permission.READ_CALENDAR" /> \n')
if True==self.check_right_package(pkgProperties, "READ_CONTACTS"):
tmpFile.write( " <uses-permission android:name=\"android.permission.READ_CONTACTS\" /> \n")
tmpFile.write( ' <uses-permission android:name="android.permission.READ_CONTACTS" /> \n')
if True==self.check_right_package(pkgProperties, "READ_FRAME_BUFFER"):
tmpFile.write( " <uses-permission android:name=\"android.permission.READ_FRAME_BUFFER\" /> \n")
tmpFile.write( ' <uses-permission android:name="android.permission.READ_FRAME_BUFFER" /> \n')
if True==self.check_right_package(pkgProperties, "READ_PROFILE"):
tmpFile.write( " <uses-permission android:name=\"android.permission.READ_PROFILE\" /> \n")
tmpFile.write( ' <uses-permission android:name="android.permission.READ_PROFILE" /> \n')
if True==self.check_right_package(pkgProperties, "RECORD_AUDIO"):
tmpFile.write( " <uses-permission android:name=\"android.permission.RECORD_AUDIO\" /> \n")
tmpFile.write( ' <uses-permission android:name="android.permission.RECORD_AUDIO" /> \n')
if True==self.check_right_package(pkgProperties, "SET_ORIENTATION"):
tmpFile.write( " <uses-permission android:name=\"android.permission.SET_ORIENTATION\" /> \n")
tmpFile.write( ' <uses-permission android:name="android.permission.SET_ORIENTATION" /> \n')
if True==self.check_right_package(pkgProperties, "VIBRATE"):
tmpFile.write( " <uses-permission android:name=\"android.permission.VIBRATE\" /> \n")
tmpFile.write( ' <uses-permission android:name="android.permission.VIBRATE" /> \n')
if True==self.check_right_package(pkgProperties, "ACCESS_COARSE_LOCATION"):
tmpFile.write( " <uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\" /> \n")
tmpFile.write( ' <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> \n')
if True==self.check_right_package(pkgProperties, "ACCESS_FINE_LOCATION"):
tmpFile.write( " <uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" /> \n")
tmpFile.write( "</manifest>\n\n")
tmpFile.write( ' <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> \n')
tmpFile.write( '</manifest>\n\n')
tmpFile.flush()
tmpFile.close()
# end generating android manifest