Files
discord-decomp/sources/by-id/module-07346.js
T
2026-07-28 01:06:53 +03:00

94 lines
5.4 KiB
JavaScript

/* Metro module 7346; source: unknown; dependencies: [5, 27, 7338, 7339] */
import Module00005 from './module-00005.js'; /* Metro dependency 5 */
import * as ReactNativeModule from './module-00027-ReactNative.js'; /* Metro dependency 27 */
import * as Module07339Module from './module-07339.js'; /* Metro dependency 7339 */
function _fun59142(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#59142, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7524:6, offset: 0x016e1ec0, size: 198 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ReactNativeModule;
const env0_3 = value.Linking;
const {RNIapModule, RNIapModule} = value.NativeModules;
value = _fun59143();
const value2 = _fun59147();
exports.AndroidModule = RNIapModule;
exports.getInstallSourceAndroid = function() {
var property = require(dependencyMap[2]).InstallSourceAndroid;
return RNIapModule ? property.GOOGLE_PLAY : property.AMAZON;
};
exports.deepLinkToSubscriptionsAndroid = value;
exports.validateReceiptAndroid = value2;
exports.acknowledgePurchaseAndroid = acknowledgePurchaseAndroid;
exports.isFeatureSupported = isFeatureSupported;
function _fun59143() { // fn#59143, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7524:180, offset: 0x016e1f86, size: 32 bytes, params: 1, frame: 12
const env0_0 = Module00005(_fun59145);
return deepLinkToSubscriptionsAndroid_59146;
function* _fun59145({sku}) { // fn#59145, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7524:200, offset: 0x016e1faf, size: 136 bytes, params: 2, frame: 18
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
let binding = env2_0;
binding(env2_1[3]).checkNativeAndroidAvailable();
binding = env2_3;
const openURL = binding.openURL;
const binding2 = env2_4;
const getPackageName = binding2.getPackageName;
yield Reflect.apply(getPackageName, binding2, []);
value = undefined;
if (false) {
return value;
}
return Reflect.apply(openURL, binding,
['https://play.google.com/store/account/subscriptions?package=' + value + '&sku=' + sku]);
}
function deepLinkToSubscriptionsAndroid_59146(a0) { // fn#59146, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7524:390, offset: 0x00c3945f, size: 30 bytes, params: 2, frame: 13
return env0_0.apply(this, arguments);
}
}
function _fun59147() { // fn#59147, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7524:470, offset: 0x016e2037, size: 32 bytes, params: 1, frame: 12
const env0_0 = Module00005(_fun59149);
return validateReceiptAndroid;
function validateReceiptAndroid(a0) { // fn#59150, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7524:913, offset: 0x00c3945f, size: 30 bytes, params: 2, frame: 13
return env0_0.apply(this, arguments);
}
}
function acknowledgePurchaseAndroid({token, developerPayload}) { // fn#59152, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7524:1240, offset: 0x016e219c, size: 66 bytes, params: 2, frame: 14
let value = Module07339Module;
value = value.getAndroidModule();
return value.acknowledgePurchase(token, developerPayload);
}
function isFeatureSupported(a0) { // fn#59153, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7524:1395, offset: 0x016e21de, size: 88 bytes, params: 2, frame: 12
return (require(7339) /* metro dependency 7339 */).isAndroid && RNIapModule ? RNIapModule.isFeatureSupported(a0) : global.Promise.reject('This is only available on Android clients');
}
}
function* _fun59149({packageName, productId, productToken, accessToken, isSub}) { // fn#59149, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7524:490, offset: 0x016e2060, size: 262 bytes, params: 2, frame: 29
if (false) {
return undefined;
}
yield global.fetch('https://androidpublisher.googleapis.com/androidpublisher/v3/applications/' + packageName + '/purchases/' + (isSub ? 'subscriptions' : 'products') + '/' + productId + '/tokens/' + productToken + '?access_token=' + accessToken,
{method: 'GET', headers: {['Content-Type']: 'application/json'}});
value = undefined;
if (false) {
return value;
}
if (value.ok) {
return value.json();
}
const Object = global.Object;
const assign = Object.assign;
const Error = global.Error;
throw Reflect.apply(assign, Object, [new Error(value.statusText), {statusCode: value.status}]);
}
global.__d(_fun59142, 7346, [5, 27, 7338, 7339]) /* metro module 7346, dependencies: [5, 27, 7338, 7339] */;