432 lines
15 KiB
TypeScript
432 lines
15 KiB
TypeScript
/* Metro module 11998; source: modules/contact_sync/native/ContactSyncManager.tsx; dependencies: [7, 6, 15, 17, 18, 5, 5040, 1878, 11996, 11995, 661, 587, 11997, 5459, 4860, 2] */
|
|
function _fun92178(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#92178, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12184:6, offset: 0x0207ece0, size: 402 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_2 = importDefault(7) /* metro dependency 7 */;
|
|
const env0_3 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_4 = importDefault(15) /* metro dependency 15 */;
|
|
const env0_5 = importDefault(17) /* metro dependency 17 */;
|
|
const env0_6 = importDefault(18) /* metro dependency 18 */;
|
|
const env0_7 = importDefault(5) /* metro dependency 5 */;
|
|
const connectedAccountsStore = importDefault(5040) /* metro dependency 5040: ConnectedAccountsStore */;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
let value = require(11996) /* metro dependency 11996: ContactSyncPersistedStore */;
|
|
const env0_10 = value.setStoredContacts;
|
|
const env0_11 = value.deleteStoredContacts;
|
|
const env0_12 = value.useContactSyncStore;
|
|
const env0_13 = (require(11995) /* metro dependency 11995: ContactSyncConstants */).ContactPermissions;
|
|
const env0_14 = (require(661) /* metro dependency 661: Constants */).PlatformTypes;
|
|
const env0_15 = _fun92182();
|
|
value = importDefault(4860) /* metro dependency 4860: AutomaticLifecycleManager */;
|
|
value = _fun92186(value);
|
|
value = new value();
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/contact_sync/native/ContactSyncManager.tsx');
|
|
exports.default = value;
|
|
exports.LAST_USER_CONTACTS_REQUEST_TIMESTAMP_KEY = 'LAST_USER_CONTACTS_REQUEST_TIMESTAMP_KEY';
|
|
exports.removeLastUserContactsUpload = function() {
|
|
var Storage = require(dependencyMap[11]).Storage;
|
|
Storage.remove('LAST_USER_CONTACTS_REQUEST_TIMESTAMP_KEY');
|
|
};
|
|
}
|
|
|
|
function _isNativeReflectConstruct_92179() { // fn#92179, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12184:313, offset: 0x0207ee72, size: 98 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_92179_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _fun92182() { // fn#92182, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12184:561, offset: 0x0207eed4, size: 36 bytes, params: 1, frame: 12
|
|
const env0_0 = env0_7(_fun92184);
|
|
return _fun92185;
|
|
}
|
|
|
|
function _fun92186(a0) { // fn#92186, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12184:984, offset: 0x0207f06e, size: 42 bytes, params: 2, frame: 14
|
|
const closure = ContactSyncLifecycleManager;
|
|
env0_6(closure, a0);
|
|
return env0_2(closure);
|
|
}
|
|
|
|
function* _fun92184() { // fn#92184, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12184:581, offset: 0x0207ef03, size: 363 bytes, params: 1, frame: 23
|
|
var phone;
|
|
var value7;
|
|
var value8;
|
|
var getCurrentUser;
|
|
var value9;
|
|
var value10;
|
|
var value11;
|
|
var binding2;
|
|
var property;
|
|
var value12;
|
|
var getContacts;
|
|
var getState;
|
|
var value13;
|
|
var storedContacts;
|
|
var value14;
|
|
var value15;
|
|
var value16;
|
|
var names;
|
|
var payload;
|
|
var value17;
|
|
var binding3;
|
|
var value18;
|
|
var uploadContacts;
|
|
var value19;
|
|
var value20;
|
|
var value21;
|
|
var binding4;
|
|
var value22;
|
|
var set;
|
|
var error;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = undefined;
|
|
let binding = env2_0;
|
|
let Storage = binding(env2_1[11]).Storage;
|
|
const value4 = 0;
|
|
const r11 = Storage.get('LAST_USER_CONTACTS_REQUEST_TIMESTAMP_KEY', value4) ?? value4;
|
|
const Date = global.Date;
|
|
const value6 = Date.now();
|
|
reducibleJoin5: while (true) {
|
|
reduciblePort58: while (true) {
|
|
exceptionLanding57: while (true) {
|
|
try {
|
|
value7 = r11 + 86400000;
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
break reducibleJoin5;
|
|
}
|
|
env2_11();
|
|
break reduciblePort58;
|
|
}
|
|
return value;
|
|
}
|
|
try {
|
|
value8 = value7 <= value6;
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
if (value8) {
|
|
try {
|
|
binding = env2_9;
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
try {
|
|
getCurrentUser = binding.getCurrentUser;
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
try {
|
|
value9 = Reflect.apply(getCurrentUser, binding, []);
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
try {
|
|
value10 = value9 == null;
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
reducibleJoin14: while (true) {
|
|
if (value10) {
|
|
phone = value;
|
|
break reducibleJoin14;
|
|
}
|
|
try {
|
|
phone = value9.phone;
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
break reducibleJoin14;
|
|
}
|
|
try {
|
|
value11 = phone == null;
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
if (value11) {
|
|
return value;
|
|
}
|
|
try {
|
|
binding = env2_0;
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
try {
|
|
binding2 = env2_1;
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
try {
|
|
property = binding2[12];
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
try {
|
|
value12 = binding(property);
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
try {
|
|
getContacts = value12.getContacts;
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
try {
|
|
binding = env2_12;
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
try {
|
|
getState = binding.getState;
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
try {
|
|
value13 = Reflect.apply(getState, binding, []);
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
try {
|
|
storedContacts = value13.storedContacts;
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
try {
|
|
value14 = Reflect.apply(getContacts, value12, [phone, storedContacts]);
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
yield value14;
|
|
try {
|
|
value15 = undefined;
|
|
value16 = false;
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
if (value16) {
|
|
return value15;
|
|
}
|
|
try {
|
|
names = value15.names;
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
try {
|
|
payload = value15.payload;
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
try {
|
|
binding = env2_10;
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
try {
|
|
binding(names);
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
try {
|
|
value17 = payload == null;
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
reducibleJoin58: while (true) {
|
|
reducibleJoin53: while (true) {
|
|
if (value17) {
|
|
try {
|
|
binding = env2_0;
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
try {
|
|
binding4 = env2_1;
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
try {
|
|
property = binding4[11];
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
try {
|
|
value22 = binding(property);
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
try {
|
|
Storage = value22.Storage;
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
try {
|
|
set = Storage.set;
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
break reducibleJoin53;
|
|
}
|
|
try {
|
|
binding = env2_0;
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
try {
|
|
binding3 = env2_1;
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
try {
|
|
property = binding3[12];
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
try {
|
|
value18 = binding(property);
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
try {
|
|
uploadContacts = value18.uploadContacts;
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
try {
|
|
value19 = Reflect.apply(uploadContacts, value18, [payload, true]);
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
yield value19;
|
|
try {
|
|
value20 = undefined;
|
|
value21 = false;
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
if (value21) {
|
|
return value20;
|
|
}
|
|
try {
|
|
binding = env2_0;
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
try {
|
|
binding4 = env2_1;
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
try {
|
|
property = binding4[11];
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
try {
|
|
value22 = binding(property);
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
try {
|
|
Storage = value22.Storage;
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
try {
|
|
set = Storage.set;
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
break reducibleJoin53;
|
|
}
|
|
try {
|
|
Reflect.apply(set, Storage, ['LAST_USER_CONTACTS_REQUEST_TIMESTAMP_KEY', value6]);
|
|
} catch (error) {
|
|
break exceptionLanding57;
|
|
}
|
|
break reducibleJoin58;
|
|
}
|
|
}
|
|
return value;
|
|
}
|
|
|
|
function ContactSyncLifecycleManager(a0) { // fn#92187, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12184:996, offset: 0x0207f098, size: 165 bytes, params: 2, frame: 20
|
|
var r0;
|
|
var Reflect;
|
|
let value = copyRestArgs(0, undefined);
|
|
let binding = env1_3;
|
|
binding(this, ContactSyncLifecycleManager);
|
|
const items = [];
|
|
arraySpread(items, value, 0, items);
|
|
value = env1_5(ContactSyncLifecycleManager);
|
|
binding = env1_4;
|
|
if (_isNativeReflectConstruct_92179()) {
|
|
Reflect = global.Reflect;
|
|
value = Reflect.construct(value, items, env1_5(this).constructor);
|
|
r0 = value;
|
|
} else {
|
|
value = value.apply(this, items);
|
|
r0 = value;
|
|
}
|
|
value = binding(this, r0);
|
|
value.actions = {POST_CONNECTION_OPEN: POST_CONNECTION_OPEN_92188};
|
|
value.handleConnectionOpen = handleConnectionOpen_92189;
|
|
return value;
|
|
}
|
|
|
|
function ContactSyncLifecycleManagerHandleConnectionOpen() { // fn#92189, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12184:1348, owner: ContactSyncLifecycleManager.handleConnectionOpen, offset: 0x0207f13d, size: 133 bytes, params: 1, frame: 14
|
|
var environment;
|
|
var value3;
|
|
var moduleValue;
|
|
let value = environment.__proto__.__proto__;
|
|
if (UserStore.getCurrentUser() != null) {
|
|
value3 = ConnectedAccountsStore.getLocalAccount(PlatformTypes.CONTACTS);
|
|
moduleValue = require(11997) /* metro dependency 11997: ContactSyncUtils */;
|
|
if (moduleValue.isContactSyncEnabled(value3)) {
|
|
value = require(11997) /* metro dependency 11997: ContactSyncUtils */;
|
|
value = value.checkContactPermissions();
|
|
value.then(_fun92190);
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun92190(a0) { // fn#92190, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12184:1493, offset: 0x0207f1c2, size: 66 bytes, params: 2, frame: 11
|
|
var environment;
|
|
const value = environment.__proto__.__proto__.__proto__;
|
|
const AUTHORIZED = ContactPermissions.AUTHORIZED;
|
|
if (a0 === AUTHORIZED) {
|
|
(require(5459) /* metro dependency 5459: RunAfterInteractionsUtils */).runAfterInteractions(_fun92191);
|
|
}
|
|
}
|
|
|
|
function _fun92191() { // fn#92191, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12184:1546, offset: 0x0207f204, size: 15 bytes, params: 1, frame: 9
|
|
return env4_15();
|
|
}
|
|
|