mirror of
https://github.com/MatsuriDayo/NekoBoxForAndroid.git
synced 2025-12-19 06:30:05 +08:00
parent
680b362bcb
commit
b34c0124da
@ -105,9 +105,8 @@ public abstract class StandardV2RayBean extends AbstractBean {
|
||||
|
||||
@Override
|
||||
public void serialize(ByteBufferOutput output) {
|
||||
output.writeInt(0);
|
||||
output.writeInt(1);
|
||||
super.serialize(output);
|
||||
|
||||
output.writeString(uuid);
|
||||
output.writeString(encryption);
|
||||
if (this instanceof VMessBean) {
|
||||
@ -211,11 +210,33 @@ public abstract class StandardV2RayBean extends AbstractBean {
|
||||
realityShortId = input.readString();
|
||||
}
|
||||
|
||||
enableECH = input.readBoolean();
|
||||
if (enableECH) {
|
||||
enablePqSignature = input.readBoolean();
|
||||
disabledDRS = input.readBoolean();
|
||||
echConfig = input.readString();
|
||||
if (version >= 1) { // 从老版本升级上来
|
||||
enableECH = input.readBoolean();
|
||||
if (enableECH) {
|
||||
enablePqSignature = input.readBoolean();
|
||||
disabledDRS = input.readBoolean();
|
||||
echConfig = input.readString();
|
||||
}
|
||||
}
|
||||
|
||||
if (version == 0) {
|
||||
// 从老版本升级上来但是 version == 0, 可能有 enableECH 也可能没有,需要做判断
|
||||
int position = input.getByteBuffer().position(); // 当前位置
|
||||
|
||||
boolean tmpEnableECH = input.readBoolean();
|
||||
int tmpPacketEncoding = input.readInt();
|
||||
|
||||
input.setPosition(position); // 读后归位
|
||||
|
||||
if (tmpPacketEncoding != 1 && tmpPacketEncoding != 2) {
|
||||
input.getByteBuffer().position(position);
|
||||
enableECH = tmpEnableECH;
|
||||
if (enableECH) {
|
||||
enablePqSignature = input.readBoolean();
|
||||
disabledDRS = input.readBoolean();
|
||||
echConfig = input.readString();
|
||||
}
|
||||
} // 否则后一位就是 packetEncoding
|
||||
}
|
||||
|
||||
packetEncoding = input.readInt();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user