Skip to content

Commit

Permalink
add testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
ParadiseDuo committed Mar 5, 2021
1 parent fb8fa6d commit a9af728
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/Android/013.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@
class DBCheck(Base):
def scan(self):
strline = cmdString('grep -r "Landroid/content/Context;->openOrCreateDatabase" ' + self.appPath)
arr = os.popen(strline).readlines()
arrs = os.popen(strline).readlines()
results = []
for item in arr:
for item in arrs:
if '.smali:' in item:
path = item.split(':')[0]
with open(path, 'r') as f:
lines = f.readlines()
lines.reverse()
count = len(arr)
count = len(lines)
name = getFileName(path)
for i in range(0, count):
line = arr[i]
line = lines[i]
if 'Landroid/content/Context;->openOrCreateDatabase' in line:
v = line.split(',')[2]
for j in range(i, count):
ll = arr[j]
ll = lines[j]
if 'const/4' in ll and v in ll:
value = ll.strip().split(' ')[-1]
if value != '0x0':
result = name + ' : ' + str(count - i) + '\n'
result = name + ' : ' + str(count - i)
if result not in results:
results.append(result)
break
Expand Down
Binary file added test.apk
Binary file not shown.

0 comments on commit a9af728

Please sign in to comment.