|
|
@@ -11,12 +11,25 @@ import glob
|
|
|
import distutils.dir_util
|
|
|
import gw_apk_tool
|
|
|
|
|
|
+
|
|
|
+def script_init(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
|
|
|
+ # 删除渠道的so,为保留游戏的so
|
|
|
+ list_so = ["libentryexpro.so", "libplugin_phone.so", "libuptsmaddon.so", "libuptsmaddonmi.so"]
|
|
|
+ for so in list_so:
|
|
|
+ so = os.path.join(SDK, channelSdkInfo["SDKName"], "ForLibs", "armeabi-v7a", so)
|
|
|
+ if os.path.exists(so):
|
|
|
+ os.remove(so)
|
|
|
+
|
|
|
+
|
|
|
def script_second(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
|
|
|
- handle_same_name_package(decompileDir)
|
|
|
+ handle_same_name_package(decompileDir)
|
|
|
+
|
|
|
+
|
|
|
def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
|
|
|
fix_coolyun_application_getinstance_null_bug(decompileDir)
|
|
|
# replace_application_verify_rose_bug(decompileDir)
|
|
|
|
|
|
+
|
|
|
def fix_coolyun_application_getinstance_null_bug(decompile_dir):
|
|
|
insert_str_list = [
|
|
|
'\n\t.locals 1\n\n',
|
|
|
@@ -50,20 +63,26 @@ def fix_coolyun_application_getinstance_null_bug(decompile_dir):
|
|
|
f.write(''.join(smali_str_arr))
|
|
|
break
|
|
|
|
|
|
+
|
|
|
def handle_same_name_package(decompileDir):
|
|
|
+ gf_1_path = os.path.join(decompileDir, "smali", "com", "gf.1")
|
|
|
+ if not os.path.exists(gf_1_path):
|
|
|
+ return
|
|
|
+
|
|
|
# 把同名的GF包移走
|
|
|
- new_smali_path=gw_apk_tool.create_mutil_smali(decompileDir)
|
|
|
- source=os.path.join(decompileDir,"smali","com")
|
|
|
- target=os.path.join(new_smali_path,"com")
|
|
|
- GF_path=os.path.join(source,"GF")
|
|
|
+ new_smali_path = gw_apk_tool.create_mutil_smali(decompileDir)
|
|
|
+ source = os.path.join(decompileDir, "smali", "com")
|
|
|
+ target = os.path.join(new_smali_path, "com")
|
|
|
+ GF_path = os.path.join(source, "GF")
|
|
|
if os.path.exists(GF_path):
|
|
|
- gw_apk_tool.move_package(source,target,["GF"])
|
|
|
+ gw_apk_tool.move_package(source, target, ["GF"])
|
|
|
|
|
|
- #更改gf.1成gf
|
|
|
- gf_1_path=os.path.join(decompileDir,"smali","com","gf.1")
|
|
|
- gf_path=os.path.join(decompileDir,"smali","com","gf")
|
|
|
+ # 更改gf.1成gf
|
|
|
+ # gf_1_path = os.path.join(decompileDir, "smali", "com", "gf.1")
|
|
|
+ gf_path = os.path.join(decompileDir, "smali", "com", "gf")
|
|
|
if os.path.exists(gf_1_path):
|
|
|
- os.renames(gf_1_path,gf_path)
|
|
|
+ os.renames(gf_1_path, gf_path)
|
|
|
+
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
""
|