我用dex2jar工具來反編譯的apk文件, 的所有代碼可以正確反編譯,但是這種方法,爲什麼不能從android 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
}
有什麼不對?
dex2jar無法正確解析某些方法,因此您會得到如此的結果。 –
@PankajKumar有沒有比dex2jar更好的工具? –