This commit is contained in:
Yamozha
2021-04-02 02:24:13 +03:00
parent c23950b545
commit 7256d79e2c
31493 changed files with 3036630 additions and 0 deletions

2
node_modules/expo-application/.eslintrc.js generated vendored Normal file
View File

@ -0,0 +1,2 @@
// @generated by expo-module-scripts
module.exports = require('expo-module-scripts/eslintrc.base.js');

31
node_modules/expo-application/CHANGELOG.md generated vendored Normal file
View File

@ -0,0 +1,31 @@
# Changelog
## Unpublished
### 🛠 Breaking changes
### 🎉 New features
### 🐛 Bug fixes
## 2.4.1 — 2020-11-25
### 🐛 Bug fixes
- Fixed return type of `getIosIdForVendorAsync` to include possible `null` value which can be returned if the device hasn't been unlocked yet (for more information consult the [Apple documentation for `identifierForVendor`](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor?language=objc)). ([#10997](https://github.com/expo/expo/pull/10997) by [@sjchmiela](https://github.com/sjchmiela))
## 2.4.0 — 2020-11-17
_This version does not introduce any user-facing changes._
## 2.3.0 — 2020-08-18
_This version does not introduce any user-facing changes._
## 2.2.1 — 2020-05-28
*This version does not introduce any user-facing changes.*
## 2.2.0 — 2020-05-27
*This version does not introduce any user-facing changes.*

25
node_modules/expo-application/README.md generated vendored Normal file
View File

