|
@@ -38,8 +38,7 @@ def execute(game, sdk, config):
|
|
|
meta['fusion_entryactivity'] = removeLauncherActivity
|
|
|
jsonConfig['metaData'] = meta
|
|
|
addMetaData(game, sdk, subChannel, jsonConfig, config['cache'])
|
|
|
-
|
|
|
-
|
|
|
+ addLauncherActivity(manifest, config['screenOrientation'], 'fusion.mj.communal.element.SplashScreenActivity')
|
|
|
|
|
|
return 0
|
|
|
|
|
@@ -104,4 +103,42 @@ def copySmaliCode(game, sdk, subChannel, config):
|
|
|
|
|
|
|
|
|
|
|
|
+def addLauncherActivity(manifest, screenOrientation, activity):
|
|
|
+ '''
|
|
|
+ 添加启动的activity
|
|
|
+ '''
|
|
|
+ for key in namespaces:
|
|
|
+ ET.register_namespace(key, namespaces[key])
|
|
|
+
|
|
|
+ tree = ET.parse(manifest)
|
|
|
+ root = tree.getroot()
|
|
|
+
|
|
|
+ # activity
|
|
|
+ '''<activity android:name=".LauncherActivity"
|
|
|
+ android:theme="@style/LauncherStyle">
|
|
|
+ <intent-filter>
|
|
|
+ <action android:name="android.intent.action.MAIN" />
|
|
|
+ <category android:name="android.intent.category.LAUNCHER" />
|
|
|
+ </intent-filter>
|
|
|
+ </activity>'''
|
|
|
+
|
|
|
+ activity = ET.Element('activity', {'android:name' : activity,
|
|
|
+ 'android:theme' : '@android:style/Theme.Holo.Light.NoActionBar.Fullscreen',
|
|
|
+ 'android:launchMode' : 'singleTop',
|
|
|
+ 'android:configChanges' : 'orientation|screenSize|keyboardHidden',
|
|
|
+ 'android:screenOrientation' : screenOrientation})
|
|
|
+ intent = ET.Element('intent-filter')
|
|
|
+ action = ET.Element('action', {'android:name' : 'android.intent.action.MAIN'})
|
|
|
+ category = ET.Element('category', {'android:name' : 'android.intent.category.LAUNCHER'})
|
|
|
+ intent.append(action)
|
|
|
+ intent.append(category)
|
|
|
+ activity.append(intent)
|
|
|
+
|
|
|
+
|
|
|
+ application = root.find('application')
|
|
|
+ application.insert(0, activity)
|
|
|
+
|
|
|
+ tree.write(manifest, encoding)
|
|
|
+
|
|
|
+
|
|
|
|