mirror of
https://github.com/mvt-project/mvt.git
synced 2026-10-31 10:16:21 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6bb49fb573 |
No files matched your search
@@ -72,6 +72,7 @@ class DumpsysPackagesArtifact(AndroidArtifact):
|
|||||||
"first_install_time": "",
|
"first_install_time": "",
|
||||||
"last_update_time": "",
|
"last_update_time": "",
|
||||||
"installer": "",
|
"installer": "",
|
||||||
|
"system": False,
|
||||||
"permissions": list(),
|
"permissions": list(),
|
||||||
"requested_permissions": list(),
|
"requested_permissions": list(),
|
||||||
}
|
}
|
||||||
@@ -136,6 +137,8 @@ class DumpsysPackagesArtifact(AndroidArtifact):
|
|||||||
details["timestamp"] = line.split("=")[1].strip()
|
details["timestamp"] = line.split("=")[1].strip()
|
||||||
elif line.strip().startswith("installerPackageName="):
|
elif line.strip().startswith("installerPackageName="):
|
||||||
details["installer"] = line.split("=", 1)[1].strip()
|
details["installer"] = line.split("=", 1)[1].strip()
|
||||||
|
elif line.strip().startswith("pkgFlags="):
|
||||||
|
details["system"] = "SYSTEM" in line.split("=", 1)[1].split()
|
||||||
elif line.strip().startswith("firstInstallTime="):
|
elif line.strip().startswith("firstInstallTime="):
|
||||||
first_install_times[current_user] = line.split("=", 1)[1].strip()
|
first_install_times[current_user] = line.split("=", 1)[1].strip()
|
||||||
elif line.strip().startswith("lastUpdateTime="):
|
elif line.strip().startswith("lastUpdateTime="):
|
||||||
|
|||||||
@@ -26,6 +26,24 @@ class TestDumpsysPackagesArtifact:
|
|||||||
)
|
)
|
||||||
assert dpa.results[0]["version_name"] == "5.0.07"
|
assert dpa.results[0]["version_name"] == "5.0.07"
|
||||||
assert dpa.results[0]["first_install_time"] == "2008-12-31 16:00:00"
|
assert dpa.results[0]["first_install_time"] == "2008-12-31 16:00:00"
|
||||||
|
assert dpa.results[0]["system"] is True
|
||||||
|
|
||||||
|
def test_parsing_system_flag(self):
|
||||||
|
system_details = DumpsysPackagesArtifact.parse_dumpsys_package_for_details(
|
||||||
|
" pkgFlags=[ SYSTEM HAS_CODE ALLOW_CLEAR_USER_DATA ]"
|
||||||
|
)
|
||||||
|
third_party_details = DumpsysPackagesArtifact.parse_dumpsys_package_for_details(
|
||||||
|
" pkgFlags=[ HAS_CODE ALLOW_BACKUP ]"
|
||||||
|
)
|
||||||
|
missing_flag_details = (
|
||||||
|
DumpsysPackagesArtifact.parse_dumpsys_package_for_details(
|
||||||
|
" versionName=1.0"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
assert system_details["system"] is True
|
||||||
|
assert third_party_details["system"] is False
|
||||||
|
assert missing_flag_details["system"] is False
|
||||||
|
|
||||||
def test_ioc_check(self, indicator_file):
|
def test_ioc_check(self, indicator_file):
|
||||||
dpa = DumpsysPackagesArtifact()
|
dpa = DumpsysPackagesArtifact()
|
||||||
|
|||||||
Reference in new issue
Block a user