最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Android和iOS包批量重簽名

 更新時間:2020年10月20日 13:27:38   作者:林新發(fā)  
這篇文章主要為大家詳細(xì)介紹了Android和iOS包批量重簽名,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下

本文實例為大家分享了Android和iOS包批量重簽名的具體代碼,供大家參考,具體內(nèi)容如下

Android篇

環(huán)境要求

1 安裝winrar,然后配置winrar的環(huán)境變量,要用到winrar指令

2 配置java的bin目錄到環(huán)境變量,要用到j(luò)arsigner指令

重簽名步驟說明:

1 從母包復(fù)制一個子包

2 刪除子包的簽名文件META-INFO

3 根據(jù)需要修改子包的文件,比如渠道號文件之類

4 重簽名子包 

對應(yīng)的python腳本

import os
import sys
import shutil
import json
 
ORIGINAL_APK='母包.apk'
UNSIGN_APK='unsign.apk'
SIGNED_APK={"\"子包1.apk\"":1,"\"子包2.apk\"":2,"\"子包3.apk\"":3,"\"子包4.apk\"":4}
 
KEY_STORE='keystore文件.keystore'
KEY_PASS='key密碼'
STORE_PASS='store密碼'
 
def copy_apk(src_f,dst_f):
 if not os.path.isfile(src_f):
 print("%s not exist"%(src_f))
 else:
 fpath,fname=os.path.split(dst_f)
 shutil.copyfile(src_f,dst_f)
 print("copy %s -> %s"%(src_f,dst_f))
 
 
def zip_del_file(apk_f,del_f):
 os.system("winrar d %s %s"%(apk_f,del_f))
 print('zip_del_file:'+del_f)
 
def zip_add_file(apk_f,channel):
 del_dir("assets")
 os.makedirs("assets")
 f=open("assets\\AppParamSetting.txt",'w')
 f.write('{"channel":%s,"bundleIdentifier":""}'%(channel))
 f.close()
 os.system("winrar a -ad %s %s"%(apk_f,"assets\\AppParamSetting.txt"))
 
def del_file(f):
 os.remove(f)
 print('del_file:'+f)
 
def del_dir(f_dir):
 if os.path.exists(f_dir):
 shutil.rmtree(f_dir)
 print("del_dir:"+f_dir)
 
def sign_app(unsigned_app, signed_app):
 signcmd='jarsigner -verbose -keystore %s -keypass %s -storepass %s -signedjar %s -digestalg SHA1 -sigalg MD5withRSA %s sfish' % (KEY_STORE,KEY_PASS,STORE_PASS,signed_app,unsigned_app)
 os.system(signcmd)
 print(signcmd)
 
if __name__ == '__main__':
 cur_dir=os.getcwd()
 print('cur_dir'+cur_dir)
 copy_apk(ORIGINAL_APK,"tmp_"+ORIGINAL_APK)
 zip_del_file("tmp_"+ORIGINAL_APK,"META-INF")
 for key in SIGNED_APK.keys():
 channel=SIGNED_APK[key]
 zip_add_file("tmp_"+ORIGINAL_APK,channel)
 sign_app("tmp_"+ORIGINAL_APK,key)
 del_dir("assets")
 del_file("tmp_"+ORIGINAL_APK)
 input("Done")

iOS篇

環(huán)境要求:

1 mac機(jī)子

2 證書文件,打開:Launchapd(火箭圖標(biāo))->其他 -> 鑰匙串訪問,就在那里

3 .mobileprovision文件

重簽名步驟說明:

1 從.mobileprovision文件生成entitlements.plist文件

2 解壓ipa,會得到一個Payload目錄,再往里是一個xxx.app,顯示包內(nèi)容可以看到里面的東西

3 刪除簽名文件,即:Payload/xxx.app/_CodeSignature目錄

4 根據(jù)需要修改文件,比如渠道文件

5 重簽名

6 壓縮ipa

對應(yīng)的python腳本

#!/usr/bin/python
 
import os
import sys
import json
 
ORIGINAL_IPA='母包.ipa'
SIGNED_APK={"\"子包1.ipa\"":1,"\"子包2.ipa\"":2,"\"子包3.ipa\"":3,"\"子包4.ipa\"":4}
CERT_FILE='證書文件'
MOBILE_PROVISION_UUID = 'mobileprovision的uuid'
 
def get_mobile_provision_dir():
 return os.path.join(os.getenv('HOME'),'Library/MobileDevice/Provisioning Profiles/')
 
def get_mobile_provision_file(uuid):
 return os.path.join(get_mobile_provision_dir(), uuid + ".mobileprovision")
 
def unzip_app():
 os.system('unzip -qo ./%s -d ./'%(ORIGINAL_IPA))
 print('unzip_app %s done!'%(ORIGINAL_IPA)) 
 
def del_code_signature():
 os.system("rm -rf ./Payload/sfish.app/_CodeSignature")
 print('del_code_signature done!')
 
def resign_app():
 os.system('/usr/bin/codesign --continue -f -s "%s" --entitlements "%s" "%s"'%(CERT_FILE,'./entitlement.plist','./Payload/sfish.app'))
 print('resign_app done!')
 
def zip_app(f_ipa):
 os.system('zip -r %s ./Payload'%(f_ipa))
 print('zip_app done!')
 
def del_payload():
 os.system('rm -r ./Payload')
 
