Merge branch 'master' of http://git.7277.cn/JingYouAndroid/apkTool_stss
正在显示
5 个修改的文件
包含
71 行增加
和
5 行删除
| @@ -17,8 +17,17 @@ | @@ -17,8 +17,17 @@ | ||
| 17 | android:exported="false" | 17 | android:exported="false" |
| 18 | android:grantUriPermissions="true"> | 18 | android:grantUriPermissions="true"> |
| 19 | <meta-data android:name="android.support.FILE_PROVIDER_PATHS" | 19 | <meta-data android:name="android.support.FILE_PROVIDER_PATHS" |
| 20 | - android:resource="@xml/filepaths"></meta-data> | ||
| 21 | - STSSAgg_Quick.jar | 20 | + android:resource="@xml/filepaths"></meta-data> |
| 22 | </provider> | 21 | </provider> |
| 22 | + | ||
| 23 | + <meta-data | ||
| 24 | + android:name="STSS_CHANNEL_APPLICATION_CLASS" | ||
| 25 | + android:value="com.quicksdk.QuickSdkApplication" /> | ||
| 26 | + | ||
| 27 | + <activity android:name="com.stss.sdk.SplashActivity" | ||
| 28 | + android:exported="true" | ||
| 29 | + android:launchMode="standard" | ||
| 30 | + android:screenOrientation="landscape"> | ||
| 31 | + </activity> | ||
| 23 | </applicationConfig> | 32 | </applicationConfig> |
| 24 | </manifest> | 33 | </manifest> |
不能预览此文件类型
| @@ -20,7 +20,15 @@ import sys | @@ -20,7 +20,15 @@ import sys | ||
| 20 | androidNS = 'http://schemas.android.com/apk/res/android' | 20 | androidNS = 'http://schemas.android.com/apk/res/android' |
| 21 | 21 | ||
| 22 | def execute(channel, decompileDir, packageName): | 22 | def execute(channel, decompileDir, packageName): |
| 23 | + modify_manifest(channel, decompileDir, packageName) | ||
| 23 | 24 | ||
| 25 | + manifest_path = decompileDir + '/AndroidManifest.xml' | ||
| 26 | + find_launch_activity(manifest_path) | ||
| 27 | + | ||
| 28 | + return 0 | ||
| 29 | + | ||
| 30 | + | ||
| 31 | +def modify_manifest(channel, decompileDir, packageName): | ||
| 24 | sdkDir = decompileDir + '/../sdk/' + channel['sdk'] | 32 | sdkDir = decompileDir + '/../sdk/' + channel['sdk'] |
| 25 | if not os.path.exists(sdkDir): | 33 | if not os.path.exists(sdkDir): |
| 26 | file_utils.printF("The sdk temp folder is not exists. path:"+sdkDir) | 34 | file_utils.printF("The sdk temp folder is not exists. path:"+sdkDir) |
| @@ -60,4 +68,47 @@ def execute(channel, decompileDir, packageName): | @@ -60,4 +68,47 @@ def execute(channel, decompileDir, packageName): | ||
| 60 | manifest_new_file.write(manifestContent) | 68 | manifest_new_file.write(manifestContent) |
| 61 | manifest_new_file.close() | 69 | manifest_new_file.close() |
| 62 | 70 | ||
| 63 | - return 0 | ||
| 71 | + return 0 | ||
| 72 | + | ||
| 73 | + | ||
| 74 | +def find_launch_activity(manifest_path): | ||
| 75 | + ET.register_namespace("android", androidNS) | ||
| 76 | + tree = ET.parse(manifest_path) | ||
| 77 | + root = tree.getroot() | ||
| 78 | + | ||
| 79 | + for activity in root.findall('.//activity'): | ||
| 80 | + intent_filter = activity.find('.//intent-filter') | ||
| 81 | + if intent_filter is not None: | ||
| 82 | + action = intent_filter.find('.//action') | ||
| 83 | + if action is not None and action.get('{' + androidNS + '}name') == 'android.intent.action.MAIN': | ||
| 84 | + origin_activity_name = activity.get('{' + androidNS + '}name') | ||
| 85 | + print(origin_activity_name) | ||
| 86 | + activity.remove(intent_filter) | ||
| 87 | + tree.write(manifest_path) | ||
| 88 | + manifest_add(manifest_path, tree, root, origin_activity_name) | ||
| 89 | + break | ||
| 90 | + | ||
| 91 | + | ||
| 92 | +def manifest_add(manifest_path, tree, root, origin_activity_name): | ||
| 93 | + namespace2 = {'android': 'http://schemas.android.com/apk/res/android'} | ||
| 94 | + target_activity = root.find(".//activity[@android:name='com.stss.sdk.SplashActivity']", | ||
| 95 | + namespace2) | ||
| 96 | + | ||
| 97 | + if target_activity is None: | ||
| 98 | + return "SplashActivity不存在" | ||
| 99 | + | ||
| 100 | + intent_filter = target_activity.find('intent-filter') | ||
| 101 | + if intent_filter is None: | ||
| 102 | + intent_filter = ET.SubElement(target_activity, 'intent-filter') | ||
| 103 | + | ||
| 104 | + action_element = ET.SubElement(intent_filter, 'action') | ||
| 105 | + action_element.set('{' + androidNS + '}name', 'android.intent.action.MAIN') | ||
| 106 | + | ||
| 107 | + category_element = ET.SubElement(intent_filter, 'category') | ||
| 108 | + category_element.set('{' + androidNS + '}name', 'android.intent.category.LAUNCHER') | ||
| 109 | + | ||
| 110 | + meta_data = ET.SubElement(target_activity, 'meta-data') | ||
| 111 | + meta_data.set('android:name', "GAME_ACTIVITY") | ||
| 112 | + meta_data.set('android:value', origin_activity_name) | ||
| 113 | + | ||
| 114 | + tree.write(manifest_path) |
不能预览此文件类型
| @@ -91,12 +91,12 @@ | @@ -91,12 +91,12 @@ | ||
| 91 | android:configChanges="orientation|keyboardHidden|navigation" | 91 | android:configChanges="orientation|keyboardHidden|navigation" |
| 92 | android:exported="false" | 92 | android:exported="false" |
| 93 | android:screenOrientation="behind" | 93 | android:screenOrientation="behind" |
| 94 | - android:windowSoftInputMode="adjustResize|stateHidden" ></activity> | 94 | + android:windowSoftInputMode="adjustResize|stateHidden" /> |
| 95 | <activity | 95 | <activity |
| 96 | android:name="com.alipay.sdk.auth.AuthActivity" | 96 | android:name="com.alipay.sdk.auth.AuthActivity" |
| 97 | android:configChanges="orientation|keyboardHidden|navigation" | 97 | android:configChanges="orientation|keyboardHidden|navigation" |
| 98 | android:exported="false" | 98 | android:exported="false" |
| 99 | - android:screenOrientation="behind" ></activity> | 99 | + android:screenOrientation="behind" /> |
| 100 | <activity | 100 | <activity |
| 101 | android:name="com.game.sdk.module.pay.AlipayActivity" | 101 | android:name="com.game.sdk.module.pay.AlipayActivity" |
| 102 | android:configChanges="orientation|keyboardHidden|screenSize" | 102 | android:configChanges="orientation|keyboardHidden|screenSize" |
| @@ -122,5 +122,11 @@ | @@ -122,5 +122,11 @@ | ||
| 122 | <meta-data | 122 | <meta-data |
| 123 | android:name="PAY_MINI_APP_ID" | 123 | android:name="PAY_MINI_APP_ID" |
| 124 | android:value="wxa838c75b6f024f0a"/> | 124 | android:value="wxa838c75b6f024f0a"/> |
| 125 | + | ||
| 126 | + | ||
| 127 | + <meta-data | ||
| 128 | + android:name="STSS_CHANNEL_APPLICATION_CLASS" | ||
| 129 | + android:value="com.game.sdk.base.QwApplication" /> | ||
| 130 | + | ||
| 125 | </applicationConfig> | 131 | </applicationConfig> |
| 126 | </manifest> | 132 | </manifest> |
-
请 注册 或 登录 后发表评论