作者 pandada8987

更新神起

@@ -19,37 +19,7 @@ import sys @@ -19,37 +19,7 @@ import sys
19 19
20 androidNS = 'http://schemas.android.com/apk/res/android' 20 androidNS = 'http://schemas.android.com/apk/res/android'
21 21
22 -def execute(channel, decompileDir, packageName):  
23 - '''  
24 - sdkDir = decompileDir + '/../sdk/' + channel['sdk']  
25 - if not os.path.exists(sdkDir):  
26 - file_utils.printF("The sdk temp folder is not exists. path:"+sdkDir)  
27 - return 1  
28 -  
29 - manifest = decompileDir + '/AndroidManifest.xml'  
30 - ET.register_namespace('android', androidNS)  
31 -  
32 - key = '{' + androidNS + '}name'  
33 -  
34 - tree = ET.parse(manifest)  
35 - root = tree.getroot()  
36 -  
37 - permissionLst = root.findall('uses-permission')  
38 -  
39 - if permissionLst != None:  
40 - for permissionNode in permissionLst:  
41 - value = permissionNode.get(key)  
42 - if value == 'android.permission.RECORD_AUDIO':  
43 - root.remove(permissionNode)  
44 - print("AndroidManifest remove the permission of audio ,the detail is android.permission.RECORD_AUDIO")  
45 - elif value == 'android.permission.GET_ACCOUNTS':  
46 - root.remove(permissionNode)  
47 - print("AndroidManifest remove the permission of GET_ACCOUNTS ,the detail is android.permission.GET_ACCOUNTS")  
48 -  
49 - tree.write(manifest, 'UTF-8')  
50 - '''  
51 -  
52 - 22 +def execute(channel, decompileDir, packageName):
53 manifestPath = decompileDir + '/AndroidManifest.xml' 23 manifestPath = decompileDir + '/AndroidManifest.xml'
54 manifest_file = open(manifestPath, 'r+', encoding='Utf-8') 24 manifest_file = open(manifestPath, 'r+', encoding='Utf-8')
55 manifestContent = str(manifest_file.read()) 25 manifestContent = str(manifest_file.read())