Merge "Small script fixes." am: 0d4977e7cd am: 0b29aa1937 am: ad2ec44db5
Original change: https://android-review.googlesource.com/c/platform/development/+/1866054 Change-Id: I601284212d3cdebb7996d11407227ba27faecc56
This commit is contained in:
committed by
Automerger Merge Worker
commit
45b9975a24
@@ -261,7 +261,8 @@ class TraceConverter:
|
||||
print("Cannot find apk", apk)
|
||||
return None, None
|
||||
|
||||
cmd = subprocess.Popen(["zipinfo", "-v", apk_full_path], stdout=subprocess.PIPE)
|
||||
cmd = subprocess.Popen(["zipinfo", "-v", apk_full_path], stdout=subprocess.PIPE,
|
||||
encoding='utf8')
|
||||
# Find the first central info marker.
|
||||
for line in cmd.stdout:
|
||||
if self.zipinfo_central_directory_line.search(line):
|
||||
@@ -284,6 +285,10 @@ class TraceConverter:
|
||||
if not file_name and offset >= start and offset < end:
|
||||
file_name = cur_name
|
||||
|
||||
# Make sure the offset_list is sorted, the zip file does not guarantee
|
||||
# that the entries are in order.
|
||||
offset_list = sorted(offset_list, key=lambda entry: entry[1])
|
||||
|
||||
# Save the information from the zip.
|
||||
tmp_files = dict()
|
||||
self.apk_info[apk] = [apk_full_path, offset_list, tmp_files]
|
||||
|
||||
Reference in New Issue
Block a user