From 7ce5a177ec7f1520bdb3183825ccdb42b8b46d86 Mon Sep 17 00:00:00 2001 From: C-3PO Date: Sun, 24 Jun 2018 10:10:00 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=20Move=20files=20into=20subdirectorie?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config.ts | 2 +- src/ssn/decryption/decryptFile.ts | 2 +- src/ssn/decryption/getDecryptionKeys.ts | 2 +- src/ssn/decryption/{ => lib}/getCrc.ts | 0 src/ssn/decryption/{ => lib}/int32Mul.ts | 0 src/ssn/decryption/{ => lib}/updateKeys.ts | 0 src/ssn/findReleasePath.ts | 2 +- src/ssn/getPatch.ts | 2 +- src/ssn/getPatchmanifest.ts | 8 ++++---- src/ssn/getSolidpkg.ts | 8 ++++---- src/ssn/{ => reader}/bencodeParser.ts | 0 src/ssn/{ => reader}/parsePatchmanifest.ts | 2 +- src/ssn/{ => reader}/readSsnFile.ts | 6 +++--- src/ssn/{ => verify}/verifyPatchmanifest.ts | 2 +- src/ssn/{ => verify}/verifyProductName.ts | 2 +- src/ssn/{ => verify}/verifySolidpkg.ts | 2 +- 16 files changed, 20 insertions(+), 20 deletions(-) rename src/ssn/decryption/{ => lib}/getCrc.ts (100%) rename src/ssn/decryption/{ => lib}/int32Mul.ts (100%) rename src/ssn/decryption/{ => lib}/updateKeys.ts (100%) rename src/ssn/{ => reader}/bencodeParser.ts (100%) rename src/ssn/{ => reader}/parsePatchmanifest.ts (96%) rename src/ssn/{ => reader}/readSsnFile.ts (97%) rename src/ssn/{ => verify}/verifyPatchmanifest.ts (99%) rename src/ssn/{ => verify}/verifyProductName.ts (91%) rename src/ssn/{ => verify}/verifySolidpkg.ts (98%) diff --git a/src/config.ts b/src/config.ts index 6a2441b..36d3f4b 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,5 +1,5 @@ import { ISettings, Product } from './interfaces/ISettings'; -import verifyProductName from './ssn/verifyProductName'; +import verifyProductName from './ssn/verify/verifyProductName'; const settings: ISettings = {}; diff --git a/src/ssn/decryption/decryptFile.ts b/src/ssn/decryption/decryptFile.ts index 996fd6b..20f4ac8 100644 --- a/src/ssn/decryption/decryptFile.ts +++ b/src/ssn/decryption/decryptFile.ts @@ -1,4 +1,4 @@ -import updateKeys from './updateKeys'; +import updateKeys from './lib/updateKeys'; export default function decryptFile(dv: DataView, length: number, [key0, key1, key2]: [number, number, number]) { const decryptedBuffer = new ArrayBuffer(length - 12); diff --git a/src/ssn/decryption/getDecryptionKeys.ts b/src/ssn/decryption/getDecryptionKeys.ts index c796a6f..23d7b7a 100644 --- a/src/ssn/decryption/getDecryptionKeys.ts +++ b/src/ssn/decryption/getDecryptionKeys.ts @@ -1,4 +1,4 @@ -import updateKeys from './updateKeys'; +import updateKeys from './lib/updateKeys'; export default function getDecryptionKeys(password: Uint8Array): [number, number, number] { let [key0, key1, key2] = [0x12345678, 0x23456789, 0x34567890]; diff --git a/src/ssn/decryption/getCrc.ts b/src/ssn/decryption/lib/getCrc.ts similarity index 100% rename from src/ssn/decryption/getCrc.ts rename to src/ssn/decryption/lib/getCrc.ts diff --git a/src/ssn/decryption/int32Mul.ts b/src/ssn/decryption/lib/int32Mul.ts similarity index 100% rename from src/ssn/decryption/int32Mul.ts rename to src/ssn/decryption/lib/int32Mul.ts diff --git a/src/ssn/decryption/updateKeys.ts b/src/ssn/decryption/lib/updateKeys.ts similarity index 100% rename from src/ssn/decryption/updateKeys.ts rename to src/ssn/decryption/lib/updateKeys.ts diff --git a/src/ssn/findReleasePath.ts b/src/ssn/findReleasePath.ts index e74be5e..d0d5f93 100644 --- a/src/ssn/findReleasePath.ts +++ b/src/ssn/findReleasePath.ts @@ -1,5 +1,5 @@ import { Product } from '../interfaces/ISettings'; -import verifyProductName from '../ssn/verifyProductName'; +import verifyProductName from '../ssn/verify/verifyProductName'; /** For the given release in the given product, returns from which releases we can patch to this release. */ function getFroms({ product, to: releaseTo}: {product: Product, to: number}) { diff --git a/src/ssn/getPatch.ts b/src/ssn/getPatch.ts index a2bc293..442b69e 100644 --- a/src/ssn/getPatch.ts +++ b/src/ssn/getPatch.ts @@ -3,7 +3,7 @@ import { Product } from '../interfaces/ISettings'; import { SsnDiffType } from '../interfaces/ISsnFileEntry'; import extractFile from './extractFile'; import getSolidpkg from './getSolidpkg'; -import readSsnFile from './readSsnFile'; +import readSsnFile from './reader/readSsnFile'; export default async function getPatch(product: Product, from: number, to: number) { const solidPkg = await getSolidpkg(product, from, to); diff --git a/src/ssn/getPatchmanifest.ts b/src/ssn/getPatchmanifest.ts index 1e9529b..b695388 100644 --- a/src/ssn/getPatchmanifest.ts +++ b/src/ssn/getPatchmanifest.ts @@ -3,11 +3,11 @@ import * as xmlJs from 'xml-js'; import getUrlContents from '../cdn/getUrlContents'; import IManifest from '../interfaces/IManifest'; import { Product } from '../interfaces/ISettings'; -import parsePatchmanifest from '../ssn/parsePatchmanifest'; -import verifyPatchmanifest from '../ssn/verifyPatchmanifest'; -import verifyProductName from '../ssn/verifyProductName'; import extractFile from './extractFile'; -import readSsnFile from './readSsnFile'; +import parsePatchmanifest from './reader/parsePatchmanifest'; +import readSsnFile from './reader/readSsnFile'; +import verifyPatchmanifest from './verify/verifyPatchmanifest'; +import verifyProductName from './verify/verifyProductName'; const Decoder = new TextDecoder('utf-8'); diff --git a/src/ssn/getSolidpkg.ts b/src/ssn/getSolidpkg.ts index a31d1fc..a8a7167 100644 --- a/src/ssn/getSolidpkg.ts +++ b/src/ssn/getSolidpkg.ts @@ -2,11 +2,11 @@ import getUrlContents from '../cdn/getUrlContents'; import { Product } from '../interfaces/ISettings'; import ISolid from '../interfaces/ISolidFile'; import ISolidSimple from '../interfaces/ISolidSimple'; -import verifyProductName from '../ssn/verifyProductName'; -import parseBencode from './bencodeParser'; import extractFile from './extractFile'; -import readSsnFile from './readSsnFile'; -import verifySolidpkg from './verifySolidpkg'; +import parseBencode from './reader/bencodeParser'; +import readSsnFile from './reader/readSsnFile'; +import verifyProductName from './verify/verifyProductName'; +import verifySolidpkg from './verify/verifySolidpkg'; export default async function getSolidpkg(product: Product, from: number, to: number): Promise { //Verify function arguments diff --git a/src/ssn/bencodeParser.ts b/src/ssn/reader/bencodeParser.ts similarity index 100% rename from src/ssn/bencodeParser.ts rename to src/ssn/reader/bencodeParser.ts diff --git a/src/ssn/parsePatchmanifest.ts b/src/ssn/reader/parsePatchmanifest.ts similarity index 96% rename from src/ssn/parsePatchmanifest.ts rename to src/ssn/reader/parsePatchmanifest.ts index 8088a30..7e39716 100644 --- a/src/ssn/parsePatchmanifest.ts +++ b/src/ssn/reader/parsePatchmanifest.ts @@ -1,4 +1,4 @@ -import IManifest from '../interfaces/IManifest'; +import IManifest from '../../interfaces/IManifest'; /** Receives a JSON-converted version of the manifest.xml file, and returns an easier to read JSON file */ export default function parsePatchManifest(manifestFile: any): IManifest { diff --git a/src/ssn/readSsnFile.ts b/src/ssn/reader/readSsnFile.ts similarity index 97% rename from src/ssn/readSsnFile.ts rename to src/ssn/reader/readSsnFile.ts index dfae703..aaa3092 100644 --- a/src/ssn/readSsnFile.ts +++ b/src/ssn/reader/readSsnFile.ts @@ -4,9 +4,9 @@ */ import { TextDecoder } from 'util'; -import { ISsnFileEntry } from '../interfaces/ISsnFileEntry'; -import getDecryptionKeys from './decryption/getDecryptionKeys'; -import modifyPassword from './decryption/modifyPassword'; +import { ISsnFileEntry } from '../../interfaces/ISsnFileEntry'; +import getDecryptionKeys from '../decryption/getDecryptionKeys'; +import modifyPassword from '../decryption/modifyPassword'; const SIGNATURE_END_OF_CENTRAL_DIR = 0x06054b50; const SIGNATURE_CENTRAL_DIR = 0x02014b50; diff --git a/src/ssn/verifyPatchmanifest.ts b/src/ssn/verify/verifyPatchmanifest.ts similarity index 99% rename from src/ssn/verifyPatchmanifest.ts rename to src/ssn/verify/verifyPatchmanifest.ts index 14ae503..c5149e5 100644 --- a/src/ssn/verifyPatchmanifest.ts +++ b/src/ssn/verify/verifyPatchmanifest.ts @@ -1,5 +1,5 @@ import * as xmlJs from 'xml-js'; -import { Product } from '../interfaces/ISettings'; +import { Product } from '../../interfaces/ISettings'; /** Receives a JSON-converted version of the manifest.xml file, and verifies that all required elements and attributes are present, and nothing more */ export default function verifyPatchmanifest(manifestFile: xmlJs.Element, product: Product): any { diff --git a/src/ssn/verifyProductName.ts b/src/ssn/verify/verifyProductName.ts similarity index 91% rename from src/ssn/verifyProductName.ts rename to src/ssn/verify/verifyProductName.ts index fb8f47b..c305620 100644 --- a/src/ssn/verifyProductName.ts +++ b/src/ssn/verify/verifyProductName.ts @@ -1,4 +1,4 @@ -import { Product } from '../interfaces/ISettings'; +import { Product } from '../../interfaces/ISettings'; const allowedProducts: Product[] = ['assets_swtor_de_de', 'assets_swtor_en_us', 'assets_swtor_fr_fr', 'assets_swtor_main', 'assets_swtor_test_de_de', 'assets_swtor_test_en_us', 'assets_swtor_test_fr_fr', 'assets_swtor_test_main', 'eualas', 'movies_de_de', 'movies_en_us', 'movies_fr_fr', 'patcher2014', 'patcher2017', 'retailclient_betatest', 'retailclient_cstraining', 'retailclient_liveeptest', 'retailclient_publictest', 'retailclient_squadron157', 'retailclient_swtor']; diff --git a/src/ssn/verifySolidpkg.ts b/src/ssn/verify/verifySolidpkg.ts similarity index 98% rename from src/ssn/verifySolidpkg.ts rename to src/ssn/verify/verifySolidpkg.ts index 75b8200..d5be80d 100644 --- a/src/ssn/verifySolidpkg.ts +++ b/src/ssn/verify/verifySolidpkg.ts @@ -1,4 +1,4 @@ -import ISolid from '../interfaces/ISolidFile'; +import ISolid from '../../interfaces/ISolidFile'; /** Verifies metafile.solid for correctness. See specification at . */ export default function verifySolidpkg(file: ISolid, { product, from, to }: {product: string, from: number, to: number}) {