Java 为什么不能从android apk反编译此方法?

Java 为什么不能从android apk反编译此方法?,java,android,decompiling,Java,Android,Decompiling,我使用dex2jar工具反编译了一个apk文件, 所有代码都可以正确反编译,但此方法 // ERROR // public void sendPacket(byte[] paramArrayOfByte) { // Byte code: // 0: new 82 android/net/LocalSocket // 3: dup // 4: invokespecial 83 android/net/LocalSocket:<i

我使用dex2jar工具反编译了一个apk文件, 所有代码都可以正确反编译,但此方法

  // ERROR //
  public void sendPacket(byte[] paramArrayOfByte)
  {
    // Byte code:
    //   0: new 82  android/net/LocalSocket
    //   3: dup
    //   4: invokespecial 83    android/net/LocalSocket:<init>  ()V
    //   7: astore_2
    //   8: aload_2
    //   9: new 85  android/net/LocalSocketAddress
    //   12: dup
    //   13: ldc 87
    //   15: getstatic 93   android/net/LocalSocketAddress$Namespace:FILESYSTEM Landroid/net/LocalSocketAddress$Namespace;
    //   18: invokespecial 96   android/net/LocalSocketAddress:<init>   (Ljava/lang/String;Landroid/net/LocalSocketAddress$Namespace;)V
    //   21: invokevirtual 100  android/net/LocalSocket:connect (Landroid/net/LocalSocketAddress;)V
    //   24: aload_2
    //   25: invokevirtual 104  android/net/LocalSocket:getOutputStream ()Ljava/io/OutputStream;
    //   28: astore 7
    //   30: aload_2
    //   31: invokevirtual 108  android/net/LocalSocket:getInputStream  ()Ljava/io/InputStream;
    //   34: astore 8
    //   36: aload 7
    //   38: aload_1
    //   39: invokevirtual 113  java/io/OutputStream:write  ([B)V
    //   42: aload 7
    //   44: invokevirtual 116  java/io/OutputStream:flush  ()V
    //   47: sipush 128
    //   50: newarray byte
    //   52: astore 9
    //   54: aload 8
    //   56: aload 9
    //   58: invokevirtual 122  java/io/InputStream:read    ([B)I
    //   61: pop
    //   62: new 124    com/qualcomm/logkit/settings/ConfigPacket
    //   65: dup
    //   66: aload 9
    //   68: invokespecial 126  com/qualcomm/logkit/settings/ConfigPacket:<init>    ([B)V
    //   71: astore 11
    //   73: aload 11
    //   75: getfield 130   com/qualcomm/logkit/settings/ConfigPacket:msg_type  B
    //   78: tableswitch    default:+26 -> 104, -127:+50->128, -126:+26->104, -125:+95->173
    //   105: iconst_4
    //   106: invokevirtual 133 java/io/OutputStream:close  ()V
    //   109: aload 8
    //   111: invokevirtual 134 java/io/InputStream:close   ()V
    //   114: aload_2
    //   115: ifnull +7 -> 122
    //   118: aload_2
    //   119: invokevirtual 135 android/net/LocalSocket:close   ()V
    //   122: aload_0
    //   123: iconst_0
    //   124: putfield 18   com/qualcomm/logkit/settings/UnixSocketSendThread:isRunning Z
    //   127: return
    //   128: aload 11
    //   130: getfield 139  com/qualcomm/logkit/settings/ConfigPacket:logConfig Lcom/qualcomm/logkit/settings/ConfigPacket$qlog_conf;
    //   133: getfield 144  com/qualcomm/logkit/settings/ConfigPacket$qlog_conf:filter_str  [B
    //   136: invokestatic 150  com/qualcomm/logkit/utils/UtilsStringOperation:byteToString ([B)Ljava/lang/String;
    //   139: invokestatic 152  com/qualcomm/logkit/settings/UnixSocketSendThread:logd  (Ljava/lang/Object;)V
    //   142: goto -38 -> 104
    //   145: astore 5
    //   147: aload 5
    //   149: invokestatic 154  com/qualcomm/logkit/settings/UnixSocketSendThread:loge  (Ljava/lang/Object;)V
    //   152: aload_2
    //   153: ifnull -31 -> 122
    //   156: aload_2
    //   157: invokevirtual 135 android/net/LocalSocket:close   ()V
    //   160: goto -38 -> 122
    //   163: astore 6
    //   165: aload 6
    //   167: invokestatic 154  com/qualcomm/logkit/settings/UnixSocketSendThread:loge  (Ljava/lang/Object;)V
    //   170: goto -48 -> 122
    //   173: aload 11
    //   175: getfield 158  com/qualcomm/logkit/settings/ConfigPacket:logGlobalConfig   Lcom/qualcomm/logkit/settings/ConfigPacket$qlog_global_conf;
    //   178: getfield 163  com/qualcomm/logkit/settings/ConfigPacket$qlog_global_conf:log_path [B
    //   181: invokestatic 152  com/qualcomm/logkit/settings/UnixSocketSendThread:logd  (Ljava/lang/Object;)V
    //   184: goto -80 -> 104
    //   187: astore_3
    //   188: aload_2
    //   189: ifnull +7 -> 196
    //   192: aload_2
    //   193: invokevirtual 135 android/net/LocalSocket:close   ()V
    //   196: aload_3
    //   197: athrow
    //   198: astore 12
    //   200: aload 12
    //   202: invokestatic 154  com/qualcomm/logkit/settings/UnixSocketSendThread:loge  (Ljava/lang/Object;)V
    //   205: goto -83 -> 122
    //   208: astore 4
    //   210: aload 4
    //   212: invokestatic 154  com/qualcomm/logkit/settings/UnixSocketSendThread:loge  (Ljava/lang/Object;)V
    //   215: goto -19 -> 196
    //
    // Exception table:
    //   from   to  target  type
    //   8  114 145 java/io/IOException
    //   128    142 145 java/io/IOException
    //   173    184 145 java/io/IOException
    //   156    160 163 java/io/IOException
    //   8  114 187 finally
    //   128    142 187 finally
    //   147    152 187 finally
    //   173    184 187 finally
    //   118    122 198 java/io/IOException
    //   192    196 208 java/io/IOException
  }
