From 3af1e53a19b6fb1795ce040eeaa251b206e089a8 Mon Sep 17 00:00:00 2001 From: RoyceDa Date: Thu, 12 Feb 2026 14:38:18 +0200 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B1=D1=80=D0=B0=D0=BD=D1=8B=20=D0=BD?= =?UTF-8?q?=D0=B5=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D1=83=D0=B5?= =?UTF-8?q?=D0=BC=D1=8B=D0=B5=20=D0=BF=D0=B0=D0=BA=D0=B5=D1=82=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../protocol/packets/packet.appupdate.ts | 54 ------------- .../protocol/packets/packet.avatar.ts | 77 ------------------- .../protocol/packets/packet.kernelupdate.ts | 43 ----------- .../ProtocolProvider/protocol/protocol.ts | 10 +-- 4 files changed, 3 insertions(+), 181 deletions(-) delete mode 100644 app/providers/ProtocolProvider/protocol/packets/packet.appupdate.ts delete mode 100644 app/providers/ProtocolProvider/protocol/packets/packet.avatar.ts delete mode 100644 app/providers/ProtocolProvider/protocol/packets/packet.kernelupdate.ts diff --git a/app/providers/ProtocolProvider/protocol/packets/packet.appupdate.ts b/app/providers/ProtocolProvider/protocol/packets/packet.appupdate.ts deleted file mode 100644 index 82f66f4..0000000 --- a/app/providers/ProtocolProvider/protocol/packets/packet.appupdate.ts +++ /dev/null @@ -1,54 +0,0 @@ -import Packet from "../packet"; -import Stream from "../stream"; - -export class PacketAppUpdate extends Packet { - - private url: string = ""; - private version: string = ""; - private kernelVersionRequired: string = ""; - - public getPacketId(): number { - return 0x0E; - } - - public _receive(stream: Stream): void { - this.url = stream.readString(); - this.version = stream.readString(); - this.kernelVersionRequired = stream.readString(); - } - - - public _send(): Promise | Stream { - let stream = new Stream(); - stream.writeInt16(this.getPacketId()); - stream.writeString(this.url); - stream.writeString(this.version); - stream.writeString(this.kernelVersionRequired); - return stream; - } - - public getUrl(): string { - return this.url; - } - - public setUrl(url: string): void { - this.url = url; - } - - public getVersion(): string { - return this.version; - } - - public setVersion(version: string): void { - this.version = version; - } - - public getKernelVersionRequired(): string { - return this.kernelVersionRequired; - } - - public setKernelVersionRequired(kernelVersionRequired: string): void { - this.kernelVersionRequired = kernelVersionRequired; - } - -} \ No newline at end of file diff --git a/app/providers/ProtocolProvider/protocol/packets/packet.avatar.ts b/app/providers/ProtocolProvider/protocol/packets/packet.avatar.ts deleted file mode 100644 index cdbeae3..0000000 --- a/app/providers/ProtocolProvider/protocol/packets/packet.avatar.ts +++ /dev/null @@ -1,77 +0,0 @@ -import Packet from "../packet"; -import Stream from "../stream"; - -export class PacketAvatar extends Packet { - - private privateKey : string = ""; - private fromPublicKey: string = ""; - private toPublicKey: string = ""; - private blob: string = ""; - - private chachaKey: string = ""; - - - public getPacketId(): number { - return 0x0C; - } - - public _receive(stream: Stream): void { - this.privateKey = stream.readString(); - this.fromPublicKey = stream.readString(); - this.toPublicKey = stream.readString(); - this.chachaKey = stream.readString(); - this.blob = stream.readString(); - } - - public _send(): Promise | Stream { - const stream = new Stream(); - stream.writeInt16(this.getPacketId()); - stream.writeString(this.privateKey); - stream.writeString(this.fromPublicKey); - stream.writeString(this.toPublicKey); - stream.writeString(this.chachaKey); - stream.writeString(this.blob); - return stream; - } - - public setFromPublicKey(fromPublicKey: string): void { - this.fromPublicKey = fromPublicKey; - } - - public setToPublicKey(toPublicKey: string): void { - this.toPublicKey = toPublicKey; - } - - public getFromPublicKey(): string { - return this.fromPublicKey; - } - - public getToPublicKey(): string { - return this.toPublicKey; - } - - public setPrivateKey(hash: string): void { - this.privateKey = hash; - } - - public getPrivateKey(): string { - return this.privateKey; - } - - public setBlob(blob: string): void { - this.blob = blob; - } - - public getBlob(): string { - return this.blob; - } - - public setChachaKey(key: string): void { - this.chachaKey = key; - } - - public getChachaKey(): string { - return this.chachaKey; - } - -} \ No newline at end of file diff --git a/app/providers/ProtocolProvider/protocol/packets/packet.kernelupdate.ts b/app/providers/ProtocolProvider/protocol/packets/packet.kernelupdate.ts deleted file mode 100644 index 3ba2486..0000000 --- a/app/providers/ProtocolProvider/protocol/packets/packet.kernelupdate.ts +++ /dev/null @@ -1,43 +0,0 @@ -import Packet from "../packet"; -import Stream from "../stream"; - -export class PacketKernelUpdate extends Packet { - - private url: string = ""; - private version: string = ""; - - - public getPacketId(): number { - return 0x0D; - } - - public _receive(stream: Stream): void { - this.url = stream.readString(); - this.version = stream.readString(); - } - - public _send(): Promise | Stream { - let stream = new Stream(); - stream.writeInt16(this.getPacketId()); - stream.writeString(this.url); - stream.writeString(this.version); - return stream; - } - - public getUrl(): string { - return this.url; - } - - public setUrl(url: string): void { - this.url = url; - } - - public getVersion(): string { - return this.version; - } - - public setVersion(version: string): void { - this.version = version; - } - -} \ No newline at end of file diff --git a/app/providers/ProtocolProvider/protocol/protocol.ts b/app/providers/ProtocolProvider/protocol/protocol.ts index 4874ef3..8afba70 100644 --- a/app/providers/ProtocolProvider/protocol/protocol.ts +++ b/app/providers/ProtocolProvider/protocol/protocol.ts @@ -13,9 +13,6 @@ import { PacketDelivery } from "./packets/packet.delivery"; import { PacketRequestUpdate } from "./packets/packet.requestupdate"; import { RECONNECTING_INTERVAL } from "@/app/constants"; import { PacketTyping } from "./packets/packet.typeing"; -import { PacketAvatar } from "./packets/packet.avatar"; -import { PacketKernelUpdate } from "./packets/packet.kernelupdate"; -import { PacketAppUpdate } from "./packets/packet.appupdate"; import { PacketRequestTransport } from "./packets/packet.requesttransport"; import { PacketPushNotification } from "./packets/packet.push.notification"; import { PacketCreateGroup } from "./packets/packet.create.group"; @@ -113,9 +110,9 @@ export default class Protocol extends EventEmitter { this._supportedPackets.set(0x09, new PacketDeviceNew()); this._supportedPackets.set(0x0A, new PacketRequestUpdate()); this._supportedPackets.set(0x0B, new PacketTyping()); - this._supportedPackets.set(0x0C, new PacketAvatar()); - this._supportedPackets.set(0x0D, new PacketKernelUpdate()); - this._supportedPackets.set(0x0E, new PacketAppUpdate()); + //this._supportedPackets.set(0x0C, new PacketAvatar()); + //this._supportedPackets.set(0x0D, new PacketKernelUpdate()); + //this._supportedPackets.set(0x0E, new PacketAppUpdate()); this._supportedPackets.set(0x0F, new PacketRequestTransport()); this._supportedPackets.set(0x10, new PacketPushNotification()); this._supportedPackets.set(0x11, new PacketCreateGroup()); @@ -144,7 +141,6 @@ export default class Protocol extends EventEmitter { this.isManuallyClosed = false; this.socket.addEventListener('open', () => { - //this.reconnectTryings = 0; this.emit('connect'); this._flushPacketQueue(); // Отправляем все пакеты из очереди });