weixin_41870203 2019-04-09 14:38 采纳率: 0%
浏览 1374

jar包中class文件中的代码与java 源文件代码不一致

使用 android studio 将java代码 生成.jar 包,通过 android studio 打开jar包,发现其中的class 文件中的代码与java 源文件代码不一致,而且class 文件中的代码有问题

java 代码:
public synchronized boolean Deserialize(String data) {
        int MaxSlots;
        int MaxChunksPerSlot;
        int ChunkSize;
        int TotalSize;

        if (null == data)
            return false;

        if (data.isEmpty())
        {
            destroy();
            return true;
        }

        String[] arrayData = data.split(" ");
        int arrdatalen = arrayData.length;
        if (arrdatalen < 5)
            return false;

       _** int idex = 0;**_
        try {
            ChunkSize =  Integer.parseInt(arrayData[idex++]);
            MaxSlots =  Integer.parseInt(arrayData[idex++]);
            MaxChunksPerSlot =  Integer.parseInt(arrayData[idex++]);
            TotalSize =  Integer.parseInt(arrayData[idex++]);
        } catch (NumberFormatException e) {
            e.printStackTrace();
            return false;
        }


        if(!(MaxSlots < 10000 && MaxChunksPerSlot < 10000 && ChunkSize < 10000))
            return false;

        if (TotalSize > MaxSlots * MaxChunksPerSlot * ChunkSize)
            return false;

        destroy();
        m_MaxSlots = MaxSlots;
        m_MaxChunksPerSlot = MaxChunksPerSlot;
        m_ChunkSize = ChunkSize; 
        count = TotalSize;
        buf = new byte[count];
        int opindex = 0;
        while (idex < arrdatalen)
        {
            int chunk_id =  Integer.parseInt(arrayData[idex++]);
            int base64_size =  Integer.parseInt(arrayData[idex++]);

            byte[] pBuffer = new byte[ChunkSize];

            int ret = Util.Base64_Decode(arrayData[idex++], base64_size, pBuffer, ChunkSize);

            if (ret < 0) return false;

            if (ret + opindex <= count)
                System.arraycopy(pBuffer, 0, this.buf, opindex, ret);
            opindex += ret;

            data += base64_size;
        }

        return true;
    }


//.class 文件代码

  public synchronized boolean Deserialize(String data) {
        if (null == data) {
            return false;
        } else if (data.isEmpty()) {
            this.destroy();
            return true;
        } else {
            String[] arrayData = data.split(" ");
            int arrdatalen = arrayData.length;
            if (arrdatalen < 5) {
                return false;
            } else {
                **byte idex = 0;**

                int MaxSlots;
                int MaxChunksPerSlot;
                int ChunkSize;
                int TotalSize;
                _**int idex;**_
                try {
                    **_idex = idex + 1;_**
                    ChunkSize = Integer.parseInt(arrayData[idex]);
                    MaxSlots = Integer.parseInt(arrayData[idex++]);
                    MaxChunksPerSlot = Integer.parseInt(arrayData[idex++]);
                    TotalSize = Integer.parseInt(arrayData[idex++]);
                } catch (NumberFormatException var14) {
                    var14.printStackTrace();
                    return false;
                }

                if (MaxSlots < 10000 && MaxChunksPerSlot < 10000 && ChunkSize < 10000) {
                    if (TotalSize > MaxSlots * MaxChunksPerSlot * ChunkSize) {
                        return false;
                    } else {
                        this.destroy();
                        this.m_MaxSlots = MaxSlots;
                        this.m_MaxChunksPerSlot = MaxChunksPerSlot;
                        this.m_ChunkSize = ChunkSize;
                        this.count = TotalSize;
                        this.buf = new byte[this.count];

                        int base64_size;
                        for(int opindex = 0; idex < arrdatalen; data = data + base64_size) {
                            Integer.parseInt(arrayData[idex++]);
                            base64_size = Integer.parseInt(arrayData[idex++]);
                            byte[] pBuffer = new byte[ChunkSize];
                            int ret = Util.Base64_Decode(arrayData[idex++], base64_size, pBuffer, ChunkSize);
                            if (ret < 0) {
                                return false;
                            }

                            if (ret + opindex <= this.count) {
                                System.arraycopy(pBuffer, 0, this.buf, opindex, ret);
                            }

                            opindex += ret;
                        }

                        return true;
                    }
                } else {
                    return false;
                }
            }
        }
    }
    ```
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 spring后端vue前端
    • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
    • ¥15 解riccati方程组
    • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
    • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
    • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
    • ¥50 树莓派安卓APK系统签名
    • ¥65 汇编语言除法溢出问题
    • ¥15 Visual Studio问题
    • ¥20 求一个html代码,有偿