|
@@ -16,19 +16,11 @@ def execute(game, sdk, config):
|
|
|
createJmhyProperties(game, sdk, subChannel, config)
|
|
|
createProperties(game, sdk, subChannel, config)
|
|
|
|
|
|
- orientation = getScreenOrientation(game, sdk, subChannel, config)
|
|
|
- if orientation is None:
|
|
|
- orientation = 'landscape'
|
|
|
- config['screenOrientation'] = orientation
|
|
|
-
|
|
|
- changePlaceholders(game, sdk, subChannel, config)
|
|
|
|
|
|
if config['addLauncher']:
|
|
|
ret = addLauncher(game, sdk, subChannel, config)
|
|
|
if ret:
|
|
|
return ret
|
|
|
-
|
|
|
- return copyWechatCode(game, sdk, subChannel, config)
|
|
|
|
|
|
def checkConfig(config):
|
|
|
'''
|
|
@@ -38,10 +30,6 @@ def checkConfig(config):
|
|
|
print('properties not exists in config')
|
|
|
return False
|
|
|
|
|
|
- if 'ysdk' not in config:
|
|
|
- print('ysdk not exists in config')
|
|
|
- return False
|
|
|
-
|
|
|
properties = config['properties']
|
|
|
|
|
|
if 'agent' not in properties or 'version' not in properties:
|
|
@@ -68,46 +56,6 @@ def createJmhyProperties(game, sdk, subChannel, config):
|
|
|
file_utils.createFile(properties, content)
|
|
|
return 0
|
|
|
|
|
|
-def createProperties(game, sdk, subChannel, config):
|
|
|
- '''
|
|
|
- 创建ysdkconf.ini
|
|
|
- '''
|
|
|
- print('create ysdkconf.ini')
|
|
|
- ysdkConfig = config['ysdk']
|
|
|
- decompliePath = file_utils.getDecompliePath(game, sdk, subChannel, config['cache'])
|
|
|
- properties = os.path.join(decompliePath, 'assets', 'ysdkconf.ini')
|
|
|
- content = ''
|
|
|
- for key in ysdkConfig:
|
|
|
- content = '%s%s=%s\n' % (content, key, ysdkConfig[key])
|
|
|
- file_utils.createFile(properties, content)
|
|
|
- return 0
|
|
|
-
|
|
|
-def copyWechatCode(game, sdk, subChannel, config):
|
|
|
- '''
|
|
|
- 拷贝微信sdk的代码
|
|
|
- '''
|
|
|
- print('copy WXEntryActivity.smali')
|
|
|
- sdkPath = file_utils.getFullSDKPath(sdk)
|
|
|
-
|
|
|
- WXEntryActivity = 'WXEntryActivity.smali'
|
|
|
-
|
|
|
- wxFile = os.path.join(sdkPath, 'smali', WXEntryActivity)
|
|
|
- decompliePath = file_utils.getDecompliePath(game, sdk, subChannel, config['cache'])
|
|
|
- smaliPath = os.path.join(decompliePath, 'smali')
|
|
|
- targetPath = file_utils.getPackagePath(smaliPath, config['packageName'])
|
|
|
- targetFile = os.path.join(targetPath, 'wxapi', WXEntryActivity)
|
|
|
- ret = file_utils.copyFile(wxFile, targetFile)
|
|
|
- if ret:
|
|
|
- return ret
|
|
|
-
|
|
|
- file_utils.replaceContent(targetFile, '${packageName}', config['packageName'].replace('.', '/'))
|
|
|
-
|
|
|
- manifest = os.path.join(decompliePath, 'AndroidManifest.xml')
|
|
|
- changeLauncherLaunchMode(manifest)
|
|
|
- xml_utils.changeLauncherAttr(manifest, 'configChanges', 'orientation|screenSize|keyboardHidden')
|
|
|
-
|
|
|
- return 0
|
|
|
-
|
|
|
def addLauncher(game, sdk, subChannel, config):
|
|
|
'''
|
|
|
添加启动图
|