//错误//
公共无效发送数据包(字节[]paramArrayOfByte)
{
//字节码:
//0:新的82 android/net/LocalSocket
//3:dup
//4:invokSpecial 83 android/net/LocalSocket:()V
//7:astore_2
//8:aload_2
//9:新的85 android/net/LocalSocketAddress
//12:dup
//13:最不发达国家87
//15:getstatic 93 android/net/LocalSocketAddress$命名空间:文件系统Landroid/net/LocalSocketAddress$命名空间;
//18:invokSpecial 96 android/net/LocalSocketAddress:(Ljava/lang/String;Landroid/net/LocalSocketAddress$Namespace;)V
//21:invokevirtual 100 android/net/LocalSocket:connect(Landroid/net/LocalSocketAddress;)V
//24:aload_2
//25:invokeVirtual104 android/net/LocalSocket:getOutputStream()Ljava/io/OutputStream;
//28:astore 7
//30:aload_2
//31:invokeVirtual108 android/net/LocalSocket:getInputStream()Ljava/io/InputStream;
//34:astore 8
//36:aload 7
//38:aload_1
//39:InvokeVirtual113 java/io/OutputStream:write([B)V
//42:aload 7
//44:invokeVirtual116 java/io/OutputStream:flush()V
//47:sipush 128
//50:newarray字节
//52:astore 9
//54:aload 8
//56:aload 9
//58:InvokeVirtual122 java/io/InputStream:read([B)I
//61:流行音乐
//62:新的124 com/qualcomm/logkit/settings/ConfigPacket
//65:dup
//66:aload 9
//68:invokespecial 126 com/qualcomm/logkit/settings/ConfigPacket:([B)V
//71:astore 11
//73:aload 11
//75:getfield 130 com/qualcomm/logkit/settings/ConfigPacket:msg_type B
//78:表开关默认值:+26->104,-127:+50->128,-126:+26->104,-125:+95->173
//105:iconst_4
//106:invokevirtual133 java/io/OutputStream:close()V
//109:aload 8
//111:invokeVirtual134 java/io/InputStream:close()V
//114:aload_2
//115:ifnull+7->122
//118:aload_2
//119:invokeVirtual135 android/net/LocalSocket:close()V
//122:aload_0
//123:iconst_0
//124:putfield 18 com/qualcomm/logkit/settings/unixsocketsendsthread:isRunning Z
//127:返回
//128:aload 11
//130:getfield 139 com/qualcomm/logkit/settings/ConfigPacket:logConfig Lcom/qualcomm/logkit/settings/ConfigPacket$qlog_conf;
//133:getfield 144 com/qualcomm/logkit/settings/ConfigPacket$qlog\u conf:filter\u str[B
//136:invokestatic 150 com/qualcomm/logkit/utils/UtilsStringOperation:byteToString([B)Ljava/lang/String;
//139:invokestatic 152 com/qualcomm/logkit/settings/UnixSocketSendThread:logd(Ljava/lang/Object;)V
//142:转到-38->104
//145:astore 5
//147:aload 5
//149:invokestatic 154 com/qualcomm/logkit/settings/UnixSocketSendThread:loge(Ljava/lang/Object;)V
//152:aload_2
//153:ifnull-31->122
//156:aload_2
//157:invokeVirtual135 android/net/LocalSocket:close()V
//160:转到-38->122
//163:astore 6
//165:aload 6
//167:invokestatic 154 com/qualcomm/logkit/settings/UnixSocketSendThread:loge(Ljava/lang/Object;)V
//170:转到-48->122
//173:aload 11
//175:getfield 158 com/qualcomm/logkit/settings/ConfigPacket:logGlobalConfig Lcom/qualcomm/logkit/settings/ConfigPacket$qlog\u global\u conf;
//178:getfield 163 com/qualcomm/logkit/settings/ConfigPacket$qlog\u global\u conf:log\u path[B
//181:invokestatic 152 com/qualcomm/logkit/settings/UnixSocketSendThread:logd(Ljava/lang/Object;)V
//184:转到-80->104
//187:astore_3
//188:aload_2
//189:ifnull+7->196
//192:aload_2
//193:invokeVirtual135安卓/net/LocalSocket:close()V
//196:aload_3
//197:athrow
//198:astore 12
//200:aload 12
//202:invokestatic 154 com/qualcomm/logkit/settings/UnixSocketSendThread:loge(Ljava/lang/Object;)V
//205:转到-83->122
//208:astore 4
//210:aload 4
//212:invokestatic 154 com/qualcomm/logkit/settings/UnixSocketSendThread:loge(Ljava/lang/Object;)V
//215:转到-19->196
//
//例外情况表:
//从到目标类型
//8 114 145 java/io/IOException
//128 142 145 java/io/IOException
//173 184 145 java/io/IOException
//156 160 163 java/io/IOException
//8 114 187最后
//128 142 187最后
//147 152 187最后
//173 184 187最后
//118 122 198 java/io/IOException
//192 196 208 java/io/IOException
}
怎么了

怎么了

没有问题。反编译器经常会遇到代码过于复杂或已被混淆(故意使其难以反编译…)的问题

你能做些什么呢?除了手工反编译代码之外,没什么大不了的。(但这并不容易。首先,你需要找出异常处理的范围,并重新创建try/catch/finally块。)

怎么了

没有问题。反编译器经常会遇到代码过于复杂或已被混淆(故意使其难以反编译…)的问题


你能做些什么呢?除了手工反编译代码之外,没什么大不了的。(但这并不容易。首先,你需要找出异常处理的范围,并重新创建try/catch/finally块。)

这可能只是反编译器的一个限制,也可能是此方法被混淆了。尽管通常整个.apk都被混淆了,而不仅仅是一个方法。如果您说这是哪个.apk,它可能会建议