338 lines
12 KiB
TypeScript
338 lines
12 KiB
TypeScript
/* Metro module 12680; source: modules/mobile_native_updater/MobileNativeUpdateUtils.tsx; dependencies: [5, 4094, 3, 507, 3853, 477, 676, 2] */
|
|
import Logger from '../debug/Logger.tsx'; /* Metro dependency 3 */
|
|
import Module00005 from '../../by-id/module-00005.js'; /* Metro dependency 5 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as MobileNativeUpdateConstantsModule from './MobileNativeUpdateConstants.tsx'; /* Metro dependency 4094 */
|
|
|
|
function _fun97155(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#97155, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12870:6, offset: 0x02174f9a, size: 219 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const openBuildInstallerUrl2 = openBuildInstallerUrl;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = Logger;
|
|
value = new value('MobileNativeUpdateUtils');
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/mobile_native_updater/MobileNativeUpdateUtils.tsx');
|
|
exports.checkForNewerBuild = function() {
|
|
return _checkForNewerBuild.apply(this, arguments);
|
|
};
|
|
exports.openBuildInstaller = function(a0) {
|
|
openBuildInstallerUrl(a0.urls.install);
|
|
};
|
|
exports.openBuildInstallerUrl = openBuildInstallerUrl2;
|
|
function _checkForNewerBuild() { // fn#97156, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12870:172, offset: 0x02175075, size: 50 bytes, params: 1, frame: 14
|
|
return Module00005(_fun97158).apply(this, arguments);
|
|
function* _fun97158() { // fn#97158, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12870:233, offset: 0x021750b2, size: 465 bytes, params: 1, frame: 23
|
|
var r3;
|
|
var body;
|
|
var build;
|
|
var Date;
|
|
var build_timestamp;
|
|
var value6;
|
|
var date;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
const value3 = null;
|
|
if (value3 === env2_3) {
|
|
return value3;
|
|
}
|
|
let binding = env2_4;
|
|
binding.info('Checking ' + env2_3.url + ' for updates');
|
|
const HTTP = env2_0(env2_1[3]).HTTP;
|
|
const get = HTTP.get;
|
|
let object = {};
|
|
object.url = env2_3.url.toString();
|
|
object.headers = {Accept: 'application/json'};
|
|
object.rejectWithError = false;
|
|
yield Reflect.apply(get, HTTP, [object]);
|
|
const value4 = undefined;
|
|
if (false) {
|
|
return value4;
|
|
}
|
|
if (value4.ok) {
|
|
object = {};
|
|
body = value4.body;
|
|
build = body.build;
|
|
object.build = build;
|
|
body = value4.body;
|
|
object.version = body.version;
|
|
Date = global.Date;
|
|
body = value4.body;
|
|
build_timestamp = body.build_timestamp;
|
|
value6 = Object.create(Date.prototype, {constructor: {value: Date}});
|
|
date = new Date();
|
|
object.buildTimestamp = date instanceof Object ? date : value6;
|
|
body = value4.body;
|
|
object.urls = body.urls;
|
|
build = object.build;
|
|
if (build > env2_3.currentBuild) {
|
|
if (object.version >= env2_3.currentVersion) {
|
|
binding = env2_4;
|
|
binding.info('Update build ' + object.build + ' is newer than ' + env2_3.currentBuild);
|
|
r3 = object;
|
|
} else {
|
|
binding = env2_4;
|
|
binding.info('Update build ' + object.build + ' is older than ' + env2_3.currentBuild);
|
|
r3 = value3;
|
|
}
|
|
} else {
|
|
binding = env2_4;
|
|
binding.info('Update build ' + object.build + ' is older than ' + env2_3.currentBuild);
|
|
r3 = value3;
|
|
}
|
|
return r3;
|
|
}
|
|
throw value4;
|
|
}
|
|
|
|
}
|
|
|
|
function openBuildInstallerUrl(a0) { // fn#97159, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12870:777, offset: 0x02175283, size: 269 bytes, params: 2, frame: 17
|
|
var origin;
|
|
var URL;
|
|
var prototype;
|
|
var uRL;
|
|
var value3;
|
|
var origin2;
|
|
var value5;
|
|
var url;
|
|
var value6;
|
|
var property;
|
|
var moduleValue;
|
|
var openURLExternally;
|
|
var moduleValue2;
|
|
var isIOS;
|
|
var isIOS2;
|
|
var toString;
|
|
var value7;
|
|
var moduleValue3;
|
|
var WebBrowserType;
|
|
var SAFARI;
|
|
var value8;
|
|
var binding;
|
|
var error;
|
|
var concat;
|
|
var value9;
|
|
const value = undefined;
|
|
reducibleJoin3: while (true) {
|
|
reduciblePort59: while (true) {
|
|
exceptionLanding58: while (true) {
|
|
try {
|
|
URL = global.URL;
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
break reducibleJoin3;
|
|
}
|
|
break reduciblePort59;
|
|
}
|
|
return value;
|
|
}
|
|
try {
|
|
prototype = URL.prototype;
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
try {
|
|
uRL = new URL(a0);
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
try {
|
|
value3 = uRL instanceof Object ? uRL : undefined;
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
try {
|
|
origin2 = value3.origin;
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
try {
|
|
value5 = UPDATE_CONFIG == null;
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
reducibleJoin19: while (true) {
|
|
if (value5) {
|
|
origin = value;
|
|
break reducibleJoin19;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
try {
|
|
url = UPDATE_CONFIG.url;
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
try {
|
|
origin = url.origin;
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
break reducibleJoin19;
|
|
}
|
|
try {
|
|
value6 = origin2 !== origin;
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
if (value6) {
|
|
try {
|
|
binding = env0_4;
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
try {
|
|
error = binding.error;
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
try {
|
|
value9 = Reflect.apply(concat, 'Attempted to follow invalid install URL ', [value3]);
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
try {
|
|
Reflect.apply(error, binding, [value9]);
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
} else {
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
try {
|
|
property = dependencyMap[4];
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
try {
|
|
moduleValue = require(property);
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
try {
|
|
property = moduleValue.default;
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
try {
|
|
openURLExternally = property.openURLExternally;
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
try {
|
|
property = dependencyMap[5];
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
try {
|
|
moduleValue2 = require(property);
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
try {
|
|
isIOS = moduleValue2.isIOS;
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
try {
|
|
isIOS2 = Reflect.apply(isIOS, moduleValue2, []);
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
if (isIOS2) {
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
try {
|
|
property = dependencyMap[6];
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
try {
|
|
moduleValue3 = require(property);
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
try {
|
|
WebBrowserType = moduleValue3.WebBrowserType;
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
try {
|
|
SAFARI = WebBrowserType.SAFARI;
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
try {
|
|
toString = value3.toString;
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
try {
|
|
value8 = Reflect.apply(toString, value3, []);
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
try {
|
|
openURLExternally(value8, SAFARI);
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
} else {
|
|
try {
|
|
toString = value3.toString;
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
try {
|
|
value7 = Reflect.apply(toString, value3, []);
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
try {
|
|
openURLExternally(value7);
|
|
} catch (error) {
|
|
break exceptionLanding58;
|
|
}
|
|
}
|
|
}
|
|
return value;
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun97155, 12680, [5, 4094, 3, 507, 3853, 477, 676,
|
|
2]) /* metro module 12680, dependencies: [5, 4094, 3, 507, 3853, 477, 676, 2] */;
|