@@ -319,7 +319,8 @@ def DecodeApk(self,isHD):
319
319
# mainAppInfo.SetAppPackage(Source.ANDROID,isHD,Source.TAPTAP,package)
320
320
package = mainAppInfo .GetAppPackage (Source .ANDROID ,isHD ,Source .TAPTAP )
321
321
strfile = FileUtil .GetFileString (xml )
322
- strfile = strfile .replace (head + package_decode + end ,head + package + end )
322
+ # strfile = strfile.replace(head+package_decode+end,head+package+end)
323
+ strfile = strfile .replace (package_decode ,package )
323
324
FileUtil .SaveString2File (strfile ,xml )
324
325
325
326
@@ -413,7 +414,19 @@ def RebuildApk(self,isHD):
413
414
signapk = mainResource .GetOutPutApkPath (Source .TAPTAP , isHD )
414
415
mainApkTool .RebuildApK (apkdir ,outputapk ,signapk )
415
416
FileUtil .RemoveFile (outputapk )
417
+
418
+ self .InstallApk (isHD )
416
419
420
+
421
+ def InstallApk (self ,isHD ):
422
+ apk = mainResource .GetOutPutApkPath (Source .TAPTAP , isHD )
423
+ package = mainAppInfo .GetAppPackage (Source .ANDROID ,isHD ,Source .TAPTAP )
424
+ try :
425
+ os .system ("adb uninstall " + package )
426
+ os .system ("adb install " + apk )
427
+ except Exception as e :
428
+ print ("InstallApk eror=" ,e )
429
+
417
430
# 主函数的实现
418
431
if __name__ == "__main__" :
419
432
# 入口参数:http://blog.csdn.net/intel80586/article/details/8545572
@@ -452,5 +465,8 @@ def RebuildApk(self,isHD):
452
465
if "decode" == arg2 :
453
466
p .DecodeApk (isHD )
454
467
468
+ if "install" == arg2 :
469
+ p .InstallApk (isHD )
470
+
455
471
456
472
print ("SellMyApp sucess arg=" ,arg2 )
0 commit comments