Files
discord-decomp/sources/modules/rtc/VerifiedKeyStore.tsx
T
2026-07-28 01:06:53 +03:00

136 lines
7.4 KiB
TypeScript

/* Metro module 9259; source: modules/rtc/VerifiedKeyStore.tsx; dependencies: [6, 7, 15, 17, 18, 9260, 21, 566, 694, 2] */
import ClassCallCheck from '../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
import CreateClass from '../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
import PossibleConstructorReturn from '../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
import Module00017 from '../../by-id/module-00017.js'; /* Metro dependency 17 */
import Inherits from '../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
import SnowflakeUtils from '../../utils/SnowflakeUtils.tsx'; /* Metro dependency 21 */
import Flux from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as LibdaveModule from '../../external/discord_common/js/packages/libdave/index.tsx'; /* Metro dependency 9260 */
function _fun72342(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#72342, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9444:6, offset: 0x01d42de5, size: 313 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_8 = {};
const PersistedStore = (Flux).PersistedStore;
let value = _fun72346(PersistedStore);
value.displayName = 'VerifiedKeyStore';
value.persistKey = 'VerifiedKeyStore';
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */,
{SECURE_FRAMES_VERIFIED_KEY_CREATE: SECURE_FRAMES_VERIFIED_KEY_CREATE,
SECURE_FRAMES_VERIFIED_KEY_DELETE: SECURE_FRAMES_VERIFIED_KEY_DELETE,
SECURE_FRAMES_USER_VERIFIED_KEYS_DELETE: SECURE_FRAMES_USER_VERIFIED_KEYS_DELETE});
(FileImportTrackerModule).fileFinishedImporting('modules/rtc/VerifiedKeyStore.tsx');
exports.default = value;
function _isNativeReflectConstruct_72343() { // fn#72343, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9444:148, offset: 0x01d42f1e, size: 98 bytes, params: 1, frame: 18
var Boolean;
var prototype;
var valueOf;
var call;
var Reflect;
var construct;
var closure;
var value;
var error;
try {
Boolean = global.Boolean;
prototype = Boolean.prototype;
valueOf = prototype.valueOf;
call = valueOf.call;
Reflect = global.Reflect;
construct = Reflect.construct;
Boolean = global.Boolean;
closure = function() {
};
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
value = Reflect.apply(call, valueOf, [value]);
var result = !value;
} catch (error) {
}
return (_isNativeReflectConstruct_72343_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _fun72346(a0) { // fn#72346, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9444:356, offset: 0x01d42f80, size: 199 bytes, params: 2, frame: 16
const VerifiedKeyStore2 = VerifiedKeyStore;
Inherits(VerifiedKeyStore2, a0);
return CreateClass(VerifiedKeyStore2, [{key: 'initialize', value: function(a0) {
var r2;
var value = undefined;
r2 = a0 == null ? value : a0.users;
r2 = r2 ?? ({});
env1_8 = r2;
return value;
}}, {key: 'getState', value: value_72349}, {key: 'getKeyTrustedAt', value: value_72350}, {key: 'isKeyVerified',
value: function(a0, a1) {
return this.getKeyTrustedAt(a0, a1) != null;
}}, {key: 'getUserIds', value: value_72352}, {key: 'getUserVerifiedKeys', value: value_72353}]);
function VerifiedKeyStore() { // fn#72347, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9444:368, offset: 0x00c7c82b, size: 113 bytes, params: 1, frame: 20
const value = environment.__proto__;
env1_3(this, VerifiedKeyStore);
const value3 = env1_6(VerifiedKeyStore);
return env1_5(this, _isNativeReflectConstruct_72343() ? global.Reflect.construct(value3, arguments,
env1_6(this).constructor) : value3.apply(this, arguments));
}
function value_72349() { // fn#72349, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9444:748, offset: 0x01d4306c, size: 16 bytes, params: 1, frame: 2
return {users: env1_8};
}
function value_72350(a0, a1) { // fn#72350, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9444:806, offset: 0x01d4307c, size: 65 bytes, params: 3, frame: 13
const value2 = undefined;
const value3 = (LibdaveModule).serializeKey(a1);
const property = env1_8[a0];
return property == null ? value2 : property[value3];
}
function value_72352() { // fn#72352, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9444:994, offset: 0x01d430dc, size: 41 bytes, params: 1, frame: 12
return (SnowflakeUtils).keys(env1_8);
}
function value_72353(a0) { // fn#72353, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9444:1063, offset: 0x00ff623a, size: 16 bytes, params: 2, frame: 2
return env1_8[a0];
}
}
function SECURE_FRAMES_VERIFIED_KEY_CREATE({userId, key}) { // fn#72354, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9444:1236, offset: 0x01d43105, size: 125 bytes, params: 2, frame: 14
const r3 = env0_8[userId] ?? ({});
env0_8[userId] = r3;
const Uint8Array = global.Uint8Array;
const uint8Array = new Uint8Array(key);
let value = LibdaveModule;
value = value.serializeKey(uint8Array);
const Date = global.Date;
r3[value] = Date.now();
}
function SECURE_FRAMES_VERIFIED_KEY_DELETE({userId, serializedKey}) { // fn#72355, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9444:1486, offset: 0x01d43182, size: 88 bytes, params: 2, frame: 14
var r1;
const property = env0_8[userId];
if (property == null) {
return false;
}
const value2 = delete property[serializedKey];
const Object = global.Object;
if (Object.keys(property).length !== 0) {
r1 = false;
} else {
delete env0_8[userId];
r1 = true;
}
return value2 || r1;
}
function SECURE_FRAMES_USER_VERIFIED_KEYS_DELETE({userId}) { // fn#72356, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9444:1712, offset: 0x01d431da, size: 38 bytes, params: 2, frame: 4
return env0_8[userId] != null && delete env0_8[userId];
}
}
global.__d(_fun72342, 9259, [6, 7, 15, 17, 18, 9260, 21, 566, 694,
2]) /* metro module 9259, dependencies: [6, 7, 15, 17, 18, 9260, 21, 566, 694, 2] */;