def gen_entitlements(uuid, out_file_name):
 os.system('security cms -D -i "%s" > entitlement_full.plist '%(get_mobile_provision_file(uuid) ))
 os.system('/usr/libexec/PlistBuddy -x -c \'Print:Entitlements\' entitlement_full.plist > "%s" '%( out_file_name))
 
def rep_emb_file(uuid):
 os.system('cp "%s" ./Payload/sfish/embedded.mobileprovision' % (get_mobile_provision_file(uuid)))
 
def update_channel_file(channel):
 f_channel='./Payload/xxx.app/Data/Raw/channel.txt'
 fr=open(f_channel,'r')
 txt=fr.read()
 fr.close()
 js=json.loads(txt)
 js['channel_id']=channel
 fw=open(f_channel,'w')
 fw.write(json.dumps(js))
 fw.close()
 
if __name__ == '__main__':
 gen_entitlements( MOBILE_PROVISION_UUID, "entitlement.plist" )
 unzip_app()
 del_code_signature()
 for key in SIGNED_APK.keys():
 channel=SIGNED_APK[key]
 update_channel_file(channel)
 resign_app()
 zip_app(key)
 del_payload()

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • Dialog底部彈出自定義view并且伴隨動畫彈出和消失

    Dialog底部彈出自定義view并且伴隨動畫彈出和消失

    這篇文章主要介紹了Dialog底部彈出自定義view并且伴隨動畫彈出和消失的相關(guān)資料,需要的朋友可以參考下
    2016-12-12
  • Android仿IOS10圓盤時間選擇器

    Android仿IOS10圓盤時間選擇器

    這篇文章主要為大家詳細(xì)介紹了Android仿IOS10圓盤時間選擇器,自定義圓盤時間選擇器,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2018-07-07
  • android底部菜單欄實現(xiàn)原理與代碼

    android底部菜單欄實現(xiàn)原理與代碼

    底部菜單欄很重要,我看了一下很多應(yīng)用軟件都是用了底部菜單欄做,我這里使用了tabhost做了一種通用的(就是可以像微信那樣顯示未讀消息數(shù)量的,雖然之前也做過但是layout下的xml寫的太臃腫,這里去掉了很多不必要的層,個人看起來還是不錯的,所以貼出來方便以后使用
    2013-01-01
  • 詳解Android中點擊事件的幾種實現(xiàn)方式

    詳解Android中點擊事件的幾種實現(xiàn)方式

    本篇文章主要介紹了Android中點擊事件的實現(xiàn)方式,點擊事件的實現(xiàn)分為3中,詳細(xì)的介紹了三種的用法,有興趣的可以了解一下。
    2016-12-12
  • 用Flutter做桌上彈球(繪圖(Canvas&CustomPaint)API)

    用Flutter做桌上彈球(繪圖(Canvas&CustomPaint)API)

    這篇文章主要介紹了用Flutter做桌上彈球 聊聊繪圖(Canvas&CustomPaint)API,本文給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下
    2020-07-07
  • Android webview手動校驗https證書(by 星空武哥)

    Android webview手動校驗https證書(by 星空武哥)

    有些時候由于Android系統(tǒng)的bug或者其他的原因,導(dǎo)致我們的webview不能驗證通過我們的https證書,最明顯的例子就是華為手機(jī)mate7升級到Android7.0后,手機(jī)有些網(wǎng)站打不開了,而更新了webview的補(bǔ)丁后就沒問題了
    2017-09-09
  • Android中自定義進(jìn)度條詳解

    Android中自定義進(jìn)度條詳解

    這篇文章主要介紹了Android中自定義進(jìn)度條詳解,本文講解了變換進(jìn)度條前背景、縱向進(jìn)度條、弧形bar等內(nèi)容,需要的朋友可以參考下
    2015-01-01
  • Android開發(fā)中MotionEvent坐標(biāo)獲取方法分析

    Android開發(fā)中MotionEvent坐標(biāo)獲取方法分析

    這篇文章主要介紹了Android開發(fā)中MotionEvent坐標(biāo)獲取方法,結(jié)合實例形式分析了MotionEvent獲取坐標(biāo)的相關(guān)函數(shù)使用方法與相關(guān)注意事項,需要的朋友可以參考下
    2016-02-02
  • Android實現(xiàn)網(wǎng)易云音樂的旋轉(zhuǎn)專輯View

    Android實現(xiàn)網(wǎng)易云音樂的旋轉(zhuǎn)專輯View

    這篇文章主要為大家詳細(xì)介紹了Android實現(xiàn)網(wǎng)易云音樂的旋轉(zhuǎn)專輯View,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2020-11-11
  • Android?Flutter異步編程指南分享

    Android?Flutter異步編程指南分享

    在?App?開發(fā)中,經(jīng)常會遇到處理異步任務(wù)的場景,如網(wǎng)絡(luò)請求、讀寫文件等。本文主要和大家介紹一下Flutter異步編程的相關(guān)知識,希望對大家有所幫助
    2023-04-04

最新評論

故城县| 七台河市| 北碚区| 本溪市| 深泽县| 湖南省| 黄梅县| 连南| 沙坪坝区| 青田县| 桂平市| 大埔区| 太康县| 金堂县| 肇州县| 新安县| 简阳市| 平罗县| 太保市| 玉环县| 威海市| 宁陵县| 阳江市| 天峨县| 改则县| 成安县| 盘山县| 上高县| 弋阳县| 田林县| 贵港市| 内乡县| 太湖县| 绍兴市| 永康市| 苏尼特左旗| 嵩明县| 迭部县| 肃南| 西安市| 临沧市|