def test_obfuscation_decode_apk_success( self, tmp_demo_apk_v10_original_path: str): obfuscation = Obfuscation(tmp_demo_apk_v10_original_path, ignore_libs=True, interactive=True) assert not obfuscation._decoded_apk_path obfuscation.decode_apk() assert os.path.isdir(obfuscation._decoded_apk_path)
def test_obfuscation_decode_apk_error(self, tmp_demo_apk_v10_original_path: str, monkeypatch): def mock(*args, **kwargs): raise Exception monkeypatch.setattr(Apktool, "decode", mock) obfuscation = Obfuscation(tmp_demo_apk_v10_original_path, ignore_libs=True, interactive=True) with pytest.raises(Exception): obfuscation.decode_apk()