diff --git a/arkguard/src/utils/ScopeAnalyzer.ts b/arkguard/src/utils/ScopeAnalyzer.ts index b64f01e0b792fc69715fd43fc586664abfd3644a..1e889ba0746ee490eb9b20e86c7211b4274b04f1 100644 --- a/arkguard/src/utils/ScopeAnalyzer.ts +++ b/arkguard/src/utils/ScopeAnalyzer.ts @@ -317,9 +317,9 @@ namespace secharmony { if (def.exportSymbol) { current.exportNames.add(def.name); current.addDefinition(def.exportSymbol, true); + } else { + current.addDefinition(def); } - - current.addDefinition(def); }); } diff --git a/arkguard/test/grammar/export_namecache/namecacheTest7_export.ts b/arkguard/test/grammar/export_namecache/namecacheTest7_export.ts new file mode 100644 index 0000000000000000000000000000000000000000..b20628c1f65dc442e1764f00a76a8649a1589587 --- /dev/null +++ b/arkguard/test/grammar/export_namecache/namecacheTest7_export.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +export default function add(a: number, b: number): number { + return a + b; +} + +function subtract(a: number, b: number): number { + return a - b; +} + +export function multiply(a: number, b: number): number { + return a * b; +} + +export { multiply as times }; + +export const PI: number = 3.14; + +export class Student { + name: string; + age: number; + constructor(name: string, age: number) { + this.name = name; + this.age = age; + }; +} + +interface Lesson { + id: number, + date: string +} + +type customType = string; + +export { subtract, customType, Lesson }; \ No newline at end of file diff --git a/arkguard/test/grammar/export_namecache/namecacheTest7_export_expected.txt b/arkguard/test/grammar/export_namecache/namecacheTest7_export_expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..fa6f68ef08efb1dbaf25b577f6f8ff7491ed1638 --- /dev/null +++ b/arkguard/test/grammar/export_namecache/namecacheTest7_export_expected.txt @@ -0,0 +1,26 @@ +export default function add(t: number, u: number): number { + return t + u; +} +function i(r: number, s: number): number { + return r - s; +} +export function multiply(p: number, q: number): number { + return p * q; +} +export { multiply as m }; +export const PI: number = 3.14; +export class j { + name: string; + g: number; + constructor(n: string, o: number) { + this.name = n; + this.g = o; + } + ; +} +interface k { + id: number; + h: string; +} +type l = string; +export { i, l, k }; diff --git a/arkguard/test/grammar/export_namecache/namecacheTest7_export_expected_cache.txt b/arkguard/test/grammar/export_namecache/namecacheTest7_export_expected_cache.txt new file mode 100644 index 0000000000000000000000000000000000000000..47012b88545b45a78e5c01c0b49483bca126449e --- /dev/null +++ b/arkguard/test/grammar/export_namecache/namecacheTest7_export_expected_cache.txt @@ -0,0 +1,23 @@ +{ + "IdentifierCache": { + "#default": "default", + "#PI": "PI", + "#Student": "j", + "#Lesson": "k", + "#customType": "l", + "#times": "m", + "Student#$0#name": "n", + "Student#$0#age": "o", + "multiply#a": "p", + "multiply#b": "q", + "subtract#a": "r", + "subtract#b": "s", + "add#a": "t", + "add#b": "u", + "#subtract:21:23": "i", + "#multiply:25:27": "multiply" + }, + "MemberMethodCache": { + "Student:36:39": "j" + } +} \ No newline at end of file diff --git a/arkguard/test/grammar/export_namecache/namecacheTest7_import.ts b/arkguard/test/grammar/export_namecache/namecacheTest7_import.ts new file mode 100644 index 0000000000000000000000000000000000000000..f20d2867450982b65a7769ff488abc05664f2268 --- /dev/null +++ b/arkguard/test/grammar/export_namecache/namecacheTest7_import.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +import add from './namecacheTest7_export'; +import { multiply, times } from './namecacheTest7_export'; +import { PI, Student } from './namecacheTest7_export'; +import { subtract, Lesson } from './namecacheTest7_export'; +import type { customType } from './namecacheTest7_export'; + +let xiaoming = new Student("xiaoming", 12); +let xiaohong: Student = new Student("xiaohong", 11); +var value: customType = "hello"; +const factor: number = 5; +let equal = (times(factor, PI) == multiply(factor, PI)); +let math: Lesson = { + id: 1, + date: "2023" +}; \ No newline at end of file diff --git a/arkguard/test/grammar/export_namecache/namecacheTest7_import_expected.txt b/arkguard/test/grammar/export_namecache/namecacheTest7_import_expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..309dd5033b5ae916f4dc5da0e21b7fa5d1039446 --- /dev/null +++ b/arkguard/test/grammar/export_namecache/namecacheTest7_import_expected.txt @@ -0,0 +1,14 @@ +import add from './namecacheTest7_export'; +import { multiply, m } from './namecacheTest7_export'; +import { PI, j } from './namecacheTest7_export'; +import { i, k } from './namecacheTest7_export'; +import type { l } from './namecacheTest7_export'; +let v = new j("xiaoming", 12); +let a1: j = new j("xiaohong", 11); +var value: l = "hello"; +const b1: number = 5; +let c1 = (m(b1, PI) == multiply(b1, PI)); +let d1: k = { + id: 1, + h: "2023" +}; diff --git a/arkguard/test/grammar/export_namecache/namecacheTest7_import_expected_cache.txt b/arkguard/test/grammar/export_namecache/namecacheTest7_import_expected_cache.txt new file mode 100644 index 0000000000000000000000000000000000000000..880d14ffe15537b28b2fe521f3cae6db1e54d5a6 --- /dev/null +++ b/arkguard/test/grammar/export_namecache/namecacheTest7_import_expected_cache.txt @@ -0,0 +1,19 @@ +{ + "IdentifierCache": { + "#add": "add", + "#multiply": "multiply", + "#times": "m", + "#PI": "PI", + "#Student": "j", + "#subtract": "i", + "#Lesson": "k", + "#customType": "l", + "#xiaoming": "v", + "#xiaohong": "a1", + "#value": "value", + "#factor": "b1", + "#equal": "c1", + "#math": "d1" + }, + "MemberMethodCache": {} +} \ No newline at end of file diff --git a/arkguard/test/grammar/export_namecache/namecacheTest8_export.ts b/arkguard/test/grammar/export_namecache/namecacheTest8_export.ts new file mode 100644 index 0000000000000000000000000000000000000000..0ab05e685f107f06b70e18bec1c16b784f28954e --- /dev/null +++ b/arkguard/test/grammar/export_namecache/namecacheTest8_export.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +export default class Student { + name: string; + age: number; + constructor(name: string, age: number) { + this.name = name; + this.age = age; + }; +}; + +class Particle { + public row: number = 0; + public col: number = 0; +}; + +interface Lesson { + id: number, + date: string, + students: Student[] +}; + +export type Klass = { + date: number; + name: string; +}; + +export type customType = Student; + +export type { Particle }; +export { Lesson }; \ No newline at end of file diff --git a/arkguard/test/grammar/export_namecache/namecacheTest8_export_expected.txt b/arkguard/test/grammar/export_namecache/namecacheTest8_export_expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..8ed86a2dc72ee8fce9e09274e912b1fb0d8d3af5 --- /dev/null +++ b/arkguard/test/grammar/export_namecache/namecacheTest8_export_expected.txt @@ -0,0 +1,28 @@ +export default class Student { + name: string; + g: number; + constructor(g1: string, h1: number) { + this.name = g1; + this.g = h1; + } + ; +} +; +class e1 { + public o: number = 0; + public p: number = 0; +} +; +interface k { + id: number; + h: string; + q: Student[]; +} +; +export type f1 = { + h: number; + name: string; +}; +export type l = Student; +export type { e1 }; +export { k }; diff --git a/arkguard/test/grammar/export_namecache/namecacheTest8_export_expected_cache.txt b/arkguard/test/grammar/export_namecache/namecacheTest8_export_expected_cache.txt new file mode 100644 index 0000000000000000000000000000000000000000..8bc28e84a8109fcfb624a3122fa60549e5389451 --- /dev/null +++ b/arkguard/test/grammar/export_namecache/namecacheTest8_export_expected_cache.txt @@ -0,0 +1,14 @@ +{ + "IdentifierCache": { + "#default": "default", + "#Particle": "e1", + "#Lesson": "k", + "#Klass": "f1", + "#customType": "l", + "Student#$0#name": "g1", + "Student#$0#age": "h1" + }, + "MemberMethodCache": { + "Student:20:23": "Student" + } +} \ No newline at end of file diff --git a/arkguard/test/grammar/export_namecache/namecacheTest8_import.ts b/arkguard/test/grammar/export_namecache/namecacheTest8_import.ts new file mode 100644 index 0000000000000000000000000000000000000000..d3f4c6bff9ebb2268d14b47ce7b77ef74309dba4 --- /dev/null +++ b/arkguard/test/grammar/export_namecache/namecacheTest8_import.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +import Student from './namecacheTest8_export'; +import type { Particle, Lesson, Klass, customType } from './namecacheTest8_export'; + +function test(s: Student, p: Particle, l: Lesson, k: Klass, c: customType): void { +} + +function init(p: Particle): void { + p.row = 1; + p.col = 2; +} + +let students: Student[]; +const math: Lesson = { + id: 0, + date: "2023", + students: [] +}; \ No newline at end of file diff --git a/arkguard/test/grammar/export_namecache/namecacheTest8_import_expected.txt b/arkguard/test/grammar/export_namecache/namecacheTest8_import_expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..ab9a34bece21e5b43ad7852288535dffd6dd5289 --- /dev/null +++ b/arkguard/test/grammar/export_namecache/namecacheTest8_import_expected.txt @@ -0,0 +1,14 @@ +import j from './namecacheTest8_export'; +import type { e1, k, f1, l } from './namecacheTest8_export'; +function test(j1: j, k1: e1, l1: k, m1: f1, n1: l): void { +} +function init(i1: e1): void { + i1.o = 1; + i1.p = 2; +} +let q: j[]; +const d1: k = { + id: 0, + h: "2023", + q: [] +}; diff --git a/arkguard/test/grammar/export_namecache/namecacheTest8_import_expected_cache.txt b/arkguard/test/grammar/export_namecache/namecacheTest8_import_expected_cache.txt new file mode 100644 index 0000000000000000000000000000000000000000..4863217612244b7c9da1000ae925a43582f88afe --- /dev/null +++ b/arkguard/test/grammar/export_namecache/namecacheTest8_import_expected_cache.txt @@ -0,0 +1,20 @@ +{ + "IdentifierCache": { + "#Student": "j", + "#Particle": "e1", + "#Lesson": "k", + "#Klass": "f1", + "#customType": "l", + "#students": "q", + "#math": "d1", + "init#p": "i1", + "test#s": "j1", + "test#p": "k1", + "test#l": "l1", + "test#k": "m1", + "test#c": "n1", + "#test:20:21": "test", + "#init:23:26": "init" + }, + "MemberMethodCache": {} +} \ No newline at end of file diff --git a/arkguard/test/grammar/export_namecache/namecacheTest9_export.ts b/arkguard/test/grammar/export_namecache/namecacheTest9_export.ts new file mode 100644 index 0000000000000000000000000000000000000000..c28ff924a7493b312f07a8b0f55fd474071d4b2d --- /dev/null +++ b/arkguard/test/grammar/export_namecache/namecacheTest9_export.ts @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +interface I { + id: number; +} + +class A { + prop = 1; +} + +export { type I }; +export type { A }; \ No newline at end of file diff --git a/arkguard/test/grammar/export_namecache/namecacheTest9_export_expected.txt b/arkguard/test/grammar/export_namecache/namecacheTest9_export_expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..c5b7f66e2b01873d96ffd99446a2be07d3116796 --- /dev/null +++ b/arkguard/test/grammar/export_namecache/namecacheTest9_export_expected.txt @@ -0,0 +1,8 @@ +interface o1 { + id: number; +} +class q1 { + t = 1; +} +export { type o1 }; +export type { q1 }; diff --git a/arkguard/test/grammar/export_namecache/namecacheTest9_export_expected_cache.txt b/arkguard/test/grammar/export_namecache/namecacheTest9_export_expected_cache.txt new file mode 100644 index 0000000000000000000000000000000000000000..b0ba6d7d6e751a3b89a9b08d6eebeeb16b78ba03 --- /dev/null +++ b/arkguard/test/grammar/export_namecache/namecacheTest9_export_expected_cache.txt @@ -0,0 +1,7 @@ +{ + "IdentifierCache": { + "#I": "o1", + "#A": "q1" + }, + "MemberMethodCache": {} +} \ No newline at end of file diff --git a/arkguard/test/grammar/export_namecache/namecacheTest9_import.ts b/arkguard/test/grammar/export_namecache/namecacheTest9_import.ts new file mode 100644 index 0000000000000000000000000000000000000000..998ce5fe90ad9b20c3599744ab6eaeac78621a11 --- /dev/null +++ b/arkguard/test/grammar/export_namecache/namecacheTest9_import.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +import type { I } from "./namecacheTest9_export"; +import { type A } from "./namecacheTest9_export"; + + +function test(i: I, a: A): void { }; \ No newline at end of file diff --git a/arkguard/test/grammar/export_namecache/namecacheTest9_import_expected.txt b/arkguard/test/grammar/export_namecache/namecacheTest9_import_expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..ec8143cc194f8673273625836c7b2ca02f47ebc9 --- /dev/null +++ b/arkguard/test/grammar/export_namecache/namecacheTest9_import_expected.txt @@ -0,0 +1,4 @@ +import type { o1 } from "./namecacheTest9_export"; +import { type q1 } from "./namecacheTest9_export"; +function test(r1: o1, s1: q1): void { } +; diff --git a/arkguard/test/grammar/export_namecache/namecacheTest9_import_expected_cache.txt b/arkguard/test/grammar/export_namecache/namecacheTest9_import_expected_cache.txt new file mode 100644 index 0000000000000000000000000000000000000000..4dfdd597e220b802d9ce605691948b28c6c6318b --- /dev/null +++ b/arkguard/test/grammar/export_namecache/namecacheTest9_import_expected_cache.txt @@ -0,0 +1,10 @@ +{ + "IdentifierCache": { + "#I": "o1", + "#A": "q1", + "test#i": "r1", + "test#a": "s1", + "#test:21:21": "test" + }, + "MemberMethodCache": {} +} \ No newline at end of file diff --git a/arkguard/test/grammar/export_namecache/obfConfig.json b/arkguard/test/grammar/export_namecache/obfConfig.json new file mode 100644 index 0000000000000000000000000000000000000000..39e9cf62b5facaabbbf396804c515ba4577654a2 --- /dev/null +++ b/arkguard/test/grammar/export_namecache/obfConfig.json @@ -0,0 +1,21 @@ +{ + "mCompact": false, + "mRemoveComments": true, + "mOutputDir": "../../local", + "mDisableHilog": false, + "mDisableConsole": false, + "mSimplify": false, + "mNameObfuscation": { + "mEnable": true, + "mNameGeneratorType": 1, + "mDictionaryList": [], + "mReservedNames": [], + "mRenameProperties": true, + "mReservedProperties": [], + "mKeepStringProperty": false, + "mTopLevel": true + }, + "mEnableSourceMap": true, + "mEnableNameCache": true, + "mExportObfuscation": true +} \ No newline at end of file diff --git a/arkguard/test/grammar/export_obfuscation/xcommonjs-exports_1_expected.txt b/arkguard/test/grammar/export_obfuscation/xcommonjs-exports_1_expected.txt index 9b51a4a492d18671915c883bad7315063bb5a8a8..dc4e4918314952218cc1f6a347cca083dd8077bb 100644 --- a/arkguard/test/grammar/export_obfuscation/xcommonjs-exports_1_expected.txt +++ b/arkguard/test/grammar/export_obfuscation/xcommonjs-exports_1_expected.txt @@ -12,21 +12,21 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -let k5 = 1; -exports.v3 = k5; +let h5 = 1; +exports.v3 = h5; exports.w3 = 2; exports.x3 = function () { return 'Hello, world!'; }; class n4 { y3 = '00001'; - g4 = { i4: 'jack3', m4: 12 }; + j4 = { l4: 'jack3', m4: 12 }; } exports.n4 = n4; exports.o4 = class { - q4 = 11; - r4 = 15; - s4() { - return this.r4; + v4 = 11; + w4 = 15; + x4() { + return this.w4; } }; diff --git a/arkguard/test/grammar/export_obfuscation/xcommonjs-exports_2_expected.txt b/arkguard/test/grammar/export_obfuscation/xcommonjs-exports_2_expected.txt index 89cf29bb385f308eab21d86bd4633249aa37d91e..dd6771a63a986b1c298fa8343cc1507a091b2bba 100644 --- a/arkguard/test/grammar/export_obfuscation/xcommonjs-exports_2_expected.txt +++ b/arkguard/test/grammar/export_obfuscation/xcommonjs-exports_2_expected.txt @@ -17,5 +17,5 @@ module.exports = { z4: function () { return 'Hello, world2!'; }, - a5: { p2: 22 } + i5: { p2: 22 } }; diff --git a/arkguard/test/grammar/export_obfuscation/xcommonjs-require_1_expected.txt b/arkguard/test/grammar/export_obfuscation/xcommonjs-require_1_expected.txt index 439679952621d60f4e3831231bbe01ecbecf8f7a..a9de37e13d8b51ad70cf560acc37b376b6a96d1b 100644 --- a/arkguard/test/grammar/export_obfuscation/xcommonjs-require_1_expected.txt +++ b/arkguard/test/grammar/export_obfuscation/xcommonjs-require_1_expected.txt @@ -13,15 +13,15 @@ * limitations under the License. */ const assert = require('assert'); -const m5 = require('./xcommonjs-exports_1'); -assert.strictEqual(m5.v3, 1); -assert.strictEqual(m5.w3, 2); -assert.strictEqual(m5.x3(), 'Hello, world!'); -let n5 = new m5.n4(); -assert.strictEqual(n5.y3, '00001'); -assert.strictEqual(n5.g4.i4, 'jack3'); -assert.strictEqual(n5.g4.m4, 12); -let o5 = new m5.o4(); -o5.r4 = 16; -assert.strictEqual(o5.q4, 11); -assert.strictEqual(o5.s4(), 16); +const j5 = require('./xcommonjs-exports_1'); +assert.strictEqual(j5.v3, 1); +assert.strictEqual(j5.w3, 2); +assert.strictEqual(j5.x3(), 'Hello, world!'); +let k5 = new j5.n4(); +assert.strictEqual(k5.y3, '00001'); +assert.strictEqual(k5.j4.l4, 'jack3'); +assert.strictEqual(k5.j4.m4, 12); +let l5 = new j5.o4(); +l5.w4 = 16; +assert.strictEqual(l5.v4, 11); +assert.strictEqual(l5.x4(), 16); diff --git a/arkguard/test/grammar/export_obfuscation/xcommonjs-require_2_expected.txt b/arkguard/test/grammar/export_obfuscation/xcommonjs-require_2_expected.txt index 8a0646dc0d7a1ec4644860379ac1f5267efcfea7..7c876091d7178d9b5640a177880aed8a05a703a2 100644 --- a/arkguard/test/grammar/export_obfuscation/xcommonjs-require_2_expected.txt +++ b/arkguard/test/grammar/export_obfuscation/xcommonjs-require_2_expected.txt @@ -13,7 +13,7 @@ * limitations under the License. */ const assert = require('assert'); -const p5 = require('./xcommonjs-exports_2'); -assert.strictEqual(p5.y4, 20); -assert.strictEqual(p5.z4(), 'Hello, world2!'); -assert.strictEqual(p5.a5.p2, 22); +const m5 = require('./xcommonjs-exports_2'); +assert.strictEqual(m5.y4, 20); +assert.strictEqual(m5.z4(), 'Hello, world2!'); +assert.strictEqual(m5.i5.p2, 22); diff --git a/arkguard/test/grammar/export_obfuscation/y1_export_alias_expected.txt b/arkguard/test/grammar/export_obfuscation/y1_export_alias_expected.txt index a4dbadccb372b7266a37731b946c924d4da8c98c..36caa69aea382bcbaf328eb303806d637e2b0369 100644 --- a/arkguard/test/grammar/export_obfuscation/y1_export_alias_expected.txt +++ b/arkguard/test/grammar/export_obfuscation/y1_export_alias_expected.txt @@ -12,16 +12,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -export function q5() { +export function p5() { return '11'; } -interface s5 { - b5: number; +interface q5 { + n5: number; } -class t5 { - c5: number = 2; +class r5 { + o5: number = 2; } export default function fooOrignal2() { return 22; } -export { s5, t5 as u5 }; +export { q5, r5 as s5 }; diff --git a/arkguard/test/grammar/export_obfuscation/y1_import_alias_expected.txt b/arkguard/test/grammar/export_obfuscation/y1_import_alias_expected.txt index 824205d22e0af4ca185a0aef5e19bb589ea9e493..54ed04ff13e55bc05e43f7339fd45144b4500691 100644 --- a/arkguard/test/grammar/export_obfuscation/y1_import_alias_expected.txt +++ b/arkguard/test/grammar/export_obfuscation/y1_import_alias_expected.txt @@ -13,10 +13,10 @@ * limitations under the License. */ import assert from 'assert'; -export * as y5 from './y1_export_alias'; +export * as w5 from './y1_export_alias'; export { default } from './y1_export_alias'; -import * as v5 from './y1_export_alias'; -let w5 = new v5.u5; -assert(w5.c5 === 2, 'success'); -type x5 = v5.s5; -assert(v5.q5() === '11', 'success'); +import * as t5 from './y1_export_alias'; +let u5 = new t5.s5; +assert(u5.o5 === 2, 'success'); +type v5 = t5.q5; +assert(t5.p5() === '11', 'success'); diff --git a/arkguard/test/grammar/export_obfuscation/y1_import_export_indrect_expected.txt b/arkguard/test/grammar/export_obfuscation/y1_import_export_indrect_expected.txt index f75b38b667a6facb9d295075bbf5de8426cd5826..ef0f5a048c5671f9756bb9157610f853ef5bf027 100644 --- a/arkguard/test/grammar/export_obfuscation/y1_import_export_indrect_expected.txt +++ b/arkguard/test/grammar/export_obfuscation/y1_import_export_indrect_expected.txt @@ -13,11 +13,11 @@ * limitations under the License. */ import assert from 'assert'; -import { default as z5 } from './y1_export_default_value'; -import d4, { y5 } from './y1_import_alias'; -let w5 = new y5.u5; -assert(w5.c5 === 2, 'success'); -type x5 = y5.s5; -assert(y5.q5() === '11', 'success'); +import { default as x5 } from './y1_export_default_value'; +import d4, { w5 } from './y1_import_alias'; +let u5 = new w5.s5; +assert(u5.o5 === 2, 'success'); +type v5 = w5.q5; +assert(w5.p5() === '11', 'success'); assert(d4() === 22, 'success'); -assert(z5 === 5, 'success'); +assert(x5 === 5, 'success'); diff --git a/arkguard/test/grammar/export_obfuscation/y2_export_default_func_expected.txt b/arkguard/test/grammar/export_obfuscation/y2_export_default_func_expected.txt index 34725cb17f68cba80df1d254d4bd8f92d484236f..5349b96aac3e1c36de12b66da119a617022733c7 100644 --- a/arkguard/test/grammar/export_obfuscation/y2_export_default_func_expected.txt +++ b/arkguard/test/grammar/export_obfuscation/y2_export_default_func_expected.txt @@ -12,6 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -export default function fooY2(b6: number, c6: number) { - return b6 * c6; +export default function fooY2(y5: number, z5: number) { + return y5 * z5; } diff --git a/arkguard/test/grammar/export_obfuscation/y2_import_default_expected.txt b/arkguard/test/grammar/export_obfuscation/y2_import_default_expected.txt index f398d07bcfee62f2b59412fb9e379cbe7e2f5b60..a613bc13e0fc1d67116cb0299848a5c83209b8c8 100644 --- a/arkguard/test/grammar/export_obfuscation/y2_import_default_expected.txt +++ b/arkguard/test/grammar/export_obfuscation/y2_import_default_expected.txt @@ -13,7 +13,7 @@ * limitations under the License. */ import assert from 'assert'; -import d6 from './y2_export_default_func'; -import { default as e6 } from './y2_export_default_func'; -assert(d6(2, 3) === 6, 'success'); -assert(e6(3, 4) === 12, 'success'); +import a6 from './y2_export_default_func'; +import { default as b6 } from './y2_export_default_func'; +assert(a6(2, 3) === 6, 'success'); +assert(b6(3, 4) === 12, 'success'); diff --git a/arkguard/test/grammar/export_obfuscation/y3_export_list_default_expected.txt b/arkguard/test/grammar/export_obfuscation/y3_export_list_default_expected.txt index de6505fb306dcad0c7ab3942d8d768a7d2dda4ea..1a96f373a1edf7bee167e0ff5cb34f3a99a1872a 100644 --- a/arkguard/test/grammar/export_obfuscation/y3_export_list_default_expected.txt +++ b/arkguard/test/grammar/export_obfuscation/y3_export_list_default_expected.txt @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -function f6(g6: number, h6: number) { - return g6 / h6; +function c6(d6: number, e6: number) { + return d6 / e6; } -export { f6 as default }; +export { c6 as default }; diff --git a/arkguard/test/grammar/export_obfuscation/y3_import_list_default_expected.txt b/arkguard/test/grammar/export_obfuscation/y3_import_list_default_expected.txt index d592269c3be9007e591b704451bf8ad015a66b4d..57731c6b3c76056cc8c8217957ded00c587a0c67 100644 --- a/arkguard/test/grammar/export_obfuscation/y3_import_list_default_expected.txt +++ b/arkguard/test/grammar/export_obfuscation/y3_import_list_default_expected.txt @@ -13,7 +13,7 @@ * limitations under the License. */ import assert from 'assert'; -import i6 from './y3_export_list_default'; -import { default as j6 } from './y3_export_list_default'; -assert(i6(6, 3) === 2, 'success'); -assert(j6(8, 2) === 4, 'success'); +import f6 from './y3_export_list_default'; +import { default as g6 } from './y3_export_list_default'; +assert(f6(6, 3) === 2, 'success'); +assert(g6(8, 2) === 4, 'success'); diff --git a/arkguard/test/grammar/export_obfuscation/y4_export_as_expected.txt b/arkguard/test/grammar/export_obfuscation/y4_export_as_expected.txt index 340a1573ee14e6f5be09dbd6766f5d588deba2b3..abfbbab90448502b75cfa888925b29a320a77f0f 100644 --- a/arkguard/test/grammar/export_obfuscation/y4_export_as_expected.txt +++ b/arkguard/test/grammar/export_obfuscation/y4_export_as_expected.txt @@ -12,5 +12,5 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -export { default as k6 } from './y1_export_alias'; +export { default as h6 } from './y1_export_alias'; export * as default from './y3_export_list_default';