作者 pandada8987
... ... @@ -17,8 +17,17 @@
android:exported="false"
android:grantUriPermissions="true">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/filepaths"></meta-data>
STSSAgg_Quick.jar
android:resource="@xml/filepaths"></meta-data>
</provider>
<meta-data
android:name="STSS_CHANNEL_APPLICATION_CLASS"
android:value="com.quicksdk.QuickSdkApplication" />
<activity android:name="com.stss.sdk.SplashActivity"
android:exported="true"
android:launchMode="standard"
android:screenOrientation="landscape">
</activity>
</applicationConfig>
</manifest>
\ No newline at end of file
... ...
... ... @@ -20,7 +20,15 @@ import sys
androidNS = 'http://schemas.android.com/apk/res/android'
def execute(channel, decompileDir, packageName):
modify_manifest(channel, decompileDir, packageName)
manifest_path = decompileDir + '/AndroidManifest.xml'
find_launch_activity(manifest_path)
return 0
def modify_manifest(channel, decompileDir, packageName):
sdkDir = decompileDir + '/../sdk/' + channel['sdk']
if not os.path.exists(sdkDir):
file_utils.printF("The sdk temp folder is not exists. path:"+sdkDir)
... ... @@ -60,4 +68,47 @@ def execute(channel, decompileDir, packageName):
manifest_new_file.write(manifestContent)
manifest_new_file.close()
return 0
\ No newline at end of file
return 0
def find_launch_activity(manifest_path):
ET.register_namespace("android", androidNS)
tree = ET.parse(manifest_path)
root = tree.getroot()
for activity in root.findall('.//activity'):
intent_filter = activity.find('.//intent-filter')
if intent_filter is not None:
action = intent_filter.find('.//action')
if action is not None and action.get('{' + androidNS + '}name') == 'android.intent.action.MAIN':
origin_activity_name = activity.get('{' + androidNS + '}name')
print(origin_activity_name)
activity.remove(intent_filter)
tree.write(manifest_path)
manifest_add(manifest_path, tree, root, origin_activity_name)
break
def manifest_add(manifest_path, tree, root, origin_activity_name):
namespace2 = {'android': 'http://schemas.android.com/apk/res/android'}
target_activity = root.find(".//activity[@android:name='com.stss.sdk.SplashActivity']",
namespace2)
if target_activity is None:
return "SplashActivity不存在"
intent_filter = target_activity.find('intent-filter')
if intent_filter is None:
intent_filter = ET.SubElement(target_activity, 'intent-filter')
action_element = ET.SubElement(intent_filter, 'action')
action_element.set('{' + androidNS + '}name', 'android.intent.action.MAIN')
category_element = ET.SubElement(intent_filter, 'category')
category_element.set('{' + androidNS + '}name', 'android.intent.category.LAUNCHER')
meta_data = ET.SubElement(target_activity, 'meta-data')
meta_data.set('android:name', "GAME_ACTIVITY")
meta_data.set('android:value', origin_activity_name)
tree.write(manifest_path)
\ No newline at end of file
... ...
... ... @@ -91,12 +91,12 @@
android:configChanges="orientation|keyboardHidden|navigation"
android:exported="false"
android:screenOrientation="behind"
android:windowSoftInputMode="adjustResize|stateHidden" ></activity>
android:windowSoftInputMode="adjustResize|stateHidden" />
<activity
android:name="com.alipay.sdk.auth.AuthActivity"
android:configChanges="orientation|keyboardHidden|navigation"
android:exported="false"
android:screenOrientation="behind" ></activity>
android:screenOrientation="behind" />
<activity
android:name="com.game.sdk.module.pay.AlipayActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
... ... @@ -122,5 +122,11 @@
<meta-data
android:name="PAY_MINI_APP_ID"
android:value="wxa838c75b6f024f0a"/>
<meta-data
android:name="STSS_CHANNEL_APPLICATION_CLASS"
android:value="com.game.sdk.base.QwApplication" />
</applicationConfig>
</manifest>
\ No newline at end of file
... ...