657 lines
35 KiB
TypeScript
657 lines
35 KiB
TypeScript
/* Metro module 1226; source: stores/AuthenticationStore.tsx; dependencies: [6, 7, 15, 17, 18, 1227, 1228, 661, 1229, 3, 692, 587, 1230, 683, 507, 694, 12830, 8977, 4132, 490, 12831, 1216, 11878, 566, 10566, 12832, 1355, 1909, 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 Flux from '../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import AnalyticsUtils from '../utils/AnalyticsUtils.tsx'; /* Metro dependency 683 */
|
|
import Dispatcher from '../Dispatcher.tsx'; /* Metro dependency 694 */
|
|
import SentryUtilsNative from '../utils/SentryUtils.native.tsx'; /* Metro dependency 1216 */
|
|
import BrowserHandoffStoreNative from './BrowserHandoffStore.native.tsx'; /* Metro dependency 1227 */
|
|
import MobileCacheSnapshotStore from './MobileCacheSnapshotStore.tsx'; /* Metro dependency 1228 */
|
|
import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as HTTPUtilsModule from '../external/discord_common/js/packages/http-utils/HTTPUtils.tsx'; /* Metro dependency 507 */
|
|
import * as StorageModule from '../external/discord_common/js/packages/storage/Storage.tsx'; /* Metro dependency 587 */
|
|
import * as ConstantsModule from '../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as TokenManagerModule from '../external/discord_common/js/shared/lib/TokenManager.tsx'; /* Metro dependency 692 */
|
|
import * as DispatcherModule from '../Dispatcher.tsx'; /* Metro dependency 694 */
|
|
import * as Router_utilsModule from '../modules/routing/router_utils.tsx'; /* Metro dependency 1230 */
|
|
import * as AuthenticationUtilsModule from '../utils/AuthenticationUtils.tsx'; /* Metro dependency 1355 */
|
|
import * as ServerModule from '../flow/Server.tsx'; /* Metro dependency 1909 */
|
|
import * as ApexActionCreatorsModule from '../modules/experiments/apex/ApexActionCreators.tsx'; /* Metro dependency 10566 */
|
|
import * as AwaitExperimentsModule from '../modules/app_startup/awaitExperiments.tsx'; /* Metro dependency 12830 */
|
|
import * as ClientStateStoreStorageNativeModule from '../modules/cache/ClientStateStoreStorage.native.tsx'; /* Metro dependency 12832 */
|
|
|
|
function _fun13691(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#13691, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:6, offset: 0x00df2b45, size: 999 bytes, params: 8, frame: 23
|
|
const env0_0 = require;
|
|
const INSTALLATION_ID2 = INSTALLATION_ID;
|
|
const AGE_GATE_LOGOUT_UNDERAGE_NEW_USER2 = AGE_GATE_LOGOUT_UNDERAGE_NEW_USER;
|
|
const LOGOUT_137082 = LOGOUT_13708;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ConstantsModule;
|
|
const env0_11 = value.AnalyticEvents;
|
|
const env0_12 = value.Endpoints;
|
|
const LoginStates = value.LoginStates;
|
|
const env0_14 = value.Platforms;
|
|
const env0_15 = value.Routes;
|
|
const env0_16 = value.TOKEN_KEY;
|
|
value = require(1229) /* metro dependency 1229: AgeGateConstants */;
|
|
value.EXISTING_USER_AGE_GATE_MODAL_KEY;
|
|
value.NEW_USER_AGE_GATE_MODAL_KEY;
|
|
value = importDefault(3) /* metro dependency 3: Logger */;
|
|
value = new value('AuthenticationStore');
|
|
let env0_31 = LoginStates.NONE;
|
|
const env0_33 = [];
|
|
const env0_43 = [];
|
|
const Store = (Flux).Store;
|
|
_fun13709(Store).displayName = 'AuthenticationStore';
|
|
object = {CONNECTION_OPEN: CONNECTION_OPEN_13733, OVERLAY_INITIALIZE: OVERLAY_INITIALIZE,
|
|
CONNECTION_CLOSED: CONNECTION_CLOSED, AUTH_SESSION_CHANGE: AUTH_SESSION_CHANGE, LOGIN: LOGIN,
|
|
LOGIN_SUCCESS: function({token}) {
|
|
env0_31 = LoginStates.NONE;
|
|
setAuthToken(token);
|
|
clearFingerprint();
|
|
env0_34 = '';
|
|
env0_35 = false;
|
|
env0_36 = null;
|
|
env0_18 = null;
|
|
updateMFAMethods();
|
|
env0_41 = false;
|
|
}, LOGIN_FAILURE: function({error}) {
|
|
env0_34 = '';
|
|
env0_35 = false;
|
|
env0_36 = null;
|
|
env0_18 = null;
|
|
updateMFAMethods();
|
|
env0_31 = require(dependencyMap[17]).getAuthenticationErrorsFromV6OrEarlierAPIError(error).date_of_birth != null ? LoginStates.LOGIN_AGE_GATE : LoginStates.NONE;
|
|
}, LOGIN_MFA_STEP: LOGIN_MFA_STEP, LOGIN_MFA: function() {
|
|
env0_31 = LoginStates.LOGGING_IN_MFA;
|
|
}, LOGIN_ACCOUNT_SCHEDULED_FOR_DELETION: function(a0) {
|
|
env0_31 = LoginStates.ACCOUNT_SCHEDULED_FOR_DELETION;
|
|
env0_17 = a0.credentials;
|
|
}, LOGIN_ACCOUNT_DISABLED: function(a0) {
|
|
env0_31 = LoginStates.ACCOUNT_DISABLED;
|
|
env0_17 = a0.credentials;
|
|
}, LOGIN_PASSWORD_RECOVERY_PHONE_VERIFICATION: function(a0) {
|
|
env0_31 = LoginStates.PASSWORD_RECOVERY_PHONE_VERIFICATION;
|
|
env0_17 = a0.credentials;
|
|
}, LOGIN_PHONE_IP_AUTHORIZATION_REQUIRED: function(a0) {
|
|
env0_31 = LoginStates.PHONE_IP_AUTHORIZATION;
|
|
env0_17 = a0.credentials;
|
|
}, LOGIN_RESET: function({isMultiAccount}) {
|
|
env0_31 = LoginStates.NONE;
|
|
env0_34 = '';
|
|
env0_35 = false;
|
|
env0_36 = null;
|
|
env0_18 = null;
|
|
env0_17 = null;
|
|
if (!isMultiAccount) {
|
|
updateMFAMethods();
|
|
removeAuthToken();
|
|
fetchFingerprint(false);
|
|
}
|
|
}, LOGIN_STATUS_RESET: function() {
|
|
env0_31 = LoginStates.NONE;
|
|
}, LOGIN_SUSPENDED_USER: function({suspendedUserToken}) {
|
|
env0_41 = false;
|
|
env0_40 = suspendedUserToken;
|
|
global.setImmediate(_fun13750);
|
|
}, LOGOUT: LOGOUT_137082, FINGERPRINT: FINGERPRINT, INSTALLATION_ID: INSTALLATION_ID2,
|
|
REGISTER_SUCCESS: function({token}) {
|
|
setAuthToken(token);
|
|
clearFingerprint();
|
|
}, FORGOT_PASSWORD_REQUEST: function() {
|
|
env0_31 = LoginStates.FORGOT_PASSWORD;
|
|
}, FORGOT_PASSWORD_SENT: function() {
|
|
env0_31 = LoginStates.NONE;
|
|
}, UPDATE_TOKEN: function({token, userId}) {
|
|
logInfo('handleUpdateToken called');
|
|
setAuthToken(token, userId);
|
|
clearFingerprint();
|
|
}, EXPERIMENTS_FETCH: function(a0) {
|
|
fetchExperiments(a0);
|
|
}, CURRENT_USER_UPDATE: CURRENT_USER_UPDATE, AGE_GATE_LOGOUT_UNDERAGE_NEW_USER: AGE_GATE_LOGOUT_UNDERAGE_NEW_USER2,
|
|
CLOSE_SUSPENDED_USER: function() {
|
|
env0_40 = null;
|
|
env0_31 = LoginStates.NONE;
|
|
LOGOUT_13708();
|
|
global.setImmediate(_fun13759);
|
|
}, PASSWORDLESS_FAILURE: PASSWORDLESS_FAILURE, PASSWORDLESS_START: function() {
|
|
env0_41 = true;
|
|
}};
|
|
const DispatchBand = (DispatcherModule).DispatchBand;
|
|
const Early = DispatchBand.Early;
|
|
value = new value(Dispatcher, object, Early);
|
|
(FileImportTrackerModule).fileFinishedImporting('stores/AuthenticationStore.tsx');
|
|
exports.default = value;
|
|
function _isNativeReflectConstruct_13692() { // fn#13692, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:341, offset: 0x00df2f2c, 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_13692_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function logInfo(a0) { // fn#13695, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:772, offset: 0x00df2f8a, size: 114 bytes, params: 2, frame: 16
|
|
const value3 = (TokenManagerModule).getToken() != null;
|
|
const Storage = (StorageModule).Storage;
|
|
const get = Storage.get;
|
|
const value4 = Reflect.apply(get, Storage, [TOKEN_KEY]) != null;
|
|
const binding = env0_19;
|
|
binding.verbose(a0, {tokenManagerHasToken: value3, storageHasToken: value4});
|
|
}
|
|
|
|
function fetchFingerprint() { // fn#13696, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:912, offset: 0x00df2ffc, size: 264 bytes, params: 1, frame: 17
|
|
const value = a0;
|
|
const r4 = !(value !== undefined) || value;
|
|
const Storage = (StorageModule).Storage;
|
|
env0_27 = Storage.get(env0_20);
|
|
const value2 = Storage.get(env0_21);
|
|
const value3 = null;
|
|
let r1 = value3 != value2 ? value2 : value3;
|
|
if (value3 != env0_39) {
|
|
return env0_39;
|
|
}
|
|
r1 = value3 != env0_27 ? env0_27 : (importAll(692) /* metro dependency 692: TokenManager */).getToken();
|
|
r1 = Router_utilsModule.isValidFingerprintRoute() ? r4 ? BrowserHandoffStoreNative.isHandoffAvailable() ? global.Promise.resolve() : fetchExperiments({withGuildExperiments: true}) : value3 != r1 || BrowserHandoffStoreNative.isHandoffAvailable() ? global.Promise.resolve() : fetchExperiments({withGuildExperiments: true}) : global.Promise.resolve();
|
|
return r1;
|
|
}
|
|
|
|
function fetchExperiments({withGuildExperiments}) { // fn#13697, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:1216, offset: 0x00df3104, size: 246 bytes, params: 2, frame: 20
|
|
let object = {};
|
|
const superPropertiesBase64 = (AnalyticsUtils).getSuperPropertiesBase64();
|
|
if (superPropertiesBase64 != null) {
|
|
object['X-Super-Properties'] = superPropertiesBase64;
|
|
}
|
|
if (env0_27 != null) {
|
|
object['X-Fingerprint'] = env0_27;
|
|
}
|
|
if (env0_29 != null) {
|
|
object['X-Installation-ID'] = env0_29;
|
|
}
|
|
const HTTP = (HTTPUtilsModule).HTTP;
|
|
const get = HTTP.get;
|
|
const object2 = {};
|
|
const EXPERIMENTS = Endpoints.EXPERIMENTS;
|
|
object2.url = EXPERIMENTS;
|
|
object2.query = {with_guild_experiments: withGuildExperiments};
|
|
object2.headers = object;
|
|
object = {};
|
|
object.location = (require(1230) /* metro dependency 1230: router_utils */).getFingerprintLocation();
|
|
object2.context = object;
|
|
object2.retries = 3;
|
|
object2.oldFormErrors = true;
|
|
object2.rejectWithError = false;
|
|
return Reflect.apply(get, HTTP, [object2]).then(_fun13698, _fun13699);
|
|
function _fun13698({body}) { // fn#13698, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:1616, offset: 0x00df31fa, size: 252 bytes, params: 2, frame: 19
|
|
const fingerprint = body.fingerprint;
|
|
const assignments = body.assignments;
|
|
const guild_experiments = body.guild_experiments;
|
|
const installation = body.installation;
|
|
let value = installation != null;
|
|
if (value && installation.length > 0) {
|
|
value = environment.__proto__;
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.dispatch({type: 'INSTALLATION_ID', installation: installation});
|
|
}
|
|
if (fingerprint) {
|
|
value = environment.__proto__;
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.dispatch({type: 'FINGERPRINT', fingerprint: fingerprint});
|
|
}
|
|
value = environment.__proto__;
|
|
const defaultImport = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
defaultImport.dispatch({type: 'EXPERIMENTS_FETCH_SUCCESS', fingerprint: fingerprint, experiments: assignments,
|
|
guildExperiments: guild_experiments});
|
|
(AwaitExperimentsModule).onExperimentsLoaded();
|
|
}
|
|
|
|
function _fun13699() { // fn#13699, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:1983, offset: 0x00df32f6, size: 55 bytes, params: 1, frame: 13
|
|
const value = environment.__proto__;
|
|
(Dispatcher).dispatch({type: 'EXPERIMENTS_FETCH_FAILURE'});
|
|
}
|
|
|
|
}
|
|
|
|
function clearFingerprint() { // fn#13700, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:2052, offset: 0x00df332d, size: 62 bytes, params: 1, frame: 12
|
|
const Storage = (StorageModule).Storage;
|
|
Storage.remove(env0_20);
|
|
}
|
|
|
|
function setAuthToken(a0, a1) { // fn#13701, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:2118, offset: 0x00df336b, size: 110 bytes, params: 3, frame: 15
|
|
logInfo('setAuthToken called.');
|
|
if (!(a1 != null && a1 === env0_23)) {
|
|
(importAll(692) /* metro dependency 692: TokenManager */).removeAnalyticsToken();
|
|
}
|
|
(importAll(692) /* metro dependency 692: TokenManager */).setToken(a0, a1);
|
|
}
|
|
|
|
function setAnalyticsToken_13702(a0) { // fn#13702, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:2248, offset: 0x00df33d9, size: 45 bytes, params: 2, frame: 12
|
|
env0_30 = a0;
|
|
(TokenManagerModule).setAnalyticsToken(a0);
|
|
}
|
|
|
|
function removeAuthToken() { // fn#13703, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:2312, offset: 0x00df3406, size: 71 bytes, params: 1, frame: 14
|
|
logInfo('removeAuthToken called.');
|
|
(TokenManagerModule).removeAnalyticsToken();
|
|
return (TokenManagerModule).removeToken();
|
|
}
|
|
|
|
function updateMFAMethods() { // fn#13704, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:2436, offset: 0x00df344d, size: 135 bytes, params: 1, frame: 13
|
|
const items2 = [];
|
|
if (env0_36 != null) {
|
|
items2.push({type: 'webauthn', challenge: env0_36});
|
|
}
|
|
if (env0_37) {
|
|
items2.push({type: 'totp'});
|
|
}
|
|
if (env0_38) {
|
|
items2.push({type: 'backup'});
|
|
}
|
|
if (env0_35) {
|
|
items2.push({type: 'sms'});
|
|
}
|
|
}
|
|
|
|
function INSTALLATION_ID({installation}) { // fn#13705, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:2600, offset: 0x00df34d4, size: 123 bytes, params: 2, frame: 15
|
|
var defaultImport;
|
|
const Storage = (StorageModule).Storage;
|
|
if (env0_29 == null) {
|
|
defaultImport = importDefault(12831) /* metro dependency 12831: TrackingConsentUtils */;
|
|
if (defaultImport.canUseInstallationId()) {
|
|
Storage.set(env0_21, installation);
|
|
}
|
|
} else {
|
|
if (env0_29.length > 0) {
|
|
return false;
|
|
}
|
|
defaultImport = importDefault(12831) /* metro dependency 12831: TrackingConsentUtils */;
|
|
if (defaultImport.canUseInstallationId()) {
|
|
Storage.set(env0_21, installation);
|
|
}
|
|
}
|
|
}
|
|
|
|
function AGE_GATE_LOGOUT_UNDERAGE_NEW_USER() { // fn#13706, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:2743, offset: 0x00df354f, size: 59 bytes, params: 1, frame: 12
|
|
LOGOUT_13708();
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).wait(function() {
|
|
require(dependencyMap[12]).transitionTo(Routes.REGISTER);
|
|
});
|
|
}
|
|
|
|
function LOGOUT_13708(a0) { // fn#13708, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:2853, offset: 0x00df35ba, size: 359 bytes, params: 2, frame: 19
|
|
const logInfoBinding = logInfo;
|
|
const value2 = undefined;
|
|
logInfoBinding('handleLogout called.');
|
|
const value3 = removeAuthToken();
|
|
const isSwitchingAccount = a0 == null ? value2 : a0.isSwitchingAccount;
|
|
if (!(isSwitchingAccount != null && isSwitchingAccount)) {
|
|
if (value3) {
|
|
clearFingerprint();
|
|
}
|
|
fetchFingerprint();
|
|
}
|
|
const PersistedStore = (Flux).PersistedStore;
|
|
PersistedStore.clearAll({omit: ['InstallationManagerStore', 'AgeGateStore', 'NativePermissionsStore',
|
|
'MultiAccountStore', 'DraftStore', 'OverlayStoreV2', 'StreamerModeStore', 'LoginRequiredActionStore',
|
|
'LayoutStore', 'OverlaySettingsStore', 'ApexExperimentStore'],
|
|
type: a0 != null && a0.isSwitchingAccount ? 'user-data-only' : 'all'});
|
|
const Store = (Flux).Store;
|
|
Store.removeAllConditionalListeners();
|
|
MobileCacheSnapshotStore.clearAll();
|
|
(SentryUtilsNative).clearUser();
|
|
const Storage = (StorageModule).Storage;
|
|
Storage.remove(env0_22);
|
|
env0_31 = a0 == null ? LoginStates.NONE : a0.isSwitchingAccount ? LoginStates.LOGGING_IN : LoginStates.NONE;
|
|
updateMFAMethods();
|
|
return value2;
|
|
}
|
|
|
|
function _fun13709(a0) { // fn#13709, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:3583, offset: 0x00df3721, size: 521 bytes, params: 2, frame: 16
|
|
const AuthenticationStore2 = AuthenticationStore;
|
|
Inherits(AuthenticationStore2, a0);
|
|
return CreateClass(AuthenticationStore2, [{key: 'initialize', value: value_13711}, {key: 'getLoginStatus',
|
|
value: function() {
|
|
return NONE;
|
|
}}, {key: 'getId', value: value_13715}, {key: 'getSessionId', value: value_13716}, {key: 'getAuthSessionIdHash',
|
|
value: value_13717}, {key: 'getStaticAuthSessionId', value: value_13718}, {key: 'getToken', value: value_13719},
|
|
{key: 'isAuthenticated', value: value_13720}, {key: 'getFingerprint', value: value_13721},
|
|
{key: 'getInstallationForTracking', value: value_13722}, {key: 'getAnalyticsToken', value: value_13723},
|
|
{key: 'getMFATicket', value: value_13724}, {key: 'getMFAMethods', value: value_13725},
|
|
{key: 'getLoginInstanceId', value: value_13726}, {key: 'hasTOTPEnabled', value: value_13727},
|
|
{key: 'getCredentials', value: value_13728}, {key: 'allowLogoutRedirect', value: value_13729},
|
|
{key: 'getSuspendedUserToken', value: value_13730}, {key: 'getIsPasswordlessActive', value: value_13731},
|
|
{key: 'attemptedPasswordLogin', value: value_13732}]);
|
|
function AuthenticationStore() { // fn#13710, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:3595, offset: 0x00df392a, size: 113 bytes, params: 1, frame: 20
|
|
const value = environment.__proto__;
|
|
env1_4(this, AuthenticationStore);
|
|
const value3 = env1_7(AuthenticationStore);
|
|
return env1_6(this, _isNativeReflectConstruct_13692() ? global.Reflect.construct(value3, arguments,
|
|
env1_7(this).constructor) : value3.apply(this, arguments));
|
|
}
|
|
|
|
function value_13711() { // fn#13711, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:3908, offset: 0x00df399b, size: 206 bytes, params: 1, frame: 19
|
|
var environment;
|
|
var fireApex2;
|
|
const value = environment.__proto__;
|
|
const Storage = (StorageModule).Storage;
|
|
env1_23 = Storage.get(env1_22);
|
|
const value2 = Storage.get(env1_21);
|
|
const value3 = null;
|
|
env1_29 = value3 != value2 ? value2 : value3;
|
|
const getToken = TokenManagerModule.getToken;
|
|
if (value3 == Reflect.apply(getToken, TokenManagerModule, [])) {
|
|
if (value3 == env1_29 || env1_29.length === 0) {
|
|
fireApex2 = fireApex;
|
|
fetchFingerprint().then(fireApex2, fireApex2);
|
|
}
|
|
}
|
|
this.addChangeListener(_fun13713);
|
|
function fireApex() { // fn#13712, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:4092, owner: value_13711.fireApex, offset: 0x00df3a69, size: 40 bytes, params: 1, frame: 12
|
|
const value = environment.__proto__.__proto__;
|
|
(ApexActionCreatorsModule).fetchInstallationExperiments(null);
|
|
}
|
|
|
|
function _fun13713() { // fn#13713, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:4193, offset: 0x00df3a91, size: 42 bytes, params: 1, frame: 12
|
|
return (ClientStateStoreStorageNativeModule).setClientState(env2_23);
|
|
}
|
|
|
|
}
|
|
|
|
function value_13715() { // fn#13715, offset: 0x00df3ac4, size: 9 bytes, params: 1, frame: 1
|
|
return env1_23;
|
|
}
|
|
|
|
function value_13716() { // fn#13716, offset: 0x00df3acd, size: 9 bytes, params: 1, frame: 1
|
|
return env1_24;
|
|
}
|
|
|
|
function value_13717() { // fn#13717, offset: 0x00df3ad6, size: 9 bytes, params: 1, frame: 1
|
|
return env1_25;
|
|
}
|
|
|
|
function value_13718() { // fn#13718, offset: 0x00df3adf, size: 9 bytes, params: 1, frame: 1
|
|
return env1_26;
|
|
}
|
|
|
|
function value_13719() { // fn#13719, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:4503, offset: 0x00df3ae8, size: 37 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
return (AuthenticationUtilsModule).getToken();
|
|
}
|
|
|
|
function value_13720() { // fn#13720, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:4572, offset: 0x00df3b0d, size: 37 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
return (AuthenticationUtilsModule).isAuthenticated();
|
|
}
|
|
|
|
function value_13721() { // fn#13721, offset: 0x00df3b32, size: 9 bytes, params: 1, frame: 1
|
|
return env1_27;
|
|
}
|
|
|
|
function value_13722() { // fn#13722, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:4709, offset: 0x00df3b3b, size: 46 bytes, params: 1, frame: 12
|
|
return (importDefault(12831) /* metro dependency 12831: TrackingConsentUtils */).canUseInstallationId() ? env1_29 : null;
|
|
}
|
|
|
|
function value_13723() { // fn#13723, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:4799, offset: 0x00df3b69, size: 53 bytes, params: 1, frame: 12
|
|
var r0;
|
|
let value = environment.__proto__;
|
|
if (env1_30 != null) {
|
|
r0 = env1_30;
|
|
} else {
|
|
value = importAll(692) /* metro dependency 692: TokenManager */;
|
|
value = value.getAnalyticsToken();
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function value_13724() { // fn#13724, offset: 0x00df3b9e, size: 9 bytes, params: 1, frame: 1
|
|
return env1_34;
|
|
}
|
|
|
|
function value_13725() { // fn#13725, offset: 0x00df3ba7, size: 9 bytes, params: 1, frame: 1
|
|
return env1_43;
|
|
}
|
|
|
|
function value_13726() { // fn#13726, offset: 0x00df0e82, size: 9 bytes, params: 1, frame: 1
|
|
return env1_18;
|
|
}
|
|
|
|
function value_13727() { // fn#13727, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:5037, offset: 0x00df3bb0, size: 53 bytes, params: 1, frame: 13
|
|
const binding = env1_33;
|
|
const includes = binding.includes;
|
|
const AuthenticatorType = (ServerModule).AuthenticatorType;
|
|
const TOTP = AuthenticatorType.TOTP;
|
|
return Reflect.apply(includes, binding, [TOTP]);
|
|
}
|
|
|
|
function value_13728() { // fn#13728, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:5129, offset: 0x00df3be5, size: 55 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
if (env1_17 == null) {
|
|
throw new global.Error('no credentials');
|
|
}
|
|
return env1_17;
|
|
}
|
|
|
|
function value_13729() { // fn#13729, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:5229, offset: 0x00df3c1c, size: 12 bytes, params: 1, frame: 1
|
|
return !env1_32;
|
|
}
|
|
|
|
function value_13730() { // fn#13730, offset: 0x00df3c28, size: 9 bytes, params: 1, frame: 1
|
|
return env1_40;
|
|
}
|
|
|
|
function value_13731() { // fn#13731, offset: 0x00df3c31, size: 9 bytes, params: 1, frame: 1
|
|
return env1_41;
|
|
}
|
|
|
|
function value_13732() { // fn#13732, offset: 0x00df3c3a, size: 9 bytes, params: 1, frame: 1
|
|
return env1_42;
|
|
}
|
|
|
|
}
|
|
|
|
function CONNECTION_OPEN_13733({user, sessionId, authSessionIdHash, analyticsToken, auth, staticAuthSessionId, apexExperiments}) { // fn#13733, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:5518, offset: 0x00df3c43, size: 450 bytes, params: 2, frame: 29
|
|
var authenticator_types;
|
|
var defaultImport2;
|
|
var track;
|
|
logInfo('handleConnectionOpen called');
|
|
const defaultImport = SentryUtilsNative;
|
|
const setUser = defaultImport.setUser;
|
|
let id = user.id;
|
|
const username = user.username;
|
|
Reflect.apply(setUser, defaultImport, [id, username, user.email ?? undefined,
|
|
(importDefault(11878) /* metro dependency 11878: isStaffFromRawUser */)(user)]);
|
|
setAnalyticsToken_13702(analyticsToken);
|
|
id = user.id;
|
|
if (auth !== undefined) {
|
|
authenticator_types = auth.authenticator_types;
|
|
}
|
|
const Storage = (StorageModule).Storage;
|
|
let set = Storage.set;
|
|
Reflect.apply(set, Storage, [env0_22, user.id]);
|
|
if (apexExperiments?.installation != null) {
|
|
INSTALLATION_ID({type: 'INSTALLATION_ID', installation: apexExperiments.installation});
|
|
}
|
|
const get = Storage.get;
|
|
let APP_FIRST_LOGIN = AnalyticEvents.APP_FIRST_LOGIN;
|
|
if (Reflect.apply(get, Storage, [APP_FIRST_LOGIN, true])) {
|
|
defaultImport2 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
track = defaultImport2.track;
|
|
APP_FIRST_LOGIN = AnalyticEvents.APP_FIRST_LOGIN;
|
|
Reflect.apply(track, defaultImport2, [APP_FIRST_LOGIN, {platform: Platforms.IOS}]);
|
|
set = Storage.set;
|
|
APP_FIRST_LOGIN = AnalyticEvents.APP_FIRST_LOGIN;
|
|
Reflect.apply(set, Storage, [APP_FIRST_LOGIN, false]);
|
|
}
|
|
}
|
|
|
|
function OVERLAY_INITIALIZE({user, sessionId, analyticsToken, token}) { // fn#13734, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:6183, offset: 0x00df3e05, size: 230 bytes, params: 2, frame: 26
|
|
const defaultImport = SentryUtilsNative;
|
|
const setUser = defaultImport.setUser;
|
|
let id = user.id;
|
|
const username = user.username;
|
|
Reflect.apply(setUser, defaultImport, [id, username, user.email ?? undefined,
|
|
(importDefault(11878) /* metro dependency 11878: isStaffFromRawUser */)(user)]);
|
|
setAuthToken(token, user.id);
|
|
if (analyticsToken != null) {
|
|
setAnalyticsToken_13702(analyticsToken);
|
|
}
|
|
clearFingerprint();
|
|
id = user.id;
|
|
const Storage = (StorageModule).Storage;
|
|
Storage.set(env0_22, user.id);
|
|
}
|
|
|
|
function CONNECTION_CLOSED({code}) { // fn#13735, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:6475, offset: 0x00df3eeb, size: 190 bytes, params: 2, frame: 19
|
|
logInfo('handleConnectionClosed called with code ' + code + '.');
|
|
if (code === 4004) {
|
|
if (env0_32) {
|
|
AGE_GATE_LOGOUT_UNDERAGE_NEW_USER();
|
|
return undefined;
|
|
}
|
|
var defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
var track = defaultImport.track;
|
|
var APP_USER_DEAUTHENTICATED = AnalyticEvents.APP_USER_DEAUTHENTICATED;
|
|
var object = {};
|
|
var Storage = (require(587) /* metro dependency 587: Storage */).Storage;
|
|
object.user_id = Storage.get(env0_22);
|
|
Reflect.apply(track, defaultImport, [APP_USER_DEAUTHENTICATED, object]);
|
|
LOGOUT_13708();
|
|
global.setImmediate(function() {
|
|
return require(dependencyMap[12]).transitionTo(Routes.DEFAULT_LOGGED_OUT);
|
|
});
|
|
}
|
|
}
|
|
|
|
function AUTH_SESSION_CHANGE({authSessionIdHash}) { // fn#13737, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:6806, offset: 0x00df3fd9, size: 26 bytes, params: 2, frame: 2
|
|
if (authSessionIdHash == null) {
|
|
}
|
|
}
|
|
|
|
function LOGIN({isPasswordAttempt}) { // fn#13738, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:6884, offset: 0x00df3ff3, size: 47 bytes, params: 2, frame: 4
|
|
env0_31 = LoginStates.LOGGING_IN;
|
|
env0_42 = env0_42 || isPasswordAttempt === true;
|
|
}
|
|
|
|
function LOGIN_MFA_STEP({ticket, sms, webauthn, backup, totp, loginInstanceId}) { // fn#13741, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:7333, offset: 0x00df40e7, size: 115 bytes, params: 2, frame: 15
|
|
var r4;
|
|
if (ticket != null) {
|
|
r4 = webauthn ?? null;
|
|
updateMFAMethods();
|
|
}
|
|
env0_31 = LoginStates.MFA_STEP;
|
|
}
|
|
|
|
function LOGIN_SUSPENDED_USER({suspendedUserToken}) { // fn#13749, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:8334, offset: 0x00df4264, size: 46 bytes, params: 2, frame: 11
|
|
global.setImmediate(function() {
|
|
return require(dependencyMap[12]).transitionTo(Routes.ACCOUNT_STANDING);
|
|
});
|
|
function _fun13750() { // fn#13750, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:8415, offset: 0x00df4292, size: 48 bytes, params: 1, frame: 12
|
|
const transitionTo = Router_utilsModule.transitionTo;
|
|
const ACCOUNT_STANDING = Routes.ACCOUNT_STANDING;
|
|
return Reflect.apply(transitionTo, Router_utilsModule, [ACCOUNT_STANDING]);
|
|
}
|
|
|
|
}
|
|
|
|
function FINGERPRINT({fingerprint}) { // fn#13751, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:8496, offset: 0x00df42c2, size: 365 bytes, params: 2, frame: 23
|
|
var defaultImport;
|
|
var track;
|
|
var EXTERNAL_FINGERPRINT_DROPPED;
|
|
var object;
|
|
var defaultImport2;
|
|
var USER_FINGERPRINT_CHANGED;
|
|
var Storage;
|
|
if (fingerprint2 == null) {
|
|
if (fingerprint != null) {
|
|
defaultImport2 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
track = defaultImport2.track;
|
|
USER_FINGERPRINT_CHANGED = AnalyticEvents.USER_FINGERPRINT_CHANGED;
|
|
object = {};
|
|
object.old_fingerprint = env0_28 != null ? (require(490) /* metro dependency 490: FingerprintUtils */).extractId(env0_28) : null;
|
|
object.new_fingerprint = (require(490) /* metro dependency 490: FingerprintUtils */).extractId(fingerprint);
|
|
Reflect.apply(track, defaultImport2, [USER_FINGERPRINT_CHANGED, object]);
|
|
fingerprint2 = fingerprint;
|
|
Storage = (require(587) /* metro dependency 587: Storage */).Storage;
|
|
Storage.set(env0_20, fingerprint2);
|
|
} else {
|
|
fetchFingerprint();
|
|
}
|
|
} else if (fingerprint != null && fingerprint2 !== fingerprint) {
|
|
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
track = defaultImport.track;
|
|
EXTERNAL_FINGERPRINT_DROPPED = AnalyticEvents.EXTERNAL_FINGERPRINT_DROPPED;
|
|
object = {};
|
|
object.fingerprint = (require(490) /* metro dependency 490: FingerprintUtils */).extractId(fingerprint2);
|
|
object.dropped_fingerprint = (require(490) /* metro dependency 490: FingerprintUtils */).extractId(fingerprint);
|
|
Reflect.apply(track, defaultImport, [EXTERNAL_FINGERPRINT_DROPPED, object]);
|
|
}
|
|
}
|
|
|
|
function CURRENT_USER_UPDATE({user}) { // fn#13757, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:9373, offset: 0x00df44ae, size: 90 bytes, params: 2, frame: 15
|
|
const id = user.id;
|
|
let authenticator_types = user.authenticator_types;
|
|
if (authenticator_types !== undefined) {
|
|
authenticator_types = user.authenticator_types;
|
|
}
|
|
const Storage = (StorageModule).Storage;
|
|
Storage.set(env0_22, user.id);
|
|
}
|
|
|
|
function CLOSE_SUSPENDED_USER() { // fn#13758, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:9581, offset: 0x00df4508, size: 55 bytes, params: 1, frame: 11
|
|
env0_31 = LoginStates.NONE;
|
|
LOGOUT_13708();
|
|
global.setImmediate(function() {
|
|
return require(dependencyMap[12]).transitionTo(Routes.DEFAULT_LOGGED_OUT);
|
|
});
|
|
function _fun13759() { // fn#13759, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:9663, offset: 0x00df3fa9, size: 48 bytes, params: 1, frame: 12
|
|
const transitionTo = Router_utilsModule.transitionTo;
|
|
const DEFAULT_LOGGED_OUT = Routes.DEFAULT_LOGGED_OUT;
|
|
return Reflect.apply(transitionTo, Router_utilsModule, [DEFAULT_LOGGED_OUT]);
|
|
}
|
|
|
|
}
|
|
|
|
function PASSWORDLESS_FAILURE({error}) { // fn#13760, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:9735, offset: 0x00df453f, size: 153 bytes, params: 2, frame: 15
|
|
var r1;
|
|
var NONE;
|
|
var moduleValue;
|
|
if (error instanceof (importDefault(4132) /* metro dependency 4132: APIError */)) {
|
|
moduleValue = require(8977) /* metro dependency 8977: getAuthenticationErrorsFromAPIError */;
|
|
r1 = moduleValue.getAuthenticationErrorsFromAPIError(error).date_of_birth != null ? LoginStates.LOGIN_AGE_GATE : LoginStates.NONE;
|
|
} else {
|
|
NONE = LoginStates.NONE;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun13691, 1226, [6, 7, 15, 17, 18, 1227, 1228, 661, 1229, 3, 692, 587, 1230, 683, 507, 694, 12830, 8977,
|
|
4132, 490, 12831, 1216, 11878, 566, 10566, 12832, 1355, 1909,
|
|
2]) /* metro module 1226, dependencies: [6, 7, 15, 17, 18, 1227, 1228, 661, 1229, 3, 692, 587, 1230, 683, 507, 694, 12830, 8977, 4132, 490, 12831, 1216, 11878, 566, 10566, 12832, 1355, 1909, 2] */;
|