1015 lines
39 KiB
TypeScript
1015 lines
39 KiB
TypeScript
/* Metro module 4267; source: stores/DetectableGameStore.tsx; dependencies: [6, 7, 15, 17, 18, 4235, 661, 4238, 672, 4268, 587, 477, 4269, 21, 1360, 1909, 683, 3829, 566, 694, 2] */
|
|
function _fun36063(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#36063, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4439:6, offset: 0x01081d09, size: 924 bytes, params: 8, frame: 23
|
|
var r9;
|
|
var value4;
|
|
var value13;
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_36069 = function(a0, a1) {
|
|
var r0;
|
|
var r1;
|
|
var r2;
|
|
var value3;
|
|
var length;
|
|
var value5;
|
|
var value = undefined;
|
|
var value2 = value == null;
|
|
reducibleJoin2: while (true) {
|
|
if (value2) {
|
|
r0 = value2;
|
|
break reducibleJoin2;
|
|
}
|
|
value3 = value > a0.length;
|
|
r0 = value3;
|
|
break reducibleJoin2;
|
|
}
|
|
reducibleJoin4: while (true) {
|
|
if (r0) {
|
|
length = a0.length;
|
|
r1 = length;
|
|
break reducibleJoin4;
|
|
}
|
|
r1 = value;
|
|
break reducibleJoin4;
|
|
}
|
|
value = (0, global.Array)(r1);
|
|
var value4 = 0;
|
|
if (value4 < r1) {
|
|
r2 = value4;
|
|
reducibleLoop5: while (true) {
|
|
value[r2] = a0[r2];
|
|
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
|
if (value5 < r1) {
|
|
r2 = value5;
|
|
continue reducibleLoop5;
|
|
}
|
|
break reducibleLoop5;
|
|
}
|
|
}
|
|
return value;
|
|
};
|
|
const closure = gameFromServer;
|
|
let Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_4 = importDefault(7) /* metro dependency 7 */;
|
|
const env0_5 = importDefault(15) /* metro dependency 15 */;
|
|
const env0_6 = importDefault(17) /* metro dependency 17 */;
|
|
const env0_7 = importDefault(18) /* metro dependency 18 */;
|
|
const applicationRecord = importDefault(4235) /* metro dependency 4235: ApplicationRecord */;
|
|
const env0_9 = (require(4235) /* metro dependency 4235: ApplicationRecord */).createExecutable;
|
|
const env0_10 = (require(661) /* metro dependency 661: Constants */).AnalyticEvents;
|
|
const env0_11 = (require(4238) /* metro dependency 4238: ApplicationConstants */).ApplicationTypes;
|
|
let Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
|
const env0_12 = Millis.DAY;
|
|
let value = importDefault(4268) /* metro dependency 4268: CachedEntriesMap */;
|
|
value = new value();
|
|
Object = global.Object;
|
|
value = null;
|
|
Object = global.Object;
|
|
const Storage = (require(587) /* metro dependency 587: Storage */).Storage;
|
|
if (value == Storage.get('GameStoreReportedGames')) {
|
|
value4 = global.Object.create(value);
|
|
}
|
|
const env0_24 = [];
|
|
const env0_25 = [];
|
|
const Map = global.Map;
|
|
const map = new Map();
|
|
Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
|
const env0_27 = Millis.HOUR;
|
|
const Set = global.Set;
|
|
const set = new Set();
|
|
if (!(require(477) /* metro dependency 477: PlatformUtils */).isWindows()) {
|
|
if (!(require(477) /* metro dependency 477: PlatformUtils */).isMac()) {
|
|
value13 = require(477) /* metro dependency 477: PlatformUtils */;
|
|
r9 = value13.isLinux() ? 'linux' : value;
|
|
}
|
|
}
|
|
const PersistedStore = (importDefault(566) /* metro dependency 566: flux */).PersistedStore;
|
|
value = _fun36074(PersistedStore);
|
|
value.displayName = 'GameStore';
|
|
value.persistKey = 'GameStore';
|
|
value.migrations = [function(a0) {
|
|
var r2;
|
|
var r0;
|
|
var object;
|
|
if (a0 != null) {
|
|
object = {detectableGamesEtag: a0.detectableGamesEtag};
|
|
r2 = a0.detectableGames?.map(_fun36113);
|
|
r2 = r2 ?? [];
|
|
object.detectableGames = r2;
|
|
r0 = object;
|
|
} else {
|
|
r0 = {detectableGamesEtag: '', detectableGames: []};
|
|
}
|
|
return r0;
|
|
}, function(a0) {
|
|
return require(dependencyMap[11]).isDesktop() ? a0 : {detectableGamesEtag: '', detectableGames: []};
|
|
}, function() {
|
|
return {detectableGamesEtag: '', detectableGames: []};
|
|
}, function(a0) {
|
|
var r5;
|
|
var object = {};
|
|
copyDataProperties(object, a0, r5);
|
|
object['blocklistEtag'] = a0.blocklistEtag ?? '';
|
|
object['blocklistExecutables'] = a0.blocklistExecutables ?? [];
|
|
object['blocklistPatterns'] = a0.blocklistPatterns ?? [];
|
|
return object;
|
|
}];
|
|
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */,
|
|
{OVERLAY_INITIALIZE: OVERLAY_INITIALIZE_36117, GAMES_DATABASE_FETCH: function() {
|
|
env0_18 = true;
|
|
}, GAMES_DATABASE_FETCH_FAIL: function() {
|
|
env0_18 = false;
|
|
env0_20 = true;
|
|
}, GAMES_DATABASE_UPDATE: GAMES_DATABASE_UPDATE, GAMES_BLOCKLIST_FETCH: function() {
|
|
env0_22 = true;
|
|
}, GAMES_BLOCKLIST_FETCH_FAIL: function() {
|
|
env0_22 = false;
|
|
}, GAMES_BLOCKLIST_UPDATE: GAMES_BLOCKLIST_UPDATE});
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('stores/DetectableGameStore.tsx');
|
|
exports.default = value;
|
|
exports.gameFromServer = closure;
|
|
}
|
|
|
|
function _isNativeReflectConstruct_36064() { // fn#36064, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4439:248, offset: 0x010820a5, size: 94 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_36064_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _createForOfIteratorHelperLoose_36067(a0, a1) { // fn#36067, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4439:441, offset: 0x01082103, size: 370 bytes, params: 3, frame: 20
|
|
var r6;
|
|
var r9;
|
|
var r5;
|
|
var value3;
|
|
var regexp;
|
|
const env0_0 = a0;
|
|
const Symbol = global.Symbol;
|
|
let value = typeof Symbol !== 'undefined';
|
|
let r1 = value && a0[global.Symbol.iterator];
|
|
r1 = !r1 ? a0['@@iterator'] : r1;
|
|
if (r1) {
|
|
value = r1.call(a0);
|
|
return value.next.bind(value);
|
|
}
|
|
const Array = global.Array;
|
|
if (Array.isArray(a0)) {
|
|
if (r1) {
|
|
}
|
|
return _fun36068;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_36069(a0, value);
|
|
r5 = value;
|
|
} else {
|
|
value3 = ({}).toString.call(a0).slice(8, -1);
|
|
r6 = value3 === 'Object' && a0.constructor;
|
|
r9 = r6 ? a0.constructor.name : value3;
|
|
if (r9 === 'Map') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Set') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Arguments') {
|
|
value = _arrayLikeToArray_36069(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_36069(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun36068;
|
|
}
|
|
const TypeError = global.TypeError;
|
|
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
|
|
}
|
|
|
|
function gameFromServer({id, name, executables, overlay, overlay_warn, overlay_compatibility_hook, hook, aliases, overlay_methods, themes, icon_hash, third_party_skus, cover_image_hash, content_classification}) { // fn#36070, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4439:1708, offset: 0x01082275, size: 298 bytes, params: 2, frame: 15
|
|
const object2 = {};
|
|
object2.id = id;
|
|
object2.name = name;
|
|
const r6 = executables ?? [];
|
|
object2.executables = r6.map(createExecutable);
|
|
object2.overlay = overlay != null && overlay;
|
|
object2.overlayWarn = overlay_warn != null && overlay_warn;
|
|
object2.overlayCompatibilityHook = overlay_compatibility_hook != null && overlay_compatibility_hook;
|
|
object2.hook = hook == null || hook;
|
|
object2.aliases = aliases ?? [];
|
|
object2.supportsOutOfProcessOverlay = ApplicationRecord.supportsOutOfProcessOverlay(overlay_methods);
|
|
object2.themes = themes ?? [];
|
|
object2.icon = icon_hash ?? undefined;
|
|
object2.thirdPartySkus = third_party_skus ?? [];
|
|
object2.cover_image_hash = cover_image_hash ?? undefined;
|
|
object2.content_classification = content_classification ?? undefined;
|
|
return object2;
|
|
}
|
|
|
|
function convertGameRecordToGame({id, name, executables, overlayWarn, overlayCompatibilityHook, overlay, hook, aliases, supportsOutOfProcessOverlay, themes, icon, thirdPartySkus, cover_image_hash, content_classification}) { // fn#36071, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4439:2350, offset: 0x0108239f, size: 197 bytes, params: 2, frame: 7
|
|
return {id: id, name: name, executables: executables, overlayWarn: overlayWarn,
|
|
overlayCompatibilityHook: overlayCompatibilityHook, overlay: overlay, hook: hook, aliases: aliases,
|
|
supportsOutOfProcessOverlay: supportsOutOfProcessOverlay, themes: themes ?? [], icon: icon,
|
|
thirdPartySkus: thirdPartySkus ?? [], cover_image_hash: cover_image_hash ?? undefined,
|
|
content_classification: content_classification ?? undefined};
|
|
}
|
|
|
|
function addGameIdToNameCache(a0, a1) { // fn#36072, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4439:2848, offset: 0x01082464, size: 57 bytes, params: 3, frame: 12
|
|
if (env0_14[a1] == null) {
|
|
env0_14[a1] = [];
|
|
}
|
|
env0_14[a1].push(a0);
|
|
}
|
|
|
|
function addDetectableGame(a0) { // fn#36073, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4439:2918, offset: 0x0108249d, size: 275 bytes, params: 2, frame: 19
|
|
var r4;
|
|
var r3;
|
|
var r2;
|
|
var value3;
|
|
var value6;
|
|
var value7;
|
|
var executables;
|
|
var value8;
|
|
var value9;
|
|
var value10;
|
|
let value = a0;
|
|
const DetectableGameRecord = (require(4269) /* metro dependency 4269: GameDetectionTypes */).DetectableGameRecord;
|
|
reducibleJoin2: while (true) {
|
|
if (value instanceof DetectableGameRecord) {
|
|
value3 = convertGameRecordToGame(value);
|
|
r4 = value3;
|
|
break reducibleJoin2;
|
|
}
|
|
r4 = value;
|
|
break reducibleJoin2;
|
|
}
|
|
let binding = env0_13;
|
|
const set = binding.set;
|
|
let id = value.id;
|
|
Reflect.apply(set, binding, [id, r4]);
|
|
let addGameIdToNameCacheBinding = addGameIdToNameCache;
|
|
id = r4.id;
|
|
let name = r4.name;
|
|
let toLowerCase = name.toLowerCase;
|
|
addGameIdToNameCacheBinding(id, Reflect.apply(toLowerCase, name, []));
|
|
const value4 = _createForOfIteratorHelperLoose_36067(value.aliases);
|
|
const value5 = value4();
|
|
let done = value5.done;
|
|
if (!done) {
|
|
r3 = value5;
|
|
reducibleLoop3: while (true) {
|
|
value6 = r3.value;
|
|
addGameIdToNameCacheBinding = addGameIdToNameCache;
|
|
id = r4.id;
|
|
toLowerCase = value6.toLowerCase;
|
|
addGameIdToNameCacheBinding(id, Reflect.apply(toLowerCase, value6, []));
|
|
value7 = value4();
|
|
done = value7.done;
|
|
if (done) {
|
|
break reducibleLoop3;
|
|
}
|
|
r3 = value7;
|
|
continue reducibleLoop3;
|
|
}
|
|
}
|
|
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
|
|
reducibleJoin7: while (true) {
|
|
if (!platformUtilsModule.isDesktop()) {
|
|
break reducibleJoin7;
|
|
}
|
|
_createForOfIteratorHelperLoose_36067Binding = _createForOfIteratorHelperLoose_36067;
|
|
executables = value.executables;
|
|
value = _createForOfIteratorHelperLoose_36067Binding(executables);
|
|
value8 = value();
|
|
done = value8.done;
|
|
if (done) {
|
|
break reducibleJoin7;
|
|
}
|
|
r2 = value8;
|
|
reducibleLoop6: while (true) {
|
|
value9 = r2.value;
|
|
binding = env0_15;
|
|
name = value9.name;
|
|
id = r4.id;
|
|
binding[name] = id;
|
|
value10 = value();
|
|
done = value10.done;
|
|
if (done) {
|
|
break reducibleJoin7;
|
|
}
|
|
r2 = value10;
|
|
continue reducibleLoop6;
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun36074(a0) { // fn#36074, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4439:3353, offset: 0x010825b0, size: 621 bytes, params: 2, frame: 16
|
|
const closure = DetectableGameStore;
|
|
env0_7(closure, a0);
|
|
return env0_4(closure, [{key: 'initialize', value: value_36076}, {key: 'getState', value: value_36079},
|
|
{key: 'games', get: get_36081}, {key: 'getDetectableGame', value: value_36082}, {key: 'searchGamesByName',
|
|
value: value_36083}, {key: 'findGame', value: value_36084}, {key: 'getOfficialGame', value: function(a0) {
|
|
var r3;
|
|
var value3;
|
|
var value4;
|
|
var value = null;
|
|
if (value == a0) {
|
|
return value;
|
|
}
|
|
var property = a0.type;
|
|
if (property === ApplicationTypes.GAME) {
|
|
r3 = a0.id;
|
|
} else {
|
|
property = a0.linkedGames;
|
|
value3 = undefined;
|
|
if (value == property) {
|
|
r3 = value3;
|
|
} else {
|
|
value4 = property.find(_fun36088);
|
|
r3 = value == value4 ? value3 : value4.id;
|
|
}
|
|
}
|
|
return value == r3 ? value : this.getDetectableGame(r3);
|
|
}}, {key: 'getGameByApplication', value: value_36089}, {key: 'isGameInDatabase', value: function(a0) {
|
|
var value = this.findGame(a0);
|
|
value = value != null;
|
|
return value || a0.nativeProcessObserverId !== undefined && !(2147483648 & a0.nativeProcessObserverId);
|
|
}}, {key: 'fetching', get: get_36092}, {key: 'detectableGamesEtag', get: get_36093}, {key: 'blocklistEtag',
|
|
get: get_36094}, {key: 'lastFetched', get: get_36095}, {key: 'hasAttemptedFetch', get: get_36096},
|
|
{key: 'detectableGamesTtl', get: function() {
|
|
return DAY;
|
|
}}, {key: 'canFetchDetectableGames', value: value_36098}, {key: 'canFetchExecutableBlocklist', value: value_36099},
|
|
{key: 'getGameByExecutable', value: value_36100}, {key: 'shouldBlock', value: value_36101},
|
|
{key: 'getBlockReason', value: value_36105}, {key: 'maybeTrackApplicationLookupFallthrough',
|
|
value: value_36108}, {key: 'maybeTrackBlock', value: value_36109}, {key: 'shouldReport', value: value_36110},
|
|
{key: 'markGameReported', value: value_36111}]);
|
|
}
|
|
|
|
function _fun36112(a0) { // fn#36112, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4439:8834, offset: 0x010833d5, size: 94 bytes, params: 2, frame: 15
|
|
var r2;
|
|
var r0;
|
|
var object2;
|
|
if (a0 != null) {
|
|
object2 = {};
|
|
object2.detectableGamesEtag = a0.detectableGamesEtag;
|
|
r2 = a0.detectableGames?.map(_fun36113);
|
|
r2 = r2 ?? [];
|
|
object2.detectableGames = r2;
|
|
r0 = object2;
|
|
} else {
|
|
r0 = {detectableGamesEtag: '', detectableGames: []};
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function OVERLAY_INITIALIZE_36117({detectableApplications}) { // fn#36117, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4439:9440, offset: 0x0108352a, size: 126 bytes, params: 2, frame: 14
|
|
var r2;
|
|
var addDetectableGameBinding;
|
|
var value4;
|
|
var value5;
|
|
env0_13.clear();
|
|
let Object = global.Object;
|
|
Object = global.Object;
|
|
const value2 = _createForOfIteratorHelperLoose_36067(detectableApplications);
|
|
const value3 = value2();
|
|
let done = value3.done;
|
|
if (!done) {
|
|
for (r2 = value3; true; r2 = value5) {
|
|
addDetectableGameBinding = addDetectableGame;
|
|
value4 = r2.value;
|
|
addDetectableGameBinding(value4);
|
|
value5 = value2();
|
|
done = value5.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function GAMES_DATABASE_UPDATE({games, etag}) { // fn#36120, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4439:9807, offset: 0x010835bb, size: 198 bytes, params: 2, frame: 15
|
|
var r0;
|
|
var r3;
|
|
var binding;
|
|
var clear;
|
|
var Object;
|
|
var create;
|
|
var addDetectableGameBinding;
|
|
var gameFromServerBinding;
|
|
var value4;
|
|
var value5;
|
|
let value = etag != null;
|
|
reducibleJoin2: while (true) {
|
|
if (value) {
|
|
value = environment;
|
|
value = env0_17 !== etag;
|
|
r0 = value;
|
|
break reducibleJoin2;
|
|
}
|
|
r0 = value;
|
|
break reducibleJoin2;
|
|
}
|
|
reducibleJoin4: while (true) {
|
|
if (r0) {
|
|
value = environment;
|
|
binding = env0_13;
|
|
clear = binding.clear;
|
|
Reflect.apply(clear, binding, []);
|
|
Object = global.Object;
|
|
create = Object.create;
|
|
env0_14 = Reflect.apply(create, Object, [null]);
|
|
Object = global.Object;
|
|
create = Object.create;
|
|
env0_15 = Reflect.apply(create, Object, [null]);
|
|
env0_17 = etag;
|
|
break reducibleJoin4;
|
|
}
|
|
break reducibleJoin4;
|
|
}
|
|
const value2 = _createForOfIteratorHelperLoose_36067(games);
|
|
const value3 = value2();
|
|
let done = value3.done;
|
|
if (!done) {
|
|
r3 = value3;
|
|
reducibleLoop5: while (true) {
|
|
addDetectableGameBinding = addDetectableGame;
|
|
gameFromServerBinding = gameFromServer;
|
|
value4 = r3.value;
|
|
addDetectableGameBinding(gameFromServerBinding(value4));
|
|
value5 = value2();
|
|
done = value5.done;
|
|
if (done) {
|
|
break reducibleLoop5;
|
|
}
|
|
r3 = value5;
|
|
continue reducibleLoop5;
|
|
}
|
|
}
|
|
const Date = global.Date;
|
|
env0_19 = Date.now();
|
|
}
|
|
|
|
function GAMES_BLOCKLIST_UPDATE({executables, patterns, etag}) { // fn#36123, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4439:10235, offset: 0x0108369b, size: 125 bytes, params: 2, frame: 14
|
|
if (etag != null && env0_23 !== etag) {
|
|
env0_24 = executables.map(function(a0) {
|
|
return a0.toLowerCase();
|
|
});
|
|
env0_25 = patterns.map(_fun36125);
|
|
}
|
|
const Date = global.Date;
|
|
env0_21 = Date.now();
|
|
}
|
|
|
|
function value_36076(a0) { // fn#36076, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4439:3678, offset: 0x0108288e, size: 150 bytes, params: 2, frame: 14
|
|
var environment;
|
|
var detectableGamesEtag;
|
|
var value;
|
|
var blocklistEtag;
|
|
var blocklistExecutables;
|
|
var value2;
|
|
var detectableGames;
|
|
if (a0 != null) {
|
|
detectableGamesEtag = a0.detectableGamesEtag;
|
|
if (detectableGamesEtag != null) {
|
|
detectableGamesEtag = a0.detectableGamesEtag;
|
|
value = environment.__proto__;
|
|
}
|
|
blocklistEtag = a0.blocklistEtag;
|
|
if (blocklistEtag != null) {
|
|
blocklistEtag = a0.blocklistEtag;
|
|
value = environment.__proto__;
|
|
}
|
|
blocklistExecutables = a0.blocklistExecutables;
|
|
if (blocklistExecutables != null) {
|
|
blocklistExecutables = a0.blocklistExecutables;
|
|
value = environment.__proto__;
|
|
}
|
|
if (a0.blocklistPatterns != null) {
|
|
value = a0.blocklistPatterns.map(function(a0) {
|
|
var RegExp = global.RegExp;
|
|
var value = Object.create(RegExp.prototype, {constructor: {value: RegExp}});
|
|
var value2 = new RegExp(a0, 'i');
|
|
return value2 instanceof Object ? value2 : value;
|
|
});
|
|
value2 = environment.__proto__;
|
|
}
|
|
detectableGames = a0.detectableGames;
|
|
if (detectableGames != null) {
|
|
detectableGames.forEach(_fun36078);
|
|
}
|
|
}
|
|
}
|
|
|
|
function value_36079() { // fn#36079, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4439:4031, offset: 0x0108295c, size: 160 bytes, params: 1, frame: 13
|
|
var r0;
|
|
var object2;
|
|
var binding;
|
|
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
|
|
if (platformUtilsModule.isDesktop()) {
|
|
object2 = {detectableGamesEtag: env1_17};
|
|
binding = env1_13;
|
|
object2.detectableGames = binding.values();
|
|
object2.blocklistEtag = env1_23;
|
|
object2.blocklistExecutables = env1_24;
|
|
binding = env1_25;
|
|
object2.blocklistPatterns = binding.map(function(a0) {
|
|
return a0.source;
|
|
});
|
|
r0 = object2;
|
|
} else {
|
|
r0 = {'detectableGamesEtag': '', 'detectableGames': null, 'blocklistEtag': '', detectableGames: [],
|
|
blocklistExecutables: [], blocklistPatterns: []};
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function get_36081() { // fn#36081, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4439:4325, offset: 0x010829fc, size: 18 bytes, params: 1, frame: 9
|
|
return env1_13.values();
|
|
}
|
|
|
|
function value_36082(a0) { // fn#36082, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4439:4387, offset: 0x01082a0e, size: 55 bytes, params: 2, frame: 13
|
|
let value = environment.__proto__;
|
|
const binding = env1_13;
|
|
const get = binding.get;
|
|
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
return Reflect.apply(get, binding, [value.cast(a0)]);
|
|
}
|
|
|
|
function value_36083(a0) { // fn#36083, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4439:4463, offset: 0x01082a45, size: 81 bytes, params: 2, frame: 14
|
|
if (a0 == null) {
|
|
return [];
|
|
}
|
|
const value = a0.toLowerCase();
|
|
const Object = global.Object;
|
|
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
return hasOwnProperty.call(env1_14, value) ? env1_14[value] : [];
|
|
}
|
|
|
|
function value_36084(a0, a1) { // fn#36084, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4439:4598, offset: 0x01082a96, size: 354 bytes, params: 3, frame: 21
|
|
var environment;
|
|
var r7;
|
|
var closure;
|
|
var _createForOfIteratorHelperLoose_36067Binding;
|
|
var value2;
|
|
var done;
|
|
var value3;
|
|
var value4;
|
|
var value5;
|
|
var filter;
|
|
var value6;
|
|
const isNotNullish = (require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish;
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
let value = this.getDetectableGame(a0.id);
|
|
if (value != null) {
|
|
return value;
|
|
}
|
|
if (a0.name != null) {
|
|
closure = value_36084_loop;
|
|
value = environment.__proto__;
|
|
_createForOfIteratorHelperLoose_36067Binding = _createForOfIteratorHelperLoose_36067;
|
|
value = this.searchGamesByName(a0.name);
|
|
value = _createForOfIteratorHelperLoose_36067Binding(value);
|
|
value2 = value();
|
|
done = value2.done;
|
|
if (!done) {
|
|
r7 = value2;
|
|
reducibleLoop3: while (true) {
|
|
value3 = r7.value;
|
|
var env0_4 = value3;
|
|
value4 = closure();
|
|
if (value4 !== 0) {
|
|
reducibleJoin5: while (true) {
|
|
if (value4) {
|
|
return value4.v;
|
|
}
|
|
break reducibleJoin5;
|
|
}
|
|
}
|
|
value5 = value();
|
|
done = value5.done;
|
|
if (done) {
|
|
break reducibleLoop3;
|
|
}
|
|
r7 = value5;
|
|
continue reducibleLoop3;
|
|
}
|
|
}
|
|
}
|
|
let exePath = a0.exePath;
|
|
if (exePath != null) {
|
|
exePath = a0.exePath;
|
|
value = exePath.split('/');
|
|
filter = value.filter;
|
|
value6 = environment.__proto__;
|
|
value = Reflect.apply(filter, value, [isNotNullish]);
|
|
value = value.pop();
|
|
value = this.getGameByExecutable(value);
|
|
if (value != null) {
|
|
return value;
|
|
}
|
|
exePath = a0.exePath;
|
|
value = exePath.split('/');
|
|
value = value.filter(isNotNullish);
|
|
value = value.slice(-2);
|
|
value = value.join('/');
|
|
value = this.getGameByExecutable(value);
|
|
reducibleJoin10: while (true) {
|
|
if (value != null) {
|
|
return value;
|
|
}
|
|
break reducibleJoin10;
|
|
}
|
|
}
|
|
return env0_2;
|
|
}
|
|
|
|
function value_36087(a0) { // fn#36087, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4439:5387, offset: 0x01082cc7, size: 112 bytes, params: 2, frame: 16
|
|
var id;
|
|
var linkedGames;
|
|
var value3;
|
|
var value4;
|
|
const value = null;
|
|
if (value == a0) {
|
|
return value;
|
|
}
|
|
const type = a0.type;
|
|
const GAME = ApplicationTypes.GAME;
|
|
if (type === GAME) {
|
|
id = a0.id;
|
|
} else {
|
|
linkedGames = a0.linkedGames;
|
|
value3 = undefined;
|
|
if (value == linkedGames) {
|
|
id = value3;
|
|
} else {
|
|
value4 = linkedGames.find(function({type}) {
|
|
return type === require(dependencyMap[15]).GameLinkTypes.OFFICIAL;
|
|
});
|
|
id = value == value4 ? value3 : value4.id;
|
|
}
|
|
}
|
|
return value == id ? value : this.getDetectableGame(id);
|
|
}
|
|
|
|
function value_36089(a0) { // fn#36089, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4439:5655, offset: 0x01082d6a, size: 249 bytes, params: 2, frame: 24
|
|
var environment;
|
|
var r3;
|
|
var r7;
|
|
var r8;
|
|
var r1;
|
|
var value3;
|
|
var value4;
|
|
var value5;
|
|
var done;
|
|
var value7;
|
|
var value8;
|
|
var value9;
|
|
var property;
|
|
let getDetectableGame = this.getDetectableGame;
|
|
let id = a0.id;
|
|
let value = Reflect.apply(getDetectableGame, this, [id]);
|
|
if (value != null) {
|
|
return value;
|
|
}
|
|
const linkedGames = a0.linkedGames;
|
|
value = undefined;
|
|
const value2 = 'none';
|
|
if (linkedGames != null) {
|
|
value3 = environment.__proto__;
|
|
value4 = _createForOfIteratorHelperLoose_36067(a0.linkedGames);
|
|
value5 = value4();
|
|
done = value5.done;
|
|
if (done) {
|
|
r7 = value2;
|
|
r8 = value;
|
|
} else {
|
|
r3 = value5;
|
|
while (true) {
|
|
value7 = r3.value;
|
|
getDetectableGame = this.getDetectableGame;
|
|
id = value7.id;
|
|
value8 = Reflect.apply(getDetectableGame, this, [id]);
|
|
if (value8 != null) {
|
|
r7 = 'linked_game';
|
|
r8 = value8;
|
|
break;
|
|
}
|
|
value9 = value4();
|
|
done = value9.done;
|
|
if (done) {
|
|
r7 = value2;
|
|
r8 = value;
|
|
break;
|
|
}
|
|
r3 = value9;
|
|
continue;
|
|
}
|
|
}
|
|
} else {
|
|
r7 = value2;
|
|
r8 = value;
|
|
}
|
|
if (r8 != null) {
|
|
r1 = r8;
|
|
r3 = r7;
|
|
} else {
|
|
value = this.searchGamesByName(a0.name);
|
|
value = value.map(_fun36090);
|
|
value = value.reverse();
|
|
property = value[0];
|
|
if (property == null) {
|
|
r1 = r8;
|
|
r3 = r7;
|
|
} else {
|
|
value = 'name';
|
|
r1 = property;
|
|
r3 = value;
|
|
}
|
|
}
|
|
this.maybeTrackApplicationLookupFallthrough(a0, r3, r1);
|
|
return r1;
|
|
}
|
|
|
|
function get_36092() { // fn#36092, offset: 0x01082ebf, size: 15 bytes, params: 1, frame: 2
|
|
return env1_18 === true;
|
|
}
|
|
|
|
function value_36098() { // fn#36098, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4439:6623, offset: 0x01082ece, size: 67 bytes, params: 1, frame: 12
|
|
const value = environment.__proto__;
|
|
return env1_18 !== true && (env1_19 == null || global.Date.now() >= env1_19 + DAY);
|
|
}
|
|
|
|
function value_36099() { // fn#36099, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4439:6742, offset: 0x01082f11, size: 64 bytes, params: 1, frame: 12
|
|
const value = environment.__proto__;
|
|
return !env1_22 && (env1_21 == null || global.Date.now() >= env1_21 + DAY);
|
|
}
|
|
|
|
function value_36100(a0) { // fn#36100, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4439:6853, offset: 0x01082f51, size: 40 bytes, params: 2, frame: 11
|
|
var value;
|
|
if (a0 != null) {
|
|
value = environment.__proto__;
|
|
return this.getDetectableGame(env1_15[a0]);
|
|
}
|
|
}
|
|
|
|
function value_36101(a0) { // fn#36101, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4439:6969, offset: 0x01082f79, size: 242 bytes, params: 2, frame: 18
|
|
var environment;
|
|
var r0;
|
|
var value;
|
|
var binding;
|
|
var value2;
|
|
var value3;
|
|
const env0_0 = a0;
|
|
if (a0.exePath == null) {
|
|
return false;
|
|
}
|
|
if (a0.exePath === '') {
|
|
return false;
|
|
}
|
|
const env0_1 = a0.exePath.toLowerCase();
|
|
if (a0.id == null) {
|
|
value = environment.__proto__;
|
|
binding = env1_24;
|
|
value2 = binding.find(_fun36103);
|
|
if (value2 != null) {
|
|
this.maybeTrackBlock(a0, 'explicit_list', value2);
|
|
return true;
|
|
}
|
|
binding = env1_25;
|
|
value = binding.find(_fun36104);
|
|
value3 = value != null;
|
|
} else {
|
|
value = environment.__proto__;
|
|
if (env1_29 == null) {
|
|
value = environment.__proto__;
|
|
binding = env1_24;
|
|
value2 = binding.find(_fun36103);
|
|
if (value2 != null) {
|
|
this.maybeTrackBlock(a0, 'explicit_list', value2);
|
|
return true;
|
|
}
|
|
binding = env1_25;
|
|
value = binding.find(_fun36104);
|
|
value3 = value != null;
|
|
if (value3) {
|
|
this.maybeTrackBlock(a0, 'pattern_match', value.source);
|
|
value = true;
|
|
r0 = value;
|
|
} else {
|
|
r0 = value3;
|
|
}
|
|
return r0;
|
|
}
|
|
value = this.getDetectableGame(a0.id);
|
|
if (value == null) {
|
|
value = environment.__proto__;
|
|
binding = env1_24;
|
|
value2 = binding.find(_fun36103);
|
|
if (value2 != null) {
|
|
this.maybeTrackBlock(a0, 'explicit_list', value2);
|
|
return true;
|
|
}
|
|
binding = env1_25;
|
|
value = binding.find(_fun36104);
|
|
value3 = value != null;
|
|
if (value3) {
|
|
this.maybeTrackBlock(a0, 'pattern_match', value.source);
|
|
value = true;
|
|
r0 = value;
|
|
} else {
|
|
r0 = value3;
|
|
}
|
|
return r0;
|
|
}
|
|
var executables = value.executables;
|
|
if (executables.some(_fun36102)) {
|
|
return false;
|
|
}
|
|
value = environment.__proto__;
|
|
value2 = env1_24.find(_fun36103);
|
|
if (value2 != null) {
|
|
this.maybeTrackBlock(a0, 'explicit_list', value2);
|
|
return true;
|
|
}
|
|
value3 = env1_25.find(_fun36104) != null;
|
|
}
|
|
if (value3) {
|
|
this.maybeTrackBlock(a0, 'pattern_match', value.source);
|
|
value = true;
|
|
r0 = value;
|
|
} else {
|
|
r0 = value3;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function value_36105(a0) { // fn#36105, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4439:7448, offset: 0x010830c1, size: 152 bytes, params: 2, frame: 14
|
|
const env0_0 = a0;
|
|
const exePath = a0.exePath;
|
|
const value = null;
|
|
if (value == exePath) {
|
|
return value;
|
|
}
|
|
if (a0.exePath === '') {
|
|
return value;
|
|
}
|
|
const env0_1 = a0.exePath.toLowerCase();
|
|
const value3 = env1_24.find(_fun36106);
|
|
if (value != value3) {
|
|
return {matchedExe: value3, matchedPattern: value};
|
|
}
|
|
const value4 = env1_25.find(_fun36107);
|
|
return value != value4 ? {matchedExe: value, matchedPattern: value4.source} : value;
|
|
}
|
|
|
|
function value_36108(a0, a1, a2) { // fn#36108, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4439:7786, offset: 0x01083159, size: 202 bytes, params: 4, frame: 19
|
|
var r7;
|
|
var name;
|
|
var value2;
|
|
var defaultImport;
|
|
var track;
|
|
var GAME_APPLICATION_LOOKUP_FALLTHROUGH;
|
|
var object2;
|
|
let id = a0.id;
|
|
let value = environment.__proto__;
|
|
const binding = env1_28;
|
|
if (!binding.has(id)) {
|
|
env1_28.add(id);
|
|
value2 = undefined;
|
|
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
track = defaultImport.track;
|
|
GAME_APPLICATION_LOOKUP_FALLTHROUGH = AnalyticEvents.GAME_APPLICATION_LOOKUP_FALLTHROUGH;
|
|
object2 = {application_id: id};
|
|
name = a0.name;
|
|
value = null;
|
|
r7 = value != name ? name : value;
|
|
object2.application_name = r7;
|
|
object2.match_type = a1;
|
|
id = value == a2 ? value2 : a2.id;
|
|
r7 = value != id ? id : value;
|
|
object2.matched_game_id = r7;
|
|
name = value == a2 ? value2 : a2.name;
|
|
object2.matched_game_name = value != name ? name : value;
|
|
Reflect.apply(track, defaultImport, [GAME_APPLICATION_LOOKUP_FALLTHROUGH, object2]);
|
|
}
|
|
}
|
|
|
|
function value_36109(a0, a1, a2) { // fn#36109, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4439:8147, offset: 0x01083223, size: 227 bytes, params: 4, frame: 17
|
|
var defaultImport;
|
|
let value = a0.exePath.split(RegExp('[/\\\\]', ''));
|
|
value = value.pop();
|
|
const r4 = value ?? 'unknown';
|
|
value = environment.__proto__;
|
|
const value3 = env1_26.get(r4);
|
|
const Date = global.Date;
|
|
const value4 = Date.now();
|
|
if (value3 == null || value4 - value3 >= HOUR) {
|
|
env1_26.set(r4, value4);
|
|
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
defaultImport.track(AnalyticEvents.GAME_BLOCKLIST_TRIGGERED, {block_type: a1, matched_entry: a2,
|
|
game_name: a0.gameName ?? a0.origGameName, executable_name: r4});
|
|
}
|
|
}
|
|
|
|
function value_36110(a0) { // fn#36110, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4439:8466, offset: 0x01083306, size: 140 bytes, params: 2, frame: 14
|
|
if (this.shouldBlock(a0)) {
|
|
return false;
|
|
}
|
|
let value = this.findGame(a0);
|
|
value = value != null;
|
|
const r2 = a0.name != null && env1_16[a0.name] != null;
|
|
const ShowCurrentGame = (require(3829) /* metro dependency 3829: UserSettings */).ShowCurrentGame;
|
|
return ShowCurrentGame.getSetting() && !env1_18 && !(value || r2);
|
|
}
|
|
|
|
function value_36111(a0) { // fn#36111, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4439:8675, offset: 0x01083392, size: 67 bytes, params: 2, frame: 14
|
|
env1_16[a0] = true;
|
|
const Storage = (require(587) /* metro dependency 587: Storage */).Storage;
|
|
Storage.set('GameStoreReportedGames', env1_16);
|
|
}
|
|
|
|
function _fun36113(a0) { // fn#36113, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4439:8971, offset: 0x01083433, size: 65 bytes, params: 2, frame: 13
|
|
const value = environment.__proto__;
|
|
const convertGameRecordToGameBinding = convertGameRecordToGame;
|
|
const DetectableGameRecord = (require(4269) /* metro dependency 4269: GameDetectionTypes */).DetectableGameRecord;
|
|
return convertGameRecordToGameBinding(new DetectableGameRecord(a0));
|
|
}
|
|
|
|
function _fun36078(a0) { // fn#36078, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4439:3980, offset: 0x01082949, size: 19 bytes, params: 2, frame: 11
|
|
addDetectableGame(a0);
|
|
}
|
|
|
|
function value_36084_loop() { // fn#36085, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4439:4710, owner: value_36084._loop, offset: 0x01082bf8, size: 207 bytes, params: 1, frame: 16
|
|
const detectableGame = env0_3.getDetectableGame(value);
|
|
if (detectableGame == null) {
|
|
return 0;
|
|
}
|
|
if (require != null) {
|
|
require(detectableGame);
|
|
return 0;
|
|
}
|
|
if (env0_0.exePath != null) {
|
|
var executables = detectableGame.executables;
|
|
if (executables == null) {
|
|
return undefined;
|
|
}
|
|
var value4 = env0_0.exePath.split('/');
|
|
var env0_0 = value4.filter((require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish).pop();
|
|
executables = detectableGame.executables;
|
|
if (executables.some(_fun36086)) {
|
|
return {v: detectableGame};
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun36090(a0) { // fn#36090, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4439:5994, offset: 0x01082e63, size: 23 bytes, params: 2, frame: 11
|
|
return env0_0.getDetectableGame(a0);
|
|
}
|
|
|
|
function _fun36102(a0) { // fn#36102, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4439:7158, offset: 0x0108306b, size: 58 bytes, params: 2, frame: 13
|
|
const os = a0.os;
|
|
const value = environment.__proto__.__proto__;
|
|
return os === env2_29 && env0_1.endsWith(a0.name.toLowerCase());
|
|
}
|
|
|
|
function _fun36104(a0) { // fn#36104, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4439:7325, offset: 0x010830a5, size: 28 bytes, params: 2, frame: 11
|
|
return a0.test(env0_0.exePath);
|
|
}
|
|
|