@ -0,0 +1,25 @@
# expo-application
Gets native application information such as its ID, app name, and build version at runtime.
# API documentation
- [Documentation for the master branch](https://github.com/expo/expo/blob/master/docs/pages/versions/unversioned/sdk/application.md)
# Installation in managed Expo projects
For managed [managed](https://docs.expo.io/versions/latest/introduction/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](#https://docs.expo.io/versions/latest/sdk/application/).
# Installation in bare React Native projects
For bare React Native projects, you must ensure that you have [installed and configured the `react-native-unimodules` package](https://github.com/expo/expo/tree/master/packages/react-native-unimodules) before continuing.
### Add the package to your npm dependencies
```
expo install expo-application
```
# Contributing
Contributions are very welcome! Please refer to guidelines described in the [contributing guide](https://github.com/expo/expo#contributing).

62
node_modules/expo-application/android/build.gradle generated vendored Normal file
View File

@ -0,0 +1,62 @@
apply plugin: 'com.android.library'
apply plugin: 'maven'
group = 'host.exp.exponent'
version = '2.4.1'
// Simple helper that allows the root project to override versions declared by this library.
def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
// Upload android library to maven with javadoc and android sources
configurations {
deployerJars
}
// Creating sources with comments
task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}
// Put the androidSources and javadoc to the artifacts
artifacts {
archives androidSourcesJar
}
uploadArchives {
repositories {
mavenDeployer {
configuration = configurations.deployerJars
repository(url: mavenLocal().url)
}
}
}
android {
compileSdkVersion safeExtGet("compileSdkVersion", 29)
defaultConfig {
minSdkVersion safeExtGet("minSdkVersion", 21)
targetSdkVersion safeExtGet("targetSdkVersion", 29)
versionCode 11
versionName '2.4.1'
}
lintOptions {
abortOnError false
}
}
if (new File(rootProject.projectDir.parentFile, 'package.json').exists()) {
apply from: project(":unimodules-core").file("../unimodules-core.gradle")
} else {
throw new GradleException(
'\'unimodules-core.gradle\' was not found in the usual React Native dependency location. ' +
'This package can only be used in such projects. Are you sure you\'ve installed the dependencies properly?')
}
dependencies {
unimodule 'unimodules-core'
implementation 'com.android.installreferrer:installreferrer:1.0'
}

View File

@ -0,0 +1,3 @@
<manifest package="expo.modules.application"
xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>

View File

@ -0,0 +1,156 @@
package expo.modules.application;
import android.app.Activity;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.RemoteException;
import android.provider.Settings;
import android.util.Log;
import com.android.installreferrer.api.InstallReferrerClient;
import com.android.installreferrer.api.InstallReferrerStateListener;
import com.android.installreferrer.api.ReferrerDetails;
import org.unimodules.core.ExportedModule;
import org.unimodules.core.ModuleRegistry;
import org.unimodules.core.Promise;
import org.unimodules.core.interfaces.ActivityProvider;
import org.unimodules.core.interfaces.ExpoMethod;
import org.unimodules.core.interfaces.RegistryLifecycleListener;
import java.util.HashMap;
import java.util.Map;
public class ApplicationModule extends ExportedModule implements RegistryLifecycleListener {
private static final String NAME = "ExpoApplication";
private static final String TAG = ApplicationModule.class.getSimpleName();
private ModuleRegistry mModuleRegistry;
private Context mContext;
private ActivityProvider mActivityProvider;
private Activity mActivity;
public ApplicationModule(Context context) {
super(context);
mContext = context;
}
@Override
public String getName() {
return NAME;
}
@Override
public void onCreate(ModuleRegistry moduleRegistry) {
mModuleRegistry = moduleRegistry;
mActivityProvider = moduleRegistry.getModule(ActivityProvider.class);
mActivity = mActivityProvider.getCurrentActivity();
}
@Override
public Map<String, Object> getConstants() {
HashMap<String, Object> constants = new HashMap<>();
String applicationName = mContext.getApplicationInfo().loadLabel(mContext.getPackageManager()).toString();
String packageName = mContext.getPackageName();
constants.put("applicationName", applicationName);
constants.put("applicationId", packageName);
PackageManager packageManager = mContext.getPackageManager();
try {
PackageInfo pInfo = packageManager.getPackageInfo(packageName, 0);
constants.put("nativeApplicationVersion", pInfo.versionName);
int versionCode = (int)getLongVersionCode(pInfo);
constants.put("nativeBuildVersion", Integer.toString(versionCode));
} catch (PackageManager.NameNotFoundException e) {
Log.e(TAG, "Exception: ", e);
}
constants.put("androidId", Settings.Secure.getString(mContext.getContentResolver(), Settings.Secure.ANDROID_ID));
return constants;
}
@ExpoMethod
public void getInstallationTimeAsync(Promise promise) {
PackageManager packageManager = mContext.getPackageManager();
String packageName = mContext.getPackageName();
try {
PackageInfo info = packageManager.getPackageInfo(packageName, 0);
promise.resolve((double)info.firstInstallTime);
} catch (PackageManager.NameNotFoundException e) {
Log.e(TAG, "Exception: ", e);
promise.reject("ERR_APPLICATION_PACKAGE_NAME_NOT_FOUND", "Unable to get install time of this application. Could not get package info or package name.", e);
}
}
@ExpoMethod
public void getLastUpdateTimeAsync(Promise promise) {
PackageManager packageManager = mContext.getPackageManager();
String packageName = mContext.getPackageName();
try {
PackageInfo info = packageManager.getPackageInfo(packageName, 0);
promise.resolve((double)info.lastUpdateTime);
} catch (PackageManager.NameNotFoundException e) {
Log.e(TAG, "Exception: ", e);
promise.reject("ERR_APPLICATION_PACKAGE_NAME_NOT_FOUND", "Unable to get last update time of this application. Could not get package info or package name.", e);
}
}
@ExpoMethod
public void getInstallReferrerAsync(final Promise promise) {
final StringBuilder installReferrer = new StringBuilder();
final InstallReferrerClient referrerClient;
referrerClient = InstallReferrerClient.newBuilder(mContext).build();
referrerClient.startConnection(new InstallReferrerStateListener() {
@Override
public void onInstallReferrerSetupFinished(int responseCode) {
switch (responseCode) {
case InstallReferrerClient.InstallReferrerResponse.OK:
// Connection established and response received
try {
ReferrerDetails response = referrerClient.getInstallReferrer();
installReferrer.append(response.getInstallReferrer());
} catch (RemoteException e) {
Log.e(TAG, "Exception: ", e);
promise.reject("ERR_APPLICATION_INSTALL_REFERRER_REMOTE_EXCEPTION", "RemoteException getting install referrer information. This may happen if the process hosting the remote object is no longer available.", e);
}
promise.resolve(installReferrer.toString());
break;
case InstallReferrerClient.InstallReferrerResponse.FEATURE_NOT_SUPPORTED:
// API not available in the current Play Store app
promise.reject("ERR_APPLICATION_INSTALL_REFERRER_UNAVAILABLE", "The current Play Store app doesn't provide the installation referrer API, or the Play Store may not be installed.");
break;
case InstallReferrerClient.InstallReferrerResponse.SERVICE_UNAVAILABLE:
// Connection could not be established
promise.reject("ERR_APPLICATION_INSTALL_REFERRER_CONNECTION", "Could not establish a connection to Google Play");
break;
default:
promise.reject("ERR_APPLICATION_INSTALL_REFERRER", "General error retrieving the install referrer: response code " + responseCode);
}
referrerClient.endConnection();
}
@Override
public void onInstallReferrerServiceDisconnected() {
promise.reject("ERR_APPLICATION_INSTALL_REFERRER_SERVICE_DISCONNECTED", "Connection to install referrer service was lost.");
}
});
}
private static long getLongVersionCode(PackageInfo info) {
if (Build.VERSION.SDK_INT >= 28) {
return info.getLongVersionCode();
}
return info.versionCode;
}
}

View File

@ -0,0 +1,18 @@
package expo.modules.application;
import android.content.Context;
import java.util.Collections;
import java.util.List;
import org.unimodules.core.BasePackage;
import org.unimodules.core.ExportedModule;
import org.unimodules.core.ViewManager;
public class ApplicationPackage extends BasePackage {
@Override
public List<ExportedModule> createExportedModules(Context context) {
return Collections.singletonList((ExportedModule) new ApplicationModule(context));
}
}

19
node_modules/expo-application/build/Application.d.ts generated vendored Normal file
View File

@ -0,0 +1,19 @@
export declare const nativeApplicationVersion: string | null;
export declare const nativeBuildVersion: string | null;
export declare const applicationName: string | null;
export declare const applicationId: string | null;
export declare const androidId: string | null;
export declare function getInstallReferrerAsync(): Promise<string>;
export declare function getIosIdForVendorAsync(): Promise<string | null>;
export declare enum ApplicationReleaseType {
UNKNOWN = 0,
SIMULATOR = 1,
ENTERPRISE = 2,
DEVELOPMENT = 3,
AD_HOC = 4,
APP_STORE = 5
}
export declare function getIosApplicationReleaseTypeAsync(): Promise<ApplicationReleaseType>;
export declare function getIosPushNotificationServiceEnvironmentAsync(): Promise<string>;
export declare function getInstallationTimeAsync(): Promise<Date>;
export declare function getLastUpdateTimeAsync(): Promise<Date>;

63
node_modules/expo-application/build/Application.js generated vendored Normal file
View File

@ -0,0 +1,63 @@
import { UnavailabilityError } from '@unimodules/core';
import ExpoApplication from './ExpoApplication';
export const nativeApplicationVersion = ExpoApplication
? ExpoApplication.nativeApplicationVersion || null
: null;
export const nativeBuildVersion = ExpoApplication
? ExpoApplication.nativeBuildVersion || null
: null;
export const applicationName = ExpoApplication
? ExpoApplication.applicationName || null
: null;
export const applicationId = ExpoApplication
? ExpoApplication.applicationId || null
: null;
export const androidId = ExpoApplication ? ExpoApplication.androidId || null : null;
export async function getInstallReferrerAsync() {
if (!ExpoApplication.getInstallReferrerAsync) {
throw new UnavailabilityError('expo-application', 'getInstallReferrerAsync');
}
return await ExpoApplication.getInstallReferrerAsync();
}
export async function getIosIdForVendorAsync() {
if (!ExpoApplication.getIosIdForVendorAsync) {
throw new UnavailabilityError('expo-application', 'getIosIdForVendorAsync');
}
return (await ExpoApplication.getIosIdForVendorAsync()) ?? null;
}
export var ApplicationReleaseType;
(function (ApplicationReleaseType) {
ApplicationReleaseType[ApplicationReleaseType["UNKNOWN"] = 0] = "UNKNOWN";
ApplicationReleaseType[ApplicationReleaseType["SIMULATOR"] = 1] = "SIMULATOR";
ApplicationReleaseType[ApplicationReleaseType["ENTERPRISE"] = 2] = "ENTERPRISE";
ApplicationReleaseType[ApplicationReleaseType["DEVELOPMENT"] = 3] = "DEVELOPMENT";
ApplicationReleaseType[ApplicationReleaseType["AD_HOC"] = 4] = "AD_HOC";
ApplicationReleaseType[ApplicationReleaseType["APP_STORE"] = 5] = "APP_STORE";
})(ApplicationReleaseType || (ApplicationReleaseType = {}));
export async function getIosApplicationReleaseTypeAsync() {
if (!ExpoApplication.getApplicationReleaseTypeAsync) {
throw new UnavailabilityError('expo-application', 'getApplicationReleaseTypeAsync');
}
return await ExpoApplication.getApplicationReleaseTypeAsync();
}
export async function getIosPushNotificationServiceEnvironmentAsync() {
if (!ExpoApplication.getPushNotificationServiceEnvironmentAsync) {
throw new UnavailabilityError('expo-application', 'getPushNotificationServiceEnvironmentAsync');
}
return await ExpoApplication.getPushNotificationServiceEnvironmentAsync();
}
export async function getInstallationTimeAsync() {
if (!ExpoApplication.getInstallationTimeAsync) {
throw new UnavailabilityError('expo-application', 'getInstallationTimeAsync');
}
const installationTime = await ExpoApplication.getInstallationTimeAsync();
return new Date(installationTime);
}
export async function getLastUpdateTimeAsync() {
if (!ExpoApplication.getLastUpdateTimeAsync) {
throw new UnavailabilityError('expo-application', 'getLastUpdateTimeAsync');
}
const lastUpdateTime = await ExpoApplication.getLastUpdateTimeAsync();
return new Date(lastUpdateTime);
}
//# sourceMappingURL=Application.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"Application.js","sourceRoot":"","sources":["../src/Application.ts"],"names":[],"mappings":"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","sourcesContent":["import { UnavailabilityError } from '@unimodules/core';\n\nimport ExpoApplication from './ExpoApplication';\n\nexport const nativeApplicationVersion: string | null = ExpoApplication\n ? ExpoApplication.nativeApplicationVersion || null\n : null;\nexport const nativeBuildVersion: string | null = ExpoApplication\n ? ExpoApplication.nativeBuildVersion || null\n : null;\nexport const applicationName: string | null = ExpoApplication\n ? ExpoApplication.applicationName || null\n : null;\nexport const applicationId: string | null = ExpoApplication\n ? ExpoApplication.applicationId || null\n : null;\nexport const androidId: string | null = ExpoApplication ? ExpoApplication.androidId || null : null;\n\nexport async function getInstallReferrerAsync(): Promise<string> {\n if (!ExpoApplication.getInstallReferrerAsync) {\n throw new UnavailabilityError('expo-application', 'getInstallReferrerAsync');\n }\n return await ExpoApplication.getInstallReferrerAsync();\n}\n\nexport async function getIosIdForVendorAsync(): Promise<string | null> {\n if (!ExpoApplication.getIosIdForVendorAsync) {\n throw new UnavailabilityError('expo-application', 'getIosIdForVendorAsync');\n }\n return (await ExpoApplication.getIosIdForVendorAsync()) ?? null;\n}\n\nexport enum ApplicationReleaseType {\n UNKNOWN = 0,\n SIMULATOR = 1,\n ENTERPRISE = 2,\n DEVELOPMENT = 3,\n AD_HOC = 4,\n APP_STORE = 5,\n}\n\nexport async function getIosApplicationReleaseTypeAsync(): Promise<ApplicationReleaseType> {\n if (!ExpoApplication.getApplicationReleaseTypeAsync) {\n throw new UnavailabilityError('expo-application', 'getApplicationReleaseTypeAsync');\n }\n return await ExpoApplication.getApplicationReleaseTypeAsync();\n}\n\nexport async function getIosPushNotificationServiceEnvironmentAsync(): Promise<string> {\n if (!ExpoApplication.getPushNotificationServiceEnvironmentAsync) {\n throw new UnavailabilityError('expo-application', 'getPushNotificationServiceEnvironmentAsync');\n }\n return await ExpoApplication.getPushNotificationServiceEnvironmentAsync();\n}\n\nexport async function getInstallationTimeAsync(): Promise<Date> {\n if (!ExpoApplication.getInstallationTimeAsync) {\n throw new UnavailabilityError('expo-application', 'getInstallationTimeAsync');\n }\n const installationTime = await ExpoApplication.getInstallationTimeAsync();\n return new Date(installationTime);\n}\n\nexport async function getLastUpdateTimeAsync(): Promise<Date> {\n if (!ExpoApplication.getLastUpdateTimeAsync) {\n throw new UnavailabilityError('expo-application', 'getLastUpdateTimeAsync');\n }\n const lastUpdateTime = await ExpoApplication.getLastUpdateTimeAsync();\n return new Date(lastUpdateTime);\n}\n"]}

View File

View File

@ -0,0 +1 @@
//# sourceMappingURL=Application.types.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"Application.types.js","sourceRoot":"","sources":["../src/Application.types.ts"],"names":[],"mappings":"","sourcesContent":[""]}

View File

@ -0,0 +1,2 @@
declare const _default: import("@unimodules/core").ProxyNativeModule;
export default _default;

View File

@ -0,0 +1,3 @@
import { NativeModulesProxy } from '@unimodules/core';
export default NativeModulesProxy.ExpoApplication;
//# sourceMappingURL=ExpoApplication.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"ExpoApplication.js","sourceRoot":"","sources":["../src/ExpoApplication.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,eAAe,kBAAkB,CAAC,eAAe,CAAC","sourcesContent":["import { NativeModulesProxy } from '@unimodules/core';\nexport default NativeModulesProxy.ExpoApplication;\n"]}

View File

@ -0,0 +1,10 @@
declare const _default: {
readonly name: string;
readonly applicationName: null;
readonly bundleId: null;
readonly nativeApplicationVersion: null;
readonly nativeBuildVersion: null;
readonly androidId: null;
getInstallationTimeAsync(): Promise<null>;
};
export default _default;

View File

@ -0,0 +1,24 @@
export default {
get name() {
return 'ExpoApplication';
},
get applicationName() {
return null;
},
get bundleId() {
return null;
},
get nativeApplicationVersion() {
return null;
},
get nativeBuildVersion() {
return null;
},
get androidId() {
return null;
},
async getInstallationTimeAsync() {
return null;
},
};
//# sourceMappingURL=ExpoApplication.web.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"ExpoApplication.web.js","sourceRoot":"","sources":["../src/ExpoApplication.web.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,IAAI,IAAI;QACN,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IACD,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,wBAAwB;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,kBAAkB;QACpB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,SAAS;QACX,OAAO,IAAI,CAAC;IACd,CAAC;IACD,KAAK,CAAC,wBAAwB;QAC5B,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC","sourcesContent":["export default {\n get name(): string {\n return 'ExpoApplication';\n },\n get applicationName(): null {\n return null;\n },\n get bundleId(): null {\n return null;\n },\n get nativeApplicationVersion(): null {\n return null;\n },\n get nativeBuildVersion(): null {\n return null;\n },\n get androidId(): null {\n return null;\n },\n async getInstallationTimeAsync(): Promise<null> {\n return null;\n },\n};\n"]}

View File

@ -0,0 +1,20 @@
require 'json'
package = JSON.parse(File.read(File.join(__dir__, '..', 'package.json')))
Pod::Spec.new do |s|
s.name = 'EXApplication'
s.version = package['version']
s.summary = package['description']
s.description = package['description']
s.license = package['license']
s.author = package['author']
s.homepage = package['homepage']
s.platform = :ios, '10.0'
s.source = { git: 'https://github.com/expo/expo.git' }
s.source_files = 'EXApplication/**/*.{h,m}'
s.preserve_paths = 'EXApplication/**/*.{h,m}'
s.requires_arc = true
s.dependency 'UMCore'
end

View File

@ -0,0 +1,8 @@
// Copyright 2019-present 650 Industries. All rights reserved.
#import <UMCore/UMExportedModule.h>
#import <Foundation/Foundation.h>
@interface EXApplication : UMExportedModule
@end

View File

@ -0,0 +1,57 @@
// Copyright 2018-present 650 Industries. All rights reserved.
#import <UMCore/UMUtilities.h>
#import <EXApplication/EXApplication.h>
#import <UIKit/UIKit.h>
#import <EXApplication/EXProvisioningProfile.h>
@implementation EXApplication
UM_EXPORT_MODULE(ExpoApplication);
- (dispatch_queue_t)methodQueue
{
return dispatch_get_main_queue();
}
UM_EXPORT_METHOD_AS(getIosIdForVendorAsync, getIosIdForVendorAsyncWithResolver:(UMPromiseResolveBlock)resolve rejecter:(UMPromiseRejectBlock)reject)
{
resolve([[UIDevice currentDevice].identifierForVendor UUIDString]);
}
UM_EXPORT_METHOD_AS(getInstallationTimeAsync, getInstallationTimeAsyncWithResolver:(UMPromiseResolveBlock)resolve rejecter:(UMPromiseRejectBlock)reject)
{
NSURL *urlToDocumentsFolder = [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject];
NSError *error = nil;
NSDate *installDate = [[[NSFileManager defaultManager] attributesOfItemAtPath:urlToDocumentsFolder.path error:&error] objectForKey:NSFileCreationDate];
if (error) {
reject(@"ERR_APPLICATION", @"Unable to get installation time of this application.", error);
} else {
NSTimeInterval timeInMilliseconds = [installDate timeIntervalSince1970] * 1000;
NSNumber *timeNumber = @(timeInMilliseconds);
resolve(timeNumber);
}
}
UM_EXPORT_METHOD_AS(getApplicationReleaseTypeAsync, getApplicationReleaseTypeAsyncWithResolver:(UMPromiseResolveBlock)resolve rejecter:(UMPromiseRejectBlock)reject)
{
EXProvisioningProfile *mainProvisioningProfile = [EXProvisioningProfile mainProvisioningProfile];
resolve(@([mainProvisioningProfile appReleaseType]));
}
UM_EXPORT_METHOD_AS(getPushNotificationServiceEnvironmentAsync, getPushNotificationServiceEnvironmentAsyncWithResolver:(UMPromiseResolveBlock)resolve rejecter:(UMPromiseRejectBlock)reject)
{
EXProvisioningProfile *mainProvisioningProfile = [EXProvisioningProfile mainProvisioningProfile];
resolve([mainProvisioningProfile notificationServiceEnvironment]);
}
- (NSDictionary *)constantsToExport
{
return @{
@"applicationName": [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"] ?: [NSNull null],
@"applicationId": [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleIdentifier"] ?: [NSNull null],
@"nativeApplicationVersion": [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"] ?: [NSNull null],
@"nativeBuildVersion": [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]?: [NSNull null],
};
}
@end

View File

@ -0,0 +1,22 @@
// Copyright 2015-present 650 Industries. All rights reserved.
#import <Foundation/Foundation.h>
// Keep in sync with ApplicationReleaseType in JS
typedef NS_ENUM(NSInteger, EXAppReleaseType) {
EXAppReleaseTypeUnknown,
EXAppReleaseSimulator,
EXAppReleaseEnterprise,
EXAppReleaseDev,
EXAppReleaseAdHoc,
EXAppReleaseAppStore
};
@interface EXProvisioningProfile : NSObject
+ (nonnull instancetype)mainProvisioningProfile;
- (EXAppReleaseType)appReleaseType;
- (nullable NSString *)notificationServiceEnvironment;
@end

View File

@ -0,0 +1,134 @@
// Copyright 2015-present 650 Industries. All rights reserved.
#import <EXApplication/EXProvisioningProfile.h>
@implementation EXProvisioningProfile {
NSDictionary *_plist;
}
+ (nonnull instancetype)mainProvisioningProfile
{
static EXProvisioningProfile *profile;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
NSDictionary *plist = [self _readProvisioningProfilePlist];
profile = [[self alloc] initWithPlist:plist];
});
return profile;
}
- (instancetype)initWithPlist:(NSDictionary *)plist
{
if (self = [super init]) {
_plist = plist;
}
return self;
}
- (nullable NSString *)notificationServiceEnvironment
{
if (!_plist) {
return nil;
}
NSDictionary *entitlements = _plist[@"Entitlements"];
NSString *apsEnvironment = entitlements[@"aps-environment"];
return apsEnvironment;
}
- (EXAppReleaseType)appReleaseType {
NSString *provisioningPath = [[NSBundle mainBundle] pathForResource:@"embedded" ofType:@"mobileprovision"];
if (!provisioningPath) {
// provisioning profile does not exist
#if TARGET_IPHONE_SIMULATOR
return EXAppReleaseSimulator;
#else
return EXAppReleaseAppStore;
#endif
}
NSDictionary *mobileProvision = _plist;
if (!mobileProvision) {
// failure to read other than it simply not existing
return EXAppReleaseTypeUnknown;
} else if ([[mobileProvision objectForKey:@"ProvisionsAllDevices"] boolValue]) {
// enterprise distribution contains ProvisionsAllDevices - true
return EXAppReleaseEnterprise;
} else if ([mobileProvision objectForKey:@"ProvisionedDevices"] && [[mobileProvision objectForKey:@"ProvisionedDevices"] count] > 0) {
// development contains UDIDs and get-task-allow is true
// ad hoc contains UDIDs and get-task-allow is false
NSDictionary *entitlements = [mobileProvision objectForKey:@"Entitlements"];
if ([[entitlements objectForKey:@"get-task-allow"] boolValue]) {
return EXAppReleaseDev;
} else {
return EXAppReleaseAdHoc;
}
} else {
// app store contains no UDIDs (if the file exists at all?)
return EXAppReleaseAppStore;
}
}
/** embedded.mobileprovision plist format:
AppIDName, // string TextDetective
ApplicationIdentifierPrefix[], // [ string - 66PK3K3KEV ]
CreationData, // date 2013-01-17T14:18:05Z
DeveloperCertificates[], // [ data ]
Entitlements {
application-identifier // string - 66PK3K3KEV.com.blindsight.textdetective
get-task-allow // true or false
keychain-access-groups[] // [ string - 66PK3K3KEV.* ]
},
ExpirationDate, // date 2014-01-17T14:18:05Z
Name, // string Barrierefreikommunizieren (name assigned to the provisioning profile used)
ProvisionedDevices[], // [ string.... ]
TeamIdentifier[], // [string HHBT96X2EX ]
TeamName, // string The Blindsight Corporation
TimeToLive, // integer - 365
UUID, // string 79F37E8E-CC8D-4819-8C13-A678479211CE
Version, // integer 1
ProvisionsAllDevices // true or false ***NB: not sure if this is where this is
*/
+ (NSDictionary *)_readProvisioningProfilePlist
{
NSString *profilePath = [[NSBundle mainBundle] pathForResource:@"embedded" ofType:@"mobileprovision"];
if (!profilePath) {
return nil;
}
NSError *error;
NSString *profileString = [NSString stringWithContentsOfFile:profilePath encoding:NSASCIIStringEncoding error:&error];
if (!profileString) {
NSLog(@"Error reading provisioning profile: %@", error.localizedDescription);
return nil;
}
NSScanner *scanner = [NSScanner scannerWithString:profileString];
BOOL readPrelude = [scanner scanUpToString:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>" intoString:nil];
if (!readPrelude) {
return nil;
}
NSString *plistString;
BOOL readPlist = [scanner scanUpToString:@"</plist>" intoString:&plistString];
if (!readPlist) {
return nil;
}
plistString = [plistString stringByAppendingString:@"</plist>"];
NSData *plistData = [plistString dataUsingEncoding:NSUTF8StringEncoding];
NSDictionary *plistDictionary = [NSPropertyListSerialization propertyListWithData:plistData
options:NSPropertyListImmutable
format:NULL
error:&error];
if (!plistDictionary) {
NSLog(@"Error unserializing provisioning profile plist: %@", error.localizedDescription);
return nil;
}
return plistDictionary;
}
@end

39
node_modules/expo-application/package.json generated vendored Normal file
View File

@ -0,0 +1,39 @@
{
"name": "expo-application",
"version": "2.4.1",
"description": "A universal module that gets native application information such as its ID, app name, and build version at runtime",
"main": "build/Application.js",
"types": "build/Application.d.ts",
"scripts": {
"build": "expo-module build",
"clean": "expo-module clean",
"lint": "expo-module lint",
"test": "expo-module test",
"prepare": "expo-module prepare",
"prepublishOnly": "expo-module prepublishOnly",
"expo-module": "expo-module"
},
"keywords": [
"react-native",
"expo",
"expo-application"
],
"repository": {
"type": "git",
"url": "https://github.com/expo/expo.git",
"directory": "packages/expo-application"
},
"bugs": {
"url": "https://github.com/expo/expo/issues"
},
"author": "650 Industries, Inc.",
"license": "MIT",
"homepage": "https://docs.expo.io/versions/latest/sdk/application/",
"devDependencies": {
"expo-module-scripts": "~1.2.0"
},
"peerDependencies": {
"@unimodules/core": "*"
},
"gitHead": "88260c85792ac0d8e382de5d2e104cdd13158792"
}

0
node_modules/expo-application/src/.gitkeep generated vendored Normal file
View File

70
node_modules/expo-application/src/Application.ts generated vendored Normal file
View File

@ -0,0 +1,70 @@
import { UnavailabilityError } from '@unimodules/core';
import ExpoApplication from './ExpoApplication';
export const nativeApplicationVersion: string | null = ExpoApplication
? ExpoApplication.nativeApplicationVersion || null
: null;
export const nativeBuildVersion: string | null = ExpoApplication
? ExpoApplication.nativeBuildVersion || null
: null;
export const applicationName: string | null = ExpoApplication
? ExpoApplication.applicationName || null
: null;
export const applicationId: string | null = ExpoApplication
? ExpoApplication.applicationId || null
: null;
export const androidId: string | null = ExpoApplication ? ExpoApplication.androidId || null : null;
export async function getInstallReferrerAsync(): Promise<string> {
if (!ExpoApplication.getInstallReferrerAsync) {
throw new UnavailabilityError('expo-application', 'getInstallReferrerAsync');
}
return await ExpoApplication.getInstallReferrerAsync();
}
export async function getIosIdForVendorAsync(): Promise<string | null> {
if (!ExpoApplication.getIosIdForVendorAsync) {
throw new UnavailabilityError('expo-application', 'getIosIdForVendorAsync');
}
return (await ExpoApplication.getIosIdForVendorAsync()) ?? null;
}
export enum ApplicationReleaseType {
UNKNOWN = 0,
SIMULATOR = 1,
ENTERPRISE = 2,
DEVELOPMENT = 3,
AD_HOC = 4,
APP_STORE = 5,
}
export async function getIosApplicationReleaseTypeAsync(): Promise<ApplicationReleaseType> {
if (!ExpoApplication.getApplicationReleaseTypeAsync) {
throw new UnavailabilityError('expo-application', 'getApplicationReleaseTypeAsync');
}
return await ExpoApplication.getApplicationReleaseTypeAsync();
}
export async function getIosPushNotificationServiceEnvironmentAsync(): Promise<string> {
if (!ExpoApplication.getPushNotificationServiceEnvironmentAsync) {
throw new UnavailabilityError('expo-application', 'getPushNotificationServiceEnvironmentAsync');
}
return await ExpoApplication.getPushNotificationServiceEnvironmentAsync();
}
export async function getInstallationTimeAsync(): Promise<Date> {
if (!ExpoApplication.getInstallationTimeAsync) {
throw new UnavailabilityError('expo-application', 'getInstallationTimeAsync');
}
const installationTime = await ExpoApplication.getInstallationTimeAsync();
return new Date(installationTime);
}
export async function getLastUpdateTimeAsync(): Promise<Date> {
if (!ExpoApplication.getLastUpdateTimeAsync) {
throw new UnavailabilityError('expo-application', 'getLastUpdateTimeAsync');
}
const lastUpdateTime = await ExpoApplication.getLastUpdateTimeAsync();
return new Date(lastUpdateTime);
}

View File

2
node_modules/expo-application/src/ExpoApplication.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { NativeModulesProxy } from '@unimodules/core';
export default NativeModulesProxy.ExpoApplication;

View File

@ -0,0 +1,23 @@
export default {
get name(): string {
return 'ExpoApplication';
},
get applicationName(): null {
return null;
},
get bundleId(): null {
return null;
},
get nativeApplicationVersion(): null {
return null;
},
get nativeBuildVersion(): null {
return null;
},
get androidId(): null {
return null;
},
async getInstallationTimeAsync(): Promise<null> {
return null;
},
};

9
node_modules/expo-application/tsconfig.json generated vendored Normal file
View File

@ -0,0 +1,9 @@
// @generated by expo-module-scripts
{
"extends": "expo-module-scripts/tsconfig.base",
"compilerOptions": {
"outDir": "./build"
},
"include": ["./src"],
"exclude": ["**/__mocks__/*", "**/__tests__/*"]
}

4
node_modules/expo-application/unimodule.json generated vendored Normal file
View File

@ -0,0 +1,4 @@
{
"name": "expo-application",
"platforms": ["ios", "android","web"]
}