Example #1
0
    def checkRight(self):
        if not os.path.exists(self.apk_path):
            print u'apk 路径不存在'
            return False
        namelist=zipmgr.getZipNameList(self.apk_path)
        soList={}
        for name in namelist:
            if name.split('/')[0]=='lib':

                smallFile=name.split('/')[1]
                if(len(name.split('/'))==2):
                    strfile=""
                else:
                    strfile=name.split('/')[2]
                if smallFile in soList.keys():
                    fileList=soList[smallFile]
                    fileList.append(strfile)
                    soList[smallFile]=fileList
                else:
                    fileList=[]
                    fileList.append(strfile)
                    soList[smallFile]=fileList
        #print(soList)
        if(len(soList)!=0):
            fileTree=self.getFileTree()
            if fileTree:
                print(fileTree)
                for smallFile in soList.keys():
                    for sss in soList.keys():
                        ret=cmp(soList[smallFile],soList[sss])
                        if ret!=0:
                            print(u'该APK so文件不整齐')
                        return False
                print(u'该APK so文件整齐')
                return True
Example #2
0
 def saveLib(self):
 	if not os.path.exists(self.apk_path):
         print u'apk 路径不存在'
         return False
     namelist=zipmgr.getZipNameList(self.apk_path)
     soPath=[]
     for name in namelist:
         if name.find(".so")!=-1 and name.split('/')[0]=='lib':
     		soPath.append(name)
     if len(soPath)!=0:
         self.rootpath=os.path.split(self.apk_path)[0]
         flag=False
         for name in soPath:
         	result=zipmgr.unzip_file(self.apk_path,name,self.rootpath)
         	if result!=None:
         		flag=True
         	else:
         		continue
         if flag:
         	
         	return True
         else:
         	
         	return False
     else:
     	print u'该apk不存在so文件'
     	return False
Example #3
0
 def __init__(self,apkpath):
     self.which_game = ''
     self.zipnamelist = zipmgr.getZipNameList(apkpath)
     self.unzippath = '';
     self.apkpath = apkpath
     self.u3d_regex = re.compile('libmono.so', re.I)
     self.flash_regex = re.compile('libCore.so', re.I)
     self.neox_regex = re.compile('res.npk', re.I)
     self.coco_regex = re.compile('libcocos2d(.*).so', re.I)
     self.u3d_dllpath = 'assets/bin/Data/Managed'
Example #4
0
 def __init__(self, dic):
     self.tools_path = dic['tools_path']
     self.apk_path = dic['apk_path']
     self.type = ''
     self.name_list = zipmgr.getZipNameList(self.apk_path)
     self.rootpath = ''