|
@@ -506,8 +506,14 @@ def addLauncher(game, sdk, subChannel, config):
|
|
|
return 0
|
|
|
|
|
|
print('add launcher...')
|
|
|
- # 添加关联资源
|
|
|
decompliePath = file_utils.getDecompliePath(game, sdk, subChannel, config['cache'])
|
|
|
+ manifest = os.path.join(decompliePath, 'AndroidManifest.xml')
|
|
|
+ activity = xml_utils.getLauncherActivityName(manifest)
|
|
|
+ if activity == 'com.shanshen.sdk.template.LauncherActivity':
|
|
|
+ print('add launcher already exist...')
|
|
|
+ return 1
|
|
|
+
|
|
|
+ # 添加关联资源
|
|
|
internalPath = os.path.join(file_utils.getCurrentPath(), 'internal_shanshen')
|
|
|
ret = copyAppResWithType(decompliePath, internalPath, 'launcher_res')
|
|
|
if ret:
|
|
@@ -523,7 +529,6 @@ def addLauncher(game, sdk, subChannel, config):
|
|
|
|
|
|
# 修改主文件信息
|
|
|
print('change launcher config...')
|
|
|
- manifest = os.path.join(decompliePath, 'AndroidManifest.xml')
|
|
|
orientation = xml_utils.getScreenOrientation(manifest)
|
|
|
activity = xml_utils.removeLauncherActivity(manifest)
|
|
|
xml_utils.addLauncherActivity(manifest, orientation, 'com.shanshen.sdk.template.LauncherActivity')
|