Files
discord-decomp/sources/modules/device/native/DeviceState.tsx
T
2026-07-27 16:20:00 +03:00

116 lines
4.0 KiB
TypeScript

/* Metro module 7139; source: modules/device/native/DeviceState.tsx; dependencies: [5, 27, 3, 7140, 2] */
function _fun57127(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#57127, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7317:6, offset: 0x013dd34b, size: 191 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(5) /* metro dependency 5 */;
const env0_3 = (require(27) /* metro dependency 27 */).NativeModules;
let value = importDefault(3) /* metro dependency 3: Logger */;
value = new value('native/DeviceState.tsx');
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/device/native/DeviceState.tsx');
exports.logger = value;
exports.getDeviceState = function() {
return _getDeviceState.apply(this, arguments);
};
}
function _getDeviceState() { // fn#57128, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7317:171, offset: 0x013dd40a, size: 48 bytes, params: 1, frame: 14
return env0_2(_fun57130).apply(this, arguments);
}
async function _fun57130() { // fn#57130, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7317:224, offset: 0x013dd44c, size: 157 bytes, params: 1, frame: 19
var r2;
var binding;
var MediaManager;
var getDeviceStateInfo;
var value5;
var value6;
var value7;
var error;
var DEFAULT_DEVICE_STATE;
let value = a0;
if (false) {
return undefined;
}
const fallback = (value !== undefined ? value : {fallback: true}).fallback;
await undefined;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
try {
binding = env2_3;
} catch (error) {
binding = env2_4;
binding.warn('Failed to get device state:', error);
if (fallback) {
binding = env2_0;
DEFAULT_DEVICE_STATE = binding(env2_1[3]).DEFAULT_DEVICE_STATE;
r2 = DEFAULT_DEVICE_STATE;
} else {
r2 = error;
}
return r2;
}
try {
MediaManager = binding.MediaManager;
} catch (error) {
binding = env2_4;
binding.warn('Failed to get device state:', error);
if (fallback) {
binding = env2_0;
DEFAULT_DEVICE_STATE = binding(env2_1[3]).DEFAULT_DEVICE_STATE;
r2 = DEFAULT_DEVICE_STATE;
} else {
r2 = error;
}
return r2;
}
try {
getDeviceStateInfo = MediaManager.getDeviceStateInfo;
} catch (error) {
binding = env2_4;
binding.warn('Failed to get device state:', error);
if (fallback) {
binding = env2_0;
DEFAULT_DEVICE_STATE = binding(env2_1[3]).DEFAULT_DEVICE_STATE;
r2 = DEFAULT_DEVICE_STATE;
} else {
r2 = error;
}
return r2;
}
try {
value5 = Reflect.apply(getDeviceStateInfo, MediaManager, []);
} catch (error) {
binding = env2_4;
binding.warn('Failed to get device state:', error);
if (fallback) {
binding = env2_0;
DEFAULT_DEVICE_STATE = binding(env2_1[3]).DEFAULT_DEVICE_STATE;
r2 = DEFAULT_DEVICE_STATE;
} else {
r2 = error;
}
return r2;
}
await value5;
try {
value6 = undefined;
value7 = false;
} catch (error) {
binding = env2_4;
binding.warn('Failed to get device state:', error);
if (fallback) {
binding = env2_0;
DEFAULT_DEVICE_STATE = binding(env2_1[3]).DEFAULT_DEVICE_STATE;
r2 = DEFAULT_DEVICE_STATE;
} else {
r2 = error;
}
return r2;
}
return value7 ? value6 : value6;
}