Files
2026-07-28 01:06:53 +03:00

251 lines
9.2 KiB
TypeScript

/* Metro module 10191; source: modules/suspicious_downloads/SuspiciousDownloadUtils.tsx; dependencies: [10192, 1471, 2] */
import URLUtils from '../../utils/URLUtils.tsx'; /* Metro dependency 1471 */
import Module10192 from '../../by-id/module-10192.js'; /* Metro dependency 10192 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun79300(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#79300, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10377:6, offset: 0x01e4c8d0, size: 260 bytes, params: 8, frame: 19
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const Set = global.Set;
const set = new Set(Module10192);
object = {};
let RegExp = global.RegExp;
object['github.com'] = new RegExp('/releases\\S*/download|archive/refs/\\S*|/i/raw/i/\\S*|/user-attachments\\S*');
RegExp = global.RegExp;
object['bitbucket.org'] = new RegExp('/downloads\\S*/[^/]*');
RegExp = global.RegExp;
object['gitlab.com'] = new RegExp('/downloads\\S*/[^/]*');
(FileImportTrackerModule).fileFinishedImporting('modules/suspicious_downloads/SuspiciousDownloadUtils.tsx');
exports.isSuspiciousDownload = isSuspiciousDownload;
function isSuspiciousDownload(a0) { // fn#79301, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10377:440, offset: 0x01e4c9d4, size: 399 bytes, params: 2, frame: 25
var r13;
var r8;
var r7;
var r10;
var r6;
var r1;
var test;
var decodeURIComponent;
var value5;
var error;
var split;
var value6;
var value7;
var length;
var value8;
var value9;
var value10;
var value11;
var pop;
var value12;
var toLowerCase;
var binding;
var has;
let value = undefined;
const value3 = (URLUtils).toURLSafe(a0);
const value4 = null;
reducibleJoin2: while (true) {
if (value4 != value3) {
r13 = value3;
break reducibleJoin2;
}
r13 = {};
break reducibleJoin2;
}
const pathname = r13.pathname;
const hostname = r13.hostname;
if (value4 == hostname) {
return value4;
}
let property = env0_3[hostname];
if (value4 != property) {
reducibleJoin7: while (true) {
if (value4 == pathname) {
break reducibleJoin7;
}
test = property.test;
if (!Reflect.apply(test, property, [pathname])) {
return value4;
}
break reducibleJoin7;
}
}
if (value4 == pathname) {
return value4;
}
reducibleJoin10: while (true) {
reduciblePort12: while (true) {
exceptionLanding11: while (true) {
try {
decodeURIComponent = global.decodeURIComponent;
} catch (error) {
break exceptionLanding11;
}
break reducibleJoin10;
}
r8 = pathname;
break reduciblePort12;
}
split = r8.split;
value6 = Reflect.apply(split, r8, ['/']);
value7 = 0;
length = value6.length;
value8 = length - 1;
if (value8 >= value7) {
r7 = value7;
r10 = value8;
reducibleLoop13: while (true) {
property = value6[r10];
if (property !== '') {
reducibleJoin17: while (true) {
if (property === '.') {
break reducibleJoin17;
}
if (property !== '..') {
reducibleJoin20: while (true) {
if (r7 > r10) {
r6 = value4;
break reducibleJoin20;
}
property = value6[r10 - r7];
r6 = property;
break reducibleJoin20;
}
break reducibleLoop13;
}
value9 = typeof r7 === 'bigint' ? r7 + 1n : +r7 + 1;
r7 = value9;
break reducibleJoin17;
}
}
value10 = typeof r10 === 'bigint' ? r10 - 1n : +r10 - 1;
if (value10 >= value7) {
r10 = value10;
continue reducibleLoop13;
}
r6 = value4;
break reducibleLoop13;
}
} else {
r6 = value4;
}
if (value4 == r6) {
return value4;
}
split = r6.split;
value11 = Reflect.apply(split, r6, ['.']);
length = value11.length;
if (length < 2) {
return value4;
}
pop = value11.pop;
value12 = Reflect.apply(pop, value11, []);
reducibleJoin24: while (true) {
if (value4 == value12) {
r1 = value;
break reducibleJoin24;
}
toLowerCase = value12.toLowerCase;
value = Reflect.apply(toLowerCase, value12, []);
r1 = value;
break reducibleJoin24;
}
reducibleJoin26: while (true) {
if (value4 != r1) {
binding = env0_2;
has = binding.has;
if (Reflect.apply(has, binding, [r1])) {
break reducibleJoin26;
}
r1 = value4;
break reducibleJoin26;
}
r1 = value4;
break reducibleJoin26;
}
return r1;
}
try {
value5 = decodeURIComponent(pathname);
} catch (error) {
break exceptionLanding11;
}
value6 = value5.split('/');
value7 = 0;
value8 = value6.length - 1;
if (value8 >= value7) {
r7 = value7;
r10 = value8;
reducibleLoop13: while (true) {
property = value6[r10];
if (property !== '') {
reducibleJoin17: while (true) {
if (property === '.') {
break reducibleJoin17;
}
if (property !== '..') {
reducibleJoin20: while (true) {
if (r7 > r10) {
r6 = value4;
break reducibleJoin20;
}
property = value6[r10 - r7];
r6 = property;
break reducibleJoin20;
}
break reducibleLoop13;
}
value9 = typeof r7 === 'bigint' ? r7 + 1n : +r7 + 1;
r7 = value9;
break reducibleJoin17;
}
}
value10 = typeof r10 === 'bigint' ? r10 - 1n : +r10 - 1;
if (value10 >= value7) {
r10 = value10;
continue reducibleLoop13;
}
r6 = value4;
break reducibleLoop13;
}
} else {
r6 = value4;
}
if (value4 == r6) {
return value4;
}
value11 = r6.split('.');
if (value11.length < 2) {
return value4;
}
value12 = value11.pop();
reducibleJoin24: while (true) {
if (value4 == value12) {
r1 = value;
break reducibleJoin24;
}
toLowerCase = value12.toLowerCase;
value = Reflect.apply(toLowerCase, value12, []);
r1 = value;
break reducibleJoin24;
}
reducibleJoin26: while (true) {
if (value4 != r1) {
binding = env0_2;
has = binding.has;
if (Reflect.apply(has, binding, [r1])) {
break reducibleJoin26;
}
r1 = value4;
break reducibleJoin26;
}
r1 = value4;
break reducibleJoin26;
}
return r1;
}
}
global.__d(_fun79300, 10191, [10192, 1471, 2]) /* metro module 10191, dependencies: [10192, 1471, 2] */;