@expo/app-integrity 0.0.1-canary-20250722-599a28f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +2 -0
- package/README.md +26 -0
- package/android/build.gradle +23 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/expo/modules/integrity/IntegrityExceptions.kt +9 -0
- package/android/src/main/java/expo/modules/integrity/IntegrityModule.kt +92 -0
- package/build/AppIntegrity.d.ts +6 -0
- package/build/AppIntegrity.d.ts.map +1 -0
- package/build/AppIntegrity.js +33 -0
- package/build/AppIntegrity.js.map +1 -0
- package/build/ExpoAppIntegrity.d.ts +7 -0
- package/build/ExpoAppIntegrity.d.ts.map +1 -0
- package/build/ExpoAppIntegrity.js +6 -0
- package/build/ExpoAppIntegrity.js.map +1 -0
- package/build/ExpoAppIntegrity.types.d.ts +9 -0
- package/build/ExpoAppIntegrity.types.d.ts.map +1 -0
- package/build/ExpoAppIntegrity.types.js +2 -0
- package/build/ExpoAppIntegrity.types.js.map +1 -0
- package/build/ExpoAppIntegrity.web.d.ts +3 -0
- package/build/ExpoAppIntegrity.web.d.ts.map +1 -0
- package/build/ExpoAppIntegrity.web.js +3 -0
- package/build/ExpoAppIntegrity.web.js.map +1 -0
- package/build/index.d.ts +2 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +2 -0
- package/build/index.js.map +1 -0
- package/expo-module.config.json +15 -0
- package/ios/ExpoAppIntegrity.podspec +27 -0
- package/ios/IntegrityExceptions.swift +7 -0
- package/ios/IntegrityModule.swift +69 -0
- package/local-maven-repo/expo/modules/integrity/expo.modules.integrity/0.0.1-canary-20250722-599a28f/expo.modules.integrity-0.0.1-canary-20250722-599a28f-sources.jar +0 -0
- package/local-maven-repo/expo/modules/integrity/expo.modules.integrity/0.0.1-canary-20250722-599a28f/expo.modules.integrity-0.0.1-canary-20250722-599a28f-sources.jar.md5 +1 -0
- package/local-maven-repo/expo/modules/integrity/expo.modules.integrity/0.0.1-canary-20250722-599a28f/expo.modules.integrity-0.0.1-canary-20250722-599a28f-sources.jar.sha1 +1 -0
- package/local-maven-repo/expo/modules/integrity/expo.modules.integrity/0.0.1-canary-20250722-599a28f/expo.modules.integrity-0.0.1-canary-20250722-599a28f-sources.jar.sha256 +1 -0
- package/local-maven-repo/expo/modules/integrity/expo.modules.integrity/0.0.1-canary-20250722-599a28f/expo.modules.integrity-0.0.1-canary-20250722-599a28f-sources.jar.sha512 +1 -0
- package/local-maven-repo/expo/modules/integrity/expo.modules.integrity/0.0.1-canary-20250722-599a28f/expo.modules.integrity-0.0.1-canary-20250722-599a28f.aar +0 -0
- package/local-maven-repo/expo/modules/integrity/expo.modules.integrity/0.0.1-canary-20250722-599a28f/expo.modules.integrity-0.0.1-canary-20250722-599a28f.aar.md5 +1 -0
- package/local-maven-repo/expo/modules/integrity/expo.modules.integrity/0.0.1-canary-20250722-599a28f/expo.modules.integrity-0.0.1-canary-20250722-599a28f.aar.sha1 +1 -0
- package/local-maven-repo/expo/modules/integrity/expo.modules.integrity/0.0.1-canary-20250722-599a28f/expo.modules.integrity-0.0.1-canary-20250722-599a28f.aar.sha256 +1 -0
- package/local-maven-repo/expo/modules/integrity/expo.modules.integrity/0.0.1-canary-20250722-599a28f/expo.modules.integrity-0.0.1-canary-20250722-599a28f.aar.sha512 +1 -0
- package/local-maven-repo/expo/modules/integrity/expo.modules.integrity/0.0.1-canary-20250722-599a28f/expo.modules.integrity-0.0.1-canary-20250722-599a28f.module +94 -0
- package/local-maven-repo/expo/modules/integrity/expo.modules.integrity/0.0.1-canary-20250722-599a28f/expo.modules.integrity-0.0.1-canary-20250722-599a28f.module.md5 +1 -0
- package/local-maven-repo/expo/modules/integrity/expo.modules.integrity/0.0.1-canary-20250722-599a28f/expo.modules.integrity-0.0.1-canary-20250722-599a28f.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/integrity/expo.modules.integrity/0.0.1-canary-20250722-599a28f/expo.modules.integrity-0.0.1-canary-20250722-599a28f.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/integrity/expo.modules.integrity/0.0.1-canary-20250722-599a28f/expo.modules.integrity-0.0.1-canary-20250722-599a28f.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/integrity/expo.modules.integrity/0.0.1-canary-20250722-599a28f/expo.modules.integrity-0.0.1-canary-20250722-599a28f.pom +41 -0
- package/local-maven-repo/expo/modules/integrity/expo.modules.integrity/0.0.1-canary-20250722-599a28f/expo.modules.integrity-0.0.1-canary-20250722-599a28f.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/integrity/expo.modules.integrity/0.0.1-canary-20250722-599a28f/expo.modules.integrity-0.0.1-canary-20250722-599a28f.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/integrity/expo.modules.integrity/0.0.1-canary-20250722-599a28f/expo.modules.integrity-0.0.1-canary-20250722-599a28f.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/integrity/expo.modules.integrity/0.0.1-canary-20250722-599a28f/expo.modules.integrity-0.0.1-canary-20250722-599a28f.pom.sha512 +1 -0
- package/local-maven-repo/expo/modules/integrity/expo.modules.integrity/maven-metadata.xml +13 -0
- package/local-maven-repo/expo/modules/integrity/expo.modules.integrity/maven-metadata.xml.md5 +1 -0
- package/local-maven-repo/expo/modules/integrity/expo.modules.integrity/maven-metadata.xml.sha1 +1 -0
- package/local-maven-repo/expo/modules/integrity/expo.modules.integrity/maven-metadata.xml.sha256 +1 -0
- package/local-maven-repo/expo/modules/integrity/expo.modules.integrity/maven-metadata.xml.sha512 +1 -0
- package/mocks/ExpoAppIntegrity.ts +24 -0
- package/package.json +46 -0
- package/src/AppIntegrity.ts +38 -0
- package/src/ExpoAppIntegrity.ts +8 -0
- package/src/ExpoAppIntegrity.types.ts +11 -0
- package/src/ExpoAppIntegrity.web.ts +2 -0
- package/src/index.ts +1 -0
- package/tsconfig.json +9 -0
package/.eslintrc.js
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# expo-app-integrity
|
|
2
|
+
|
|
3
|
+
A native module that helps assert app integrity on mobile platforms
|
|
4
|
+
|
|
5
|
+
# API documentation
|
|
6
|
+
|
|
7
|
+
- [Documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/app-integrity/)
|
|
8
|
+
- [Documentation for the main branch](https://docs.expo.dev/versions/unversioned/sdk/application/)
|
|
9
|
+
|
|
10
|
+
# Installation in managed Expo projects
|
|
11
|
+
|
|
12
|
+
For [managed](https://docs.expo.dev/archive/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](#https://docs.expo.dev/versions/latest/sdk/app-integrity/).
|
|
13
|
+
|
|
14
|
+
# Installation in bare React Native projects
|
|
15
|
+
|
|
16
|
+
For bare React Native projects, you must ensure that you have [installed and configured the `expo` package](https://docs.expo.dev/bare/installing-expo-modules/) before continuing.
|
|
17
|
+
|
|
18
|
+
### Add the package to your npm dependencies
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
npx expo install @expo/app-integrity
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
# Contributing
|
|
25
|
+
|
|
26
|
+
Contributions are very welcome! Please refer to guidelines described in the [contributing guide](https://github.com/expo/expo#contributing).
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
plugins {
|
|
2
|
+
id 'com.android.library'
|
|
3
|
+
id 'expo-module-gradle-plugin'
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
group = 'expo.modules.integrity'
|
|
7
|
+
version = '0.0.1-canary-20250722-599a28f'
|
|
8
|
+
|
|
9
|
+
android {
|
|
10
|
+
namespace 'expo.modules.integrity'
|
|
11
|
+
defaultConfig {
|
|
12
|
+
versionCode 1
|
|
13
|
+
versionName "0.0.1-canary-20250722-599a28f"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
repositories {
|
|
18
|
+
mavenCentral()
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
dependencies {
|
|
22
|
+
implementation("com.google.android.play:integrity:1.4.0")
|
|
23
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
package expo.modules.integrity
|
|
2
|
+
|
|
3
|
+
import com.google.android.gms.tasks.Task
|
|
4
|
+
import com.google.android.play.core.integrity.StandardIntegrityManager.StandardIntegrityToken
|
|
5
|
+
import com.google.android.play.core.integrity.StandardIntegrityManager.StandardIntegrityTokenRequest
|
|
6
|
+
import com.google.android.play.core.integrity.IntegrityManagerFactory
|
|
7
|
+
import com.google.android.play.core.integrity.StandardIntegrityManager
|
|
8
|
+
import expo.modules.kotlin.modules.Module
|
|
9
|
+
import expo.modules.kotlin.modules.ModuleDefinition
|
|
10
|
+
import expo.modules.kotlin.Promise
|
|
11
|
+
import com.google.android.play.core.integrity.StandardIntegrityManager.PrepareIntegrityTokenRequest
|
|
12
|
+
|
|
13
|
+
class IntegrityModule : Module() {
|
|
14
|
+
private var integrityTokenProvider: StandardIntegrityManager.StandardIntegrityTokenProvider? =
|
|
15
|
+
null
|
|
16
|
+
private var integrityTokenException: Exception? = null
|
|
17
|
+
|
|
18
|
+
companion object {
|
|
19
|
+
private const val PREPARE_INTEGRITY_TOKEN_PROVIDER_METHOD_NAME = "prepareIntegrityTokenProvider"
|
|
20
|
+
private const val REQUEST_INTEGRITY_CHECK_METHOD_NAME = "requestIntegrityCheck"
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
override fun definition() = ModuleDefinition {
|
|
24
|
+
Name("ExpoAppIntegrity")
|
|
25
|
+
|
|
26
|
+
AsyncFunction(PREPARE_INTEGRITY_TOKEN_PROVIDER_METHOD_NAME) { cloudProjectNumber: String, promise: Promise ->
|
|
27
|
+
val cloudProjectNumberLong = cloudProjectNumber.toLongOrNull()
|
|
28
|
+
|
|
29
|
+
if (cloudProjectNumberLong == null) {
|
|
30
|
+
promise.reject(IntegrityException("Invalid cloud project number: '$cloudProjectNumber'. It must be a valid number."))
|
|
31
|
+
return@AsyncFunction
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
val integrityManager =
|
|
35
|
+
IntegrityManagerFactory.createStandard(appContext.reactContext?.applicationContext)
|
|
36
|
+
integrityManager.prepareIntegrityToken(
|
|
37
|
+
PrepareIntegrityTokenRequest.builder()
|
|
38
|
+
.setCloudProjectNumber(cloudProjectNumberLong)
|
|
39
|
+
.build()
|
|
40
|
+
).addOnSuccessListener {
|
|
41
|
+
integrityTokenProvider = it
|
|
42
|
+
integrityTokenException = null
|
|
43
|
+
promise.resolve()
|
|
44
|
+
}.addOnFailureListener {
|
|
45
|
+
integrityTokenException = it
|
|
46
|
+
promise.reject(
|
|
47
|
+
IntegrityException(
|
|
48
|
+
integrityTokenException?.message ?: "Unknown error",
|
|
49
|
+
integrityTokenException
|
|
50
|
+
)
|
|
51
|
+
)
|
|
52
|
+
}.addOnCanceledListener {
|
|
53
|
+
promise.reject(
|
|
54
|
+
IntegrityException("Request cancelled")
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
AsyncFunction(REQUEST_INTEGRITY_CHECK_METHOD_NAME) { challenge: String, promise: Promise ->
|
|
60
|
+
integrityTokenProvider?.let {
|
|
61
|
+
val integrityTokenResponse: Task<StandardIntegrityToken> =
|
|
62
|
+
it.request(
|
|
63
|
+
StandardIntegrityTokenRequest.builder()
|
|
64
|
+
.setRequestHash(challenge)
|
|
65
|
+
.build()
|
|
66
|
+
)
|
|
67
|
+
integrityTokenResponse
|
|
68
|
+
.addOnSuccessListener { response: StandardIntegrityToken ->
|
|
69
|
+
promise.resolve(
|
|
70
|
+
response.token()
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
.addOnFailureListener { exception: Exception? ->
|
|
74
|
+
promise.reject(
|
|
75
|
+
IntegrityException(exception?.message ?: "Unknown error", exception)
|
|
76
|
+
)
|
|
77
|
+
}
|
|
78
|
+
.addOnCanceledListener {
|
|
79
|
+
promise.reject(
|
|
80
|
+
IntegrityException("Request cancelled")
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
} ?: promise.reject(
|
|
84
|
+
IntegrityException(
|
|
85
|
+
integrityTokenException?.message
|
|
86
|
+
?: "Make sure $PREPARE_INTEGRITY_TOKEN_PROVIDER_METHOD_NAME is called before $REQUEST_INTEGRITY_CHECK_METHOD_NAME",
|
|
87
|
+
integrityTokenException
|
|
88
|
+
)
|
|
89
|
+
)
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function generateKey(): Promise<string>;
|
|
2
|
+
export declare function attestKey(key: string, challenge: string): Promise<string>;
|
|
3
|
+
export declare function generateAssertion(key: string, json: string): Promise<string>;
|
|
4
|
+
export declare function requestIntegrityCheck(challenge: string): Promise<string>;
|
|
5
|
+
export declare function prepareIntegrityTokenProvider(cloudProjectNumber: string): Promise<void>;
|
|
6
|
+
//# sourceMappingURL=AppIntegrity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppIntegrity.d.ts","sourceRoot":"","sources":["../src/AppIntegrity.ts"],"names":[],"mappings":"AAIA,wBAAsB,WAAW,oBAKhC;AAED,wBAAsB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,mBAK7D;AAED,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,mBAKhE;AAED,wBAAsB,qBAAqB,CAAC,SAAS,EAAE,MAAM,mBAK5D;AAED,wBAAsB,6BAA6B,CAAC,kBAAkB,EAAE,MAAM,iBAK7E"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
import ExpoAppIntegrity from './ExpoAppIntegrity';
|
|
3
|
+
export async function generateKey() {
|
|
4
|
+
if (Platform.OS !== 'ios') {
|
|
5
|
+
throw new Error('generateAssertion is only available on iOS');
|
|
6
|
+
}
|
|
7
|
+
return ExpoAppIntegrity.generateKey();
|
|
8
|
+
}
|
|
9
|
+
export async function attestKey(key, challenge) {
|
|
10
|
+
if (Platform.OS !== 'ios') {
|
|
11
|
+
throw new Error('generateAssertion is only available on iOS');
|
|
12
|
+
}
|
|
13
|
+
return ExpoAppIntegrity.attestKey(key, challenge);
|
|
14
|
+
}
|
|
15
|
+
export async function generateAssertion(key, json) {
|
|
16
|
+
if (Platform.OS !== 'ios') {
|
|
17
|
+
throw new Error('generateAssertion is only available on iOS');
|
|
18
|
+
}
|
|
19
|
+
return ExpoAppIntegrity.generateAssertion(key, json);
|
|
20
|
+
}
|
|
21
|
+
export async function requestIntegrityCheck(challenge) {
|
|
22
|
+
if (Platform.OS !== 'android') {
|
|
23
|
+
throw new Error('requestIntegrityCheck is only available on Android');
|
|
24
|
+
}
|
|
25
|
+
return ExpoAppIntegrity.requestIntegrityCheck(challenge);
|
|
26
|
+
}
|
|
27
|
+
export async function prepareIntegrityTokenProvider(cloudProjectNumber) {
|
|
28
|
+
if (Platform.OS !== 'android') {
|
|
29
|
+
throw new Error('prepareIntegrityTokenProvider is only available on Android');
|
|
30
|
+
}
|
|
31
|
+
return ExpoAppIntegrity.prepareIntegrityTokenProvider(cloudProjectNumber);
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=AppIntegrity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppIntegrity.js","sourceRoot":"","sources":["../src/AppIntegrity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAElD,MAAM,CAAC,KAAK,UAAU,WAAW;IAC/B,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;IAChE,CAAC;IACD,OAAO,gBAAgB,CAAC,WAAW,EAAE,CAAC;AACxC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,GAAW,EAAE,SAAiB;IAC5D,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;IAChE,CAAC;IACD,OAAO,gBAAgB,CAAC,SAAS,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,GAAW,EAAE,IAAY;IAC/D,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;IAChE,CAAC;IACD,OAAO,gBAAgB,CAAC,iBAAiB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AACvD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,SAAiB;IAC3D,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IACxE,CAAC;IACD,OAAO,gBAAgB,CAAC,qBAAqB,CAAC,SAAS,CAAC,CAAC;AAC3D,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,6BAA6B,CAAC,kBAA0B;IAC5E,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;IAChF,CAAC;IACD,OAAO,gBAAgB,CAAC,6BAA6B,CAAC,kBAAkB,CAAC,CAAC;AAC5E,CAAC","sourcesContent":["import { Platform } from 'react-native';\n\nimport ExpoAppIntegrity from './ExpoAppIntegrity';\n\nexport async function generateKey() {\n if (Platform.OS !== 'ios') {\n throw new Error('generateAssertion is only available on iOS');\n }\n return ExpoAppIntegrity.generateKey();\n}\n\nexport async function attestKey(key: string, challenge: string) {\n if (Platform.OS !== 'ios') {\n throw new Error('generateAssertion is only available on iOS');\n }\n return ExpoAppIntegrity.attestKey(key, challenge);\n}\n\nexport async function generateAssertion(key: string, json: string) {\n if (Platform.OS !== 'ios') {\n throw new Error('generateAssertion is only available on iOS');\n }\n return ExpoAppIntegrity.generateAssertion(key, json);\n}\n\nexport async function requestIntegrityCheck(challenge: string) {\n if (Platform.OS !== 'android') {\n throw new Error('requestIntegrityCheck is only available on Android');\n }\n return ExpoAppIntegrity.requestIntegrityCheck(challenge);\n}\n\nexport async function prepareIntegrityTokenProvider(cloudProjectNumber: string) {\n if (Platform.OS !== 'android') {\n throw new Error('prepareIntegrityTokenProvider is only available on Android');\n }\n return ExpoAppIntegrity.prepareIntegrityTokenProvider(cloudProjectNumber);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoAppIntegrity.d.ts","sourceRoot":"","sources":["../src/ExpoAppIntegrity.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE;;GAEG;;AACH,wBAA+E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoAppIntegrity.js","sourceRoot":"","sources":["../src/ExpoAppIntegrity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAIxD;;GAEG;AACH,eAAe,mBAAmB,CAAyB,kBAAkB,CAAC,CAAC","sourcesContent":["import { requireNativeModule } from 'expo-modules-core';\n\nimport { ExpoAppIntegrityModule } from './ExpoAppIntegrity.types';\n\n/**\n * @hidden\n */\nexport default requireNativeModule<ExpoAppIntegrityModule>('ExpoAppIntegrity');\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NativeModule } from 'expo-modules-core/types';
|
|
2
|
+
export interface ExpoAppIntegrityModule extends NativeModule {
|
|
3
|
+
generateKey(): Promise<string>;
|
|
4
|
+
attestKey(key: string, challenge: string): Promise<string>;
|
|
5
|
+
generateAssertion(key: string, challenge: string): Promise<string>;
|
|
6
|
+
prepareIntegrityTokenProvider(cloudProjectNumber: string): Promise<void>;
|
|
7
|
+
requestIntegrityCheck(challenge: string): Promise<string>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=ExpoAppIntegrity.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoAppIntegrity.types.d.ts","sourceRoot":"","sources":["../src/ExpoAppIntegrity.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,MAAM,WAAW,sBAAuB,SAAQ,YAAY;IAE1D,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/B,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC3D,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnE,6BAA6B,CAAC,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzE,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC3D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoAppIntegrity.types.js","sourceRoot":"","sources":["../src/ExpoAppIntegrity.types.ts"],"names":[],"mappings":"","sourcesContent":["import { NativeModule } from 'expo-modules-core/types';\n\nexport interface ExpoAppIntegrityModule extends NativeModule {\n // iOS\n generateKey(): Promise<string>;\n attestKey(key: string, challenge: string): Promise<string>;\n generateAssertion(key: string, challenge: string): Promise<string>;\n // Android\n prepareIntegrityTokenProvider(cloudProjectNumber: string): Promise<void>;\n requestIntegrityCheck(challenge: string): Promise<string>;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoAppIntegrity.web.d.ts","sourceRoot":"","sources":["../src/ExpoAppIntegrity.web.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,gBAAgB,EAAE,GAAQ,CAAC;AACjC,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoAppIntegrity.web.js","sourceRoot":"","sources":["../src/ExpoAppIntegrity.web.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAQ,EAAE,CAAC;AACjC,eAAe,gBAAgB,CAAC","sourcesContent":["const ExpoAppIntegrity: any = {};\nexport default ExpoAppIntegrity;\n"]}
|
package/build/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
package/build/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC","sourcesContent":["export * from './AppIntegrity';\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"platforms": ["apple", "android"],
|
|
3
|
+
"apple": {
|
|
4
|
+
"modules": ["IntegrityModule"]
|
|
5
|
+
},
|
|
6
|
+
"android": {
|
|
7
|
+
"modules": ["expo.modules.integrity.IntegrityModule"],
|
|
8
|
+
"publication": {
|
|
9
|
+
"groupId": "expo.modules.integrity",
|
|
10
|
+
"artifactId": "expo.modules.integrity",
|
|
11
|
+
"version": "0.0.1-canary-20250722-599a28f",
|
|
12
|
+
"repository": "local-maven-repo"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
require 'json'
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, '..', 'package.json')))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = 'ExpoAppIntegrity'
|
|
7
|
+
s.version = package['version']
|
|
8
|
+
s.summary = package['description']
|
|
9
|
+
s.description = package['description']
|
|
10
|
+
s.license = package['license']
|
|
11
|
+
s.author = package['author']
|
|
12
|
+
s.homepage = package['homepage']
|
|
13
|
+
s.platforms = {
|
|
14
|
+
:ios => '15.1'
|
|
15
|
+
}
|
|
16
|
+
s.swift_version = '5.9'
|
|
17
|
+
s.source = { git: 'https://github.com/expo/expo.git' }
|
|
18
|
+
s.static_framework = true
|
|
19
|
+
|
|
20
|
+
s.dependency 'ExpoModulesCore'
|
|
21
|
+
|
|
22
|
+
s.pod_target_xcconfig = {
|
|
23
|
+
'DEFINES_MODULE' => 'YES',
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
s.source_files = "**/*.{h,m,swift}"
|
|
27
|
+
end
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import ExpoModulesCore
|
|
2
|
+
import DeviceCheck
|
|
3
|
+
import CryptoKit
|
|
4
|
+
|
|
5
|
+
public class IntegrityModule: Module {
|
|
6
|
+
private let service = DCAppAttestService.shared
|
|
7
|
+
|
|
8
|
+
public func definition() -> ModuleDefinition {
|
|
9
|
+
Name("ExpoAppIntegrity")
|
|
10
|
+
|
|
11
|
+
AsyncFunction("generateKey") {
|
|
12
|
+
do {
|
|
13
|
+
return try await service.generateKey()
|
|
14
|
+
} catch let error {
|
|
15
|
+
throw handleIntegrityCheckError(error)
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
AsyncFunction("attestKey") { (key: String, challenge: String) in
|
|
20
|
+
let data = Data(challenge.utf8)
|
|
21
|
+
let clientDataHash = Data(SHA256.hash(data: data))
|
|
22
|
+
|
|
23
|
+
do {
|
|
24
|
+
let result = try await service.attestKey(key, clientDataHash: clientDataHash)
|
|
25
|
+
guard let attestation = String(data: result, encoding: .utf8) else {
|
|
26
|
+
throw IntegrityException("Failed to decode attestation result from data")
|
|
27
|
+
}
|
|
28
|
+
return attestation
|
|
29
|
+
} catch let error {
|
|
30
|
+
throw handleIntegrityCheckError(error)
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
AsyncFunction("generateAssertion") { (key: String, challenge: String) -> String in
|
|
35
|
+
let data = Data(challenge.utf8)
|
|
36
|
+
let clientDataHash = Data(SHA256.hash(data: data))
|
|
37
|
+
do {
|
|
38
|
+
let result = try await service.generateAssertion(key, clientDataHash: clientDataHash)
|
|
39
|
+
guard let assertion = String(data: result, encoding: .utf8) else {
|
|
40
|
+
throw IntegrityException("Failed to decode assertion result from data")
|
|
41
|
+
}
|
|
42
|
+
return assertion
|
|
43
|
+
} catch let error {
|
|
44
|
+
throw handleIntegrityCheckError(error)
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
private func handleIntegrityCheckError(_ error: Error) -> Exception {
|
|
50
|
+
if let error = error as? DCError {
|
|
51
|
+
switch error.code {
|
|
52
|
+
case .featureUnsupported:
|
|
53
|
+
return IntegrityException("This feature is not supported on this device")
|
|
54
|
+
case .invalidInput:
|
|
55
|
+
return IntegrityException("Invalid input provided")
|
|
56
|
+
case .invalidKey:
|
|
57
|
+
return IntegrityException("Invalid key provided")
|
|
58
|
+
case .serverUnavailable:
|
|
59
|
+
return IntegrityException("Server unavailable")
|
|
60
|
+
case .unknownSystemFailure:
|
|
61
|
+
return IntegrityException("Unknown system failure")
|
|
62
|
+
@unknown default:
|
|
63
|
+
return IntegrityException("Unknown error")
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return IntegrityException("Unknown error")
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2dbfc27d79b28d2210235ff5159c119a
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
e92b5a8d9f29deeab6565df6547a9a0b2a1435e8
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
6c973c76222c036940bf544bb9fe9309491f9b4950f6a804e8c86aa2a566849c
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
d800412ce52e06910da8607fede214fe64f702bfee9bae7e4411f0280bf75d08eaef4f707170c1d9e8ccc2bca9cd9b21860ecdef8f7abb145dc7ffa185ab90f5
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
da205ff9b2b9d4d562c2be60f27ee7da
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
a7d4b305c3bffb430a4b819ead415c0b38ba1841
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
167943fdb7f02edbbf83b43b3a4495e80f79218f6515167396dde773fff7e05e
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
acf863acf66a89fd0122aed6945afa5263c402aadc4dd77e02d96493c30dec50ff526bfe23a12a06f0eaf7949a41ead0bb9a8d428f546bfb140b266705088ff7
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
{
|
|
2
|
+
"formatVersion": "1.1",
|
|
3
|
+
"component": {
|
|
4
|
+
"group": "expo.modules.integrity",
|
|
5
|
+
"module": "expo.modules.integrity",
|
|
6
|
+
"version": "0.0.1-canary-20250722-599a28f",
|
|
7
|
+
"attributes": {
|
|
8
|
+
"org.gradle.status": "release"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"createdBy": {
|
|
12
|
+
"gradle": {
|
|
13
|
+
"version": "8.14"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"variants": [
|
|
17
|
+
{
|
|
18
|
+
"name": "releaseVariantReleaseApiPublication",
|
|
19
|
+
"attributes": {
|
|
20
|
+
"org.gradle.category": "library",
|
|
21
|
+
"org.gradle.dependency.bundling": "external",
|
|
22
|
+
"org.gradle.libraryelements": "aar",
|
|
23
|
+
"org.gradle.usage": "java-api"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
{
|
|
27
|
+
"name": "expo.modules.integrity-0.0.1-canary-20250722-599a28f.aar",
|
|
28
|
+
"url": "expo.modules.integrity-0.0.1-canary-20250722-599a28f.aar",
|
|
29
|
+
"size": 18424,
|
|
30
|
+
"sha512": "acf863acf66a89fd0122aed6945afa5263c402aadc4dd77e02d96493c30dec50ff526bfe23a12a06f0eaf7949a41ead0bb9a8d428f546bfb140b266705088ff7",
|
|
31
|
+
"sha256": "167943fdb7f02edbbf83b43b3a4495e80f79218f6515167396dde773fff7e05e",
|
|
32
|
+
"sha1": "a7d4b305c3bffb430a4b819ead415c0b38ba1841",
|
|
33
|
+
"md5": "da205ff9b2b9d4d562c2be60f27ee7da"
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "releaseVariantReleaseRuntimePublication",
|
|
39
|
+
"attributes": {
|
|
40
|
+
"org.gradle.category": "library",
|
|
41
|
+
"org.gradle.dependency.bundling": "external",
|
|
42
|
+
"org.gradle.libraryelements": "aar",
|
|
43
|
+
"org.gradle.usage": "java-runtime"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": [
|
|
46
|
+
{
|
|
47
|
+
"group": "org.jetbrains.kotlin",
|
|
48
|
+
"module": "kotlin-stdlib-jdk7",
|
|
49
|
+
"version": {
|
|
50
|
+
"requires": "2.1.20"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"group": "com.google.android.play",
|
|
55
|
+
"module": "integrity",
|
|
56
|
+
"version": {
|
|
57
|
+
"requires": "1.4.0"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"files": [
|
|
62
|
+
{
|
|
63
|
+
"name": "expo.modules.integrity-0.0.1-canary-20250722-599a28f.aar",
|
|
64
|
+
"url": "expo.modules.integrity-0.0.1-canary-20250722-599a28f.aar",
|
|
65
|
+
"size": 18424,
|
|
66
|
+
"sha512": "acf863acf66a89fd0122aed6945afa5263c402aadc4dd77e02d96493c30dec50ff526bfe23a12a06f0eaf7949a41ead0bb9a8d428f546bfb140b266705088ff7",
|
|
67
|
+
"sha256": "167943fdb7f02edbbf83b43b3a4495e80f79218f6515167396dde773fff7e05e",
|
|
68
|
+
"sha1": "a7d4b305c3bffb430a4b819ead415c0b38ba1841",
|
|
69
|
+
"md5": "da205ff9b2b9d4d562c2be60f27ee7da"
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "releaseVariantReleaseSourcePublication",
|
|
75
|
+
"attributes": {
|
|
76
|
+
"org.gradle.category": "documentation",
|
|
77
|
+
"org.gradle.dependency.bundling": "external",
|
|
78
|
+
"org.gradle.docstype": "sources",
|
|
79
|
+
"org.gradle.usage": "java-runtime"
|
|
80
|
+
},
|
|
81
|
+
"files": [
|
|
82
|
+
{
|
|
83
|
+
"name": "expo.modules.integrity-0.0.1-canary-20250722-599a28f-sources.jar",
|
|
84
|
+
"url": "expo.modules.integrity-0.0.1-canary-20250722-599a28f-sources.jar",
|
|
85
|
+
"size": 2322,
|
|
86
|
+
"sha512": "d800412ce52e06910da8607fede214fe64f702bfee9bae7e4411f0280bf75d08eaef4f707170c1d9e8ccc2bca9cd9b21860ecdef8f7abb145dc7ffa185ab90f5",
|
|
87
|
+
"sha256": "6c973c76222c036940bf544bb9fe9309491f9b4950f6a804e8c86aa2a566849c",
|
|
88
|
+
"sha1": "e92b5a8d9f29deeab6565df6547a9a0b2a1435e8",
|
|
89
|
+
"md5": "2dbfc27d79b28d2210235ff5159c119a"
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
c09a39fa1768b3de7d69be9e3a54fdea
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
bf53bffaa569a555096fc732239fa7f3c39e4568
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
c6f798ec16d2fd0ca9bce9fb9b375d06152d6fcd6fb500bcd5713ecfa8977bbb
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
25d1faf4846a4ac3faeab72f546f049d527e64da90543e9ec0314cae7391a1bd8f03664b85b4aab9ae484bf4be7b865680bc8aa733b839b0aa7ddf0580890ac8
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
|
3
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
4
|
+
<!-- This module was also published with a richer model, Gradle metadata, -->
|
|
5
|
+
<!-- which should be used instead. Do not delete the following line which -->
|
|
6
|
+
<!-- is to indicate to Gradle or any Gradle module metadata file consumer -->
|
|
7
|
+
<!-- that they should prefer consuming it instead. -->
|
|
8
|
+
<!-- do_not_remove: published-with-gradle-metadata -->
|
|
9
|
+
<modelVersion>4.0.0</modelVersion>
|
|
10
|
+
<groupId>expo.modules.integrity</groupId>
|
|
11
|
+
<artifactId>expo.modules.integrity</artifactId>
|
|
12
|
+
<version>0.0.1-canary-20250722-599a28f</version>
|
|
13
|
+
<packaging>aar</packaging>
|
|
14
|
+
<name>expo.modules.integrity</name>
|
|
15
|
+
<url>https://github.com/expo/expo</url>
|
|
16
|
+
<licenses>
|
|
17
|
+
<license>
|
|
18
|
+
<name>MIT License</name>
|
|
19
|
+
<url>https://github.com/expo/expo/blob/main/LICENSE</url>
|
|
20
|
+
</license>
|
|
21
|
+
</licenses>
|
|
22
|
+
<scm>
|
|
23
|
+
<connection>https://github.com/expo/expo.git</connection>
|
|
24
|
+
<developerConnection>https://github.com/expo/expo.git</developerConnection>
|
|
25
|
+
<url>https://github.com/expo/expo</url>
|
|
26
|
+
</scm>
|
|
27
|
+
<dependencies>
|
|
28
|
+
<dependency>
|
|
29
|
+
<groupId>org.jetbrains.kotlin</groupId>
|
|
30
|
+
<artifactId>kotlin-stdlib-jdk7</artifactId>
|
|
31
|
+
<version>2.1.20</version>
|
|
32
|
+
<scope>runtime</scope>
|
|
33
|
+
</dependency>
|
|
34
|
+
<dependency>
|
|
35
|
+
<groupId>com.google.android.play</groupId>
|
|
36
|
+
<artifactId>integrity</artifactId>
|
|
37
|
+
<version>1.4.0</version>
|
|
38
|
+
<scope>runtime</scope>
|
|
39
|
+
</dependency>
|
|
40
|
+
</dependencies>
|
|
41
|
+
</project>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
656e053747b5c6c02e0539076961645e
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
8ea97bb1c5ba42571aac0a0e76b825f6de643fd1
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
b76acad6f018745b2fcc6f13541ef2c4ec5c4e9db8d90db6baa69cd879cfdbec
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
87c5c74526a542a7fd839559e35c5e573d5ef5842d6397a4afbf771d5b7701b3bf8807f2dd5c98d084ccdf61da9ea414aa47843d7f77ae6b017945f3c1ea8e87
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<metadata>
|
|
3
|
+
<groupId>expo.modules.integrity</groupId>
|
|
4
|
+
<artifactId>expo.modules.integrity</artifactId>
|
|
5
|
+
<versioning>
|
|
6
|
+
<latest>0.0.1-canary-20250722-599a28f</latest>
|
|
7
|
+
<release>0.0.1-canary-20250722-599a28f</release>
|
|
8
|
+
<versions>
|
|
9
|
+
<version>0.0.1-canary-20250722-599a28f</version>
|
|
10
|
+
</versions>
|
|
11
|
+
<lastUpdated>20250722134616</lastUpdated>
|
|
12
|
+
</versioning>
|
|
13
|
+
</metadata>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
702f22e2fe449b0aca1d5f93dd0d99bc
|
package/local-maven-repo/expo/modules/integrity/expo.modules.integrity/maven-metadata.xml.sha1
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
e2bba48f59a48016eaf9fd54aad1ecac53fc6c2e
|
package/local-maven-repo/expo/modules/integrity/expo.modules.integrity/maven-metadata.xml.sha256
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
c4b8ae8302c9671814f92dc4b337bb39edd9e330ebe3ee513ca6ea6ea12fe9e0
|
package/local-maven-repo/expo/modules/integrity/expo.modules.integrity/maven-metadata.xml.sha512
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
94419e981fb735cc0f3bb172dd4638b23c54f94f9ddbea5df8cd13be105b016ba67729f42fc68987f4dac8621521a92b5239b7805d26794869d5d022d9b53e54
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Automatically generated by expo-modules-test-core.
|
|
3
|
+
*
|
|
4
|
+
* This autogenerated file provides a mock for native Expo module,
|
|
5
|
+
* and works out of the box with the expo jest preset.
|
|
6
|
+
* */
|
|
7
|
+
|
|
8
|
+
export async function generateKey(): Promise<any> {
|
|
9
|
+
return 'mock-key';
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export async function attestKey(key: string, challenge: string): Promise<any> {
|
|
13
|
+
return 'mock-attestation';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export async function generateAssertion(key: string, challenge: string): Promise<string> {
|
|
17
|
+
return '';
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export async function requestIntegrityCheck(challenge: string): Promise<string> {
|
|
21
|
+
return '';
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export async function prepareIntegrityTokenProvider(cloudProjectNumber: string): Promise<void> {}
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@expo/app-integrity",
|
|
3
|
+
"version": "0.0.1-canary-20250722-599a28f",
|
|
4
|
+
"description": "A native module that helps assert app integrity on mobile platforms",
|
|
5
|
+
"sideEffects": false,
|
|
6
|
+
"main": "build/index.js",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "expo-module build",
|
|
9
|
+
"clean": "expo-module clean",
|
|
10
|
+
"lint": "expo-module lint",
|
|
11
|
+
"test": "expo-module test",
|
|
12
|
+
"prepare": "expo-module prepare",
|
|
13
|
+
"prepublishOnly": "expo-module prepublishOnly",
|
|
14
|
+
"expo-module": "expo-module"
|
|
15
|
+
},
|
|
16
|
+
"homepage": "https://docs.expo.dev/versions/latest/sdk/app-integrity/",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/expo/expo.git",
|
|
20
|
+
"directory": "packages/expo-app-integrity"
|
|
21
|
+
},
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/expo/expo/issues"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"react-native",
|
|
27
|
+
"expo",
|
|
28
|
+
"integrity",
|
|
29
|
+
"app-integrity",
|
|
30
|
+
"ios",
|
|
31
|
+
"android"
|
|
32
|
+
],
|
|
33
|
+
"author": "650 Industries, Inc.",
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"jest": {
|
|
36
|
+
"preset": "expo-module-scripts"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"expo-module-scripts": "4.1.10-canary-20250722-599a28f"
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"expo": "*",
|
|
44
|
+
"react-native": "*"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import ExpoAppIntegrity from './ExpoAppIntegrity';
|
|
4
|
+
|
|
5
|
+
export async function generateKey() {
|
|
6
|
+
if (Platform.OS !== 'ios') {
|
|
7
|
+
throw new Error('generateAssertion is only available on iOS');
|
|
8
|
+
}
|
|
9
|
+
return ExpoAppIntegrity.generateKey();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export async function attestKey(key: string, challenge: string) {
|
|
13
|
+
if (Platform.OS !== 'ios') {
|
|
14
|
+
throw new Error('generateAssertion is only available on iOS');
|
|
15
|
+
}
|
|
16
|
+
return ExpoAppIntegrity.attestKey(key, challenge);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export async function generateAssertion(key: string, json: string) {
|
|
20
|
+
if (Platform.OS !== 'ios') {
|
|
21
|
+
throw new Error('generateAssertion is only available on iOS');
|
|
22
|
+
}
|
|
23
|
+
return ExpoAppIntegrity.generateAssertion(key, json);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export async function requestIntegrityCheck(challenge: string) {
|
|
27
|
+
if (Platform.OS !== 'android') {
|
|
28
|
+
throw new Error('requestIntegrityCheck is only available on Android');
|
|
29
|
+
}
|
|
30
|
+
return ExpoAppIntegrity.requestIntegrityCheck(challenge);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export async function prepareIntegrityTokenProvider(cloudProjectNumber: string) {
|
|
34
|
+
if (Platform.OS !== 'android') {
|
|
35
|
+
throw new Error('prepareIntegrityTokenProvider is only available on Android');
|
|
36
|
+
}
|
|
37
|
+
return ExpoAppIntegrity.prepareIntegrityTokenProvider(cloudProjectNumber);
|
|
38
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NativeModule } from 'expo-modules-core/types';
|
|
2
|
+
|
|
3
|
+
export interface ExpoAppIntegrityModule extends NativeModule {
|
|
4
|
+
// iOS
|
|
5
|
+
generateKey(): Promise<string>;
|
|
6
|
+
attestKey(key: string, challenge: string): Promise<string>;
|
|
7
|
+
generateAssertion(key: string, challenge: string): Promise<string>;
|
|
8
|
+
// Android
|
|
9
|
+
prepareIntegrityTokenProvider(cloudProjectNumber: string): Promise<void>;
|
|
10
|
+
requestIntegrityCheck(challenge: string): Promise<string>;
|
|
11
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AppIntegrity';
|
package/tsconfig.json
ADDED