使用 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;
}
}
}
}
```