Skip to content

Commit 248ee37

Browse files
trpynhaeter525claude
authored
Upgrade Androguard version to latest (#928)
* Upgrade Androguard version to latest * supress androguard logs messing with quark-engine output * fix: add numpy as an explicit dependency numpy was implicitly available as a transitive dependency through androguard 3.x pulling in matplotlib. androguard 4.x removed matplotlib, so numpy must be declared explicitly. Also updates string count assertions in forensic and script tests to match androguard 4.x output. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: haeter525 <cindejze412@gmail.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 0a7c264 commit 248ee37

5 files changed

Lines changed: 13 additions & 8 deletions

File tree

Pipfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ tqdm = "<=4.66.5"
1515
colorama = "<=0.4.4"
1616
quark-engine = {editable = true,path = "."}
1717
click = "<=8.1.7"
18-
androguard = "==3.4.0a1"
18+
androguard = "==4.1.4"
1919
graphviz = "<=0.18.2"
2020
requests = "<=2.33.0"
2121
plotly = "<=5.4.0"
@@ -28,7 +28,7 @@ r2pipe = "==1.8.0"
2828
pathvalidate = "==3.2.3"
2929

3030
[requires]
31-
python_version = "3.10"
31+
python_version = ">=3.10"
3232

3333
[pipenv]
3434
allow_prereleases = true

quark/core/apkinfo.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,20 @@
1616
from typing import Dict, List, Optional, Set, Union
1717

1818
from androguard.core.analysis.analysis import MethodAnalysis
19-
from androguard.core.bytecodes.dvm_types import Operand
19+
from androguard.core.dex.dex_types import Operand
2020
from androguard.misc import AnalyzeAPK, get_default_session
21-
from androguard.core.bytecodes.dvm import Instruction45cc, Instruction4rcc, get_kind, Kind
21+
from androguard.core.dex import Instruction45cc, Instruction4rcc, get_kind, Kind
22+
from loguru import logger as _androguard_logger
2223

2324
from quark.core.interface.baseapkinfo import BaseApkinfo
2425
from quark.core.struct.bytecodeobject import BytecodeObject
2526
from quark.core.struct.methodobject import MethodObject
2627
from quark.evaluator.pyeval import PyEval
2728

2829

30+
_androguard_logger.disable("androguard")
31+
32+
2933
class AndroguardImp(BaseApkinfo):
3034
"""Information about apk based on androguard analysis"""
3135

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77

88
required_requirements = [
99
"prettytable>=1.0.0",
10-
"androguard==3.4.0a1",
10+
"androguard==4.1.4",
11+
"numpy",
1112
"tqdm",
1213
"colorama",
1314
"graphviz",

tests/forensic/test_forensic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def forensic(scope="function"):
2222

2323
class TestForensic:
2424
def test_all_strings(self, forensic):
25-
assert len(forensic.get_all_strings()) == 1005
25+
assert len(forensic.get_all_strings()) == 4409
2626

2727
def test_get_url(self, forensic):
2828
assert len(forensic.get_url()) == 4
@@ -48,7 +48,7 @@ def test_get_file(self, forensic):
4848
assert len(forensic.get_file()) == 0
4949

5050
def test_get_base64(self, forensic):
51-
assert len(forensic.get_base64()) == 102
51+
assert len(forensic.get_base64()) == 604
5252

5353
def test_get_android_api(self, forensic):
5454
assert len(forensic.get_android_api()) == 640

tests/script/test_script.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ def testMethodGetXrefFrom(QUARK_ANALYSIS_RESULT_FOR_RULE_68):
418418

419419
@staticmethod
420420
def testGetAllStrings(QUARK_ANALYSIS_RESULT_FOR_RULE_68):
421-
assert len(QUARK_ANALYSIS_RESULT_FOR_RULE_68.getAllStrings()) == 1005
421+
assert len(QUARK_ANALYSIS_RESULT_FOR_RULE_68.getAllStrings()) == 4409
422422

423423
@staticmethod
424424
def testIsHardCoded(QUARK_ANALYSIS_RESULT_FOR_RULE_68):

0 commit comments

Comments
 (0)