错误: throw new UnsupportedOperationException("方法未反编译
Posted
技术标签:
【中文标题】错误: throw new UnsupportedOperationException("方法未反编译【英文标题】:Error: throw new UnsupportedOperationException("Method not decompiled 【发布时间】:2019-10-21 18:08:28 【问题描述】:我正在尝试对 apk 文件进行逆向工程。为此,我使用jadx v 0.9.0 反编译器。
问题是 jadx 没有反编译所有函数,这是我得到的:
private defpackage.dmw a(defpackage.dzy r3, defpackage.efb r4, defpackage.dve r5, java.lang.String r6, defpackage.dmx r7, android.content.Context r8)
/*
r2 = this;
if (r7 == 0) goto L_0x00cf;
r0 = r7.a();
if (r0 == 0) goto L_0x0017;
r0 = r7.b();
if (r0 == 0) goto L_0x000f;
goto L_0x0017;
r3 = new java.lang.IllegalArgumentException;
r4 = "Synchronous ResponseHandler used in AsyncHttpClient. You should create your response handler in a looper thread or use SyncHttpClient instead.";
r3.<init>(r4);
throw r3;
if (r6 == 0) goto L_0x0037;
r0 = r5;
r0 = (defpackage.duz) r0;
r0 = r0.a;
if (r0 == 0) goto L_0x0032;
r0 = "Content-Type";
r0 = r5.a(r0);
if (r0 == 0) goto L_0x0032;
r6 = a;
r0 = "AsyncHttpClient";
r1 = "Passed contentType will be ignored because HttpEntity sets content type";
r6.c(r0, r1);
goto L_0x0037;
r0 = "Content-Type";
r5.b(r0, r6);
r6 = r5.e();
r7.a(r6);
r6 = r5.k();
r7.a(r6);
r6 = new dmp;
r6.<init>(r3, r4, r5, r7);
r3 = r2.i;
r3.submit(r6);
r3 = new dmw;
r3.<init>(r6);
if (r8 == 0) goto L_0x00ce;
r4 = r2.d;
monitor-enter(r4);
r5 = r2.d; Catch: all -> 0x00cb
r5 = r5.get(r8); Catch: all -> 0x00cb
r5 = (java.util.List) r5; Catch: all -> 0x00cb
if (r5 != 0) goto L_0x0071; Catch: all -> 0x00cb
r5 = new java.util.LinkedList; Catch: all -> 0x00cb
r5.<init>(); Catch: all -> 0x00cb
r5 = java.util.Collections.synchronizedList(r5); Catch: all -> 0x00cb
r6 = r2.d; Catch: all -> 0x00cb
r6.put(r8, r5); Catch: all -> 0x00cb
monitor-exit(r4); Catch: all -> 0x00cb
r5.add(r3);
r4 = r5.iterator();
r5 = r4.hasNext();
if (r5 == 0) goto L_0x00ce;
r5 = r4.next();
r5 = (defpackage.dmw) r5;
r6 = r5.a;
r6 = r6.get();
r6 = (defpackage.dmp) r6;
r7 = 0;
r8 = 1;
if (r6 == 0) goto L_0x009a;
r6 = r6.a();
if (r6 == 0) goto L_0x0098;
goto L_0x009a;
r6 = 0;
goto L_0x009b;
r6 = 1;
if (r6 != 0) goto L_0x00bd;
r6 = r5.a;
r6 = r6.get();
r6 = (defpackage.dmp) r6;
if (r6 == 0) goto L_0x00ba;
r0 = r6.a();
if (r0 != 0) goto L_0x00b4;
r6 = r6.a;
if (r6 == 0) goto L_0x00b2;
goto L_0x00b4;
r6 = 0;
goto L_0x00b5;
r6 = 1;
if (r6 == 0) goto L_0x00b8;
goto L_0x00ba;
r6 = 0;
goto L_0x00bb;
r6 = 1;
if (r6 == 0) goto L_0x00be;
r7 = 1;
if (r7 == 0) goto L_0x00c5;
r5 = r5.a;
r5.clear();
if (r7 == 0) goto L_0x0079;
r4.remove();
goto L_0x0079;
r3 = move-exception;
monitor-exit(r4); Catch: all -> 0x00cb
throw r3;
return r3;
r3 = new java.lang.IllegalArgumentException;
r4 = "ResponseHandler must not be null";
r3.<init>(r4);
throw r3;
return;
*/
throw new UnsupportedOperationException("Method not decompiled: defpackage.dmo.a(dzy, efb, dve, java.lang.String, dmx, android.content.Context):dmw");
根据issue 建议的解决方案,我必须使用 --show-bad-code 反编译所有内容,但这对我不起作用!
关于如何完成这项工作的任何想法?
【问题讨论】:
我建议尝试不同的反编译器。 @Antimony 这是我尝试过的第三个编译器,我总是得到同样的抛出异常。希望this 能解决问题 【参考方案1】:试试这个工具Jar Explorer. 有树不同的反编译器。应该有帮助。
【讨论】:
@yosra 嘿,你能告诉我如何解决这个问题吗?非常感谢 只需下载应用程序并在那里打开您需要反编译的类。如果出现任何错误,请尝试使用 Menu->Decompilers 中的另一个反编译器 @TrungBui 抱歉耽搁了,我在这里所做的是将项目反编译成Java,因此许多函数没有被反编译,这在这种情况下是正常的,开发人员这样做是为了保护他们的项目。我发现的唯一解决方法是将项目反编译为 smali 语言,然后您可以将 smali 转换为 java,希望对您有所帮助,祝您好运:) @yosra 你是如何将 smali 转换为 java 的? @A.J.现在已经一年多了,但我记得我还没有找到直接将smali反编译成java的方法。所以我所做的是:转换 smali --> dex --> java。这是一个可能对您有所帮助的链接:forum.xda-developers.com/showthread.php?t=2430413以上是关于错误: throw new UnsupportedOperationException("方法未反编译的主要内容,如果未能解决你的问题,请参考以下文章
如何在 Jasmine 中对“throw new Error()”子句进行单元测试
node.js 错误 - throw new TypeError('first argument must be a string or Buffer');
在catch块中throw new Exception的意义(转)
throw new TypeError('“继承”的超级构造函数不能 ' +
解决错误 undefined reference to symbol '__cxa_throw_bad_array_new_length@@CXXABI_1.3.8'
java throw new NoSuchElementException build failed with arraylist