python3Packages.androguard: fix 4.1.2

This commit is contained in:
linsui
2025-02-08 13:16:00 +08:00
parent 3ef0b7d549
commit fb051bd15a
3 changed files with 19 additions and 51 deletions
@@ -2,19 +2,25 @@
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
future,
poetry-core,
apkinspector,
networkx,
pygments,
lxml,
colorama,
cryptography,
dataset,
frida-python,
loguru,
matplotlib,
asn1crypto,
click,
mutf8,
pyyaml,
pydot,
ipython,
oscrypto,
pyqt5,
pyperclip,
pytestCheckHook,
python-magic,
qt5,
@@ -39,38 +45,40 @@ buildPythonPackage rec {
sha256 = "sha256-rBoYqhkjDcLhv1VVlIt5Uj05MyBk+QbLD1aCjQkrmqw=";
};
patches = [
./drop-removed-networkx-formats.patch
./fix-tests.patch
build-system = [
poetry-core
];
build-system = [ setuptools ];
nativeBuildInputs = lib.optionals withGui [ qt5.wrapQtAppsHook ];
dependencies =
[
apkinspector
asn1crypto
click
colorama
future
cryptography
dataset
frida-python
ipython
loguru
lxml
matplotlib
mutf8
networkx
oscrypto
pydot
pygments
pyyaml
]
++ networkx.optional-dependencies.default
++ networkx.optional-dependencies.extra
++ lib.optionals withGui [
pyqt5
pyperclip
];
nativeCheckInputs = [
pytestCheckHook
pyperclip
pyqt5
python-magic
];
@@ -1,14 +0,0 @@
diff --git a/androguard/cli/main.py b/androguard/cli/main.py
index 13bc1d0ab7..a79b4fe5fa 100644
--- a/androguard/cli/main.py
+++ b/androguard/cli/main.py
@@ -110,9 +110,7 @@
write_methods = dict(gml=_write_gml,
gexf=nx.write_gexf,
- gpickle=nx.write_gpickle,
graphml=nx.write_graphml,
- yaml=nx.write_yaml,
net=nx.write_pajek,
)
@@ -1,26 +0,0 @@
diff --git a/tests/dataflow_test.py b/tests/dataflow_test.py
index e9ac3cdb..edef8200 100644
--- a/tests/dataflow_test.py
+++ b/tests/dataflow_test.py
@@ -5,7 +5,7 @@ import sys
sys.path.append('.')
import collections
-import mock
+from unittest import mock
import unittest
from androguard.decompiler.dad import dataflow
from androguard.decompiler.dad import graph
diff --git a/tests/test_types.py b/tests/test_types.py
index 127dfc20..f1c89f07 100644
--- a/tests/test_types.py
+++ b/tests/test_types.py
@@ -182,7 +182,7 @@ class TypesTest(unittest.TestCase):
for i in filter(lambda x: 'const' in x.get_name(), method.get_instructions()):
i.show(0)
# ins should only have one literal
- self.assertEquals(len(i.get_literals()), 1)
+ self.assertEqual(len(i.get_literals()), 1)
fmt, value = VALUES[method.full_name].pop(0)
converted = format_value(i.get_literals()[0], i, fmt)