去除无用代码

This commit is contained in:
Xueyi Luo 2022-04-25 15:58:09 +08:00
parent 64ea56c597
commit 2c26e167dc
1 changed files with 0 additions and 24 deletions

View File

@ -885,34 +885,18 @@ def deb_verify(deb_path, _isinstall = False):
# verifyso_path = os.path.join("/usr/lib/",str(ret.stdout).strip(),VERIFY_SO)
# logging.info("Load verify interface:%s.",verifyso_path)
# verifyso = ctypes.CDLL(verifyso_path)
# ctx = StuStruct()
# ctx_obj = pointer(ctx)
# #环境初始化
# ret = verifyso.SOF_Initialize(ctx_obj)
# if (ret) :
# logging.info("SOF_InitializeEx error!")
# return 2
# if os.path.isfile(_deb_path):
# ret = verifyso.BJCA_dodebverify(None, bytes(_deb_path, encoding='utf8'), _isinstall)
# if (ret == 0):
# logging.info("Signature Verified Ok")
# verifyso.SOF_Finalize(ctx_obj)
# return 0
# else:
# logging.info("Signature Verified failed")
# verifyso.SOF_Finalize(ctx_obj)
# return 4
# # verifyso.SOF_Finalize(ctx)
# else:
# return 3
if not os.path.isfile("/usr/bin/kylinsigntool"):
logging.error("SOF_InitializeEx error!")
return 1
args = ["/usr/bin/kylinsigntool", "-v", _deb_path]
ret = subprocess.run(args, stdout=subprocess.PIPE,stderr=subprocess.STDOUT,text=True)
print(str(ret.stdout).strip())
if "Signature Verified failed" in str(ret.stdout).strip():
logging.info("Signature Verified failed!")
return 2
@ -923,14 +907,6 @@ def deb_verify(deb_path, _isinstall = False):
logging.error(e)
return 3
class StuStruct(Structure):
# _fields_是容纳每个结构体成员类型和值的列表可以配合自动生成fields list和value list的函数使用
# pass
# """
# 也可以直接初始化,适用于结构体数量不多的情况
_fields_ = []
# """
def PolicyKit_Authority(details = '', sender = None):
try: