summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
Diffstat (limited to 'android')
-rw-r--r--android/app/build.gradle120
-rw-r--r--android/app/debug.keystorebin0 -> 2257 bytes
-rw-r--r--android/app/proguard-rules.pro10
-rw-r--r--android/app/src/main/AndroidManifest.xml35
-rw-r--r--android/app/src/main/java/com/ihealthscanner/MainActivity.kt22
-rw-r--r--android/app/src/main/java/com/ihealthscanner/MainApplication.kt28
-rw-r--r--android/app/src/main/res/drawable/rn_edit_text_material.xml37
-rw-r--r--android/app/src/main/res/mipmap-hdpi/ic_launcher.pngbin0 -> 3056 bytes
-rw-r--r--android/app/src/main/res/mipmap-hdpi/ic_launcher_round.pngbin0 -> 5024 bytes
-rw-r--r--android/app/src/main/res/mipmap-mdpi/ic_launcher.pngbin0 -> 2096 bytes
-rw-r--r--android/app/src/main/res/mipmap-mdpi/ic_launcher_round.pngbin0 -> 2858 bytes
-rw-r--r--android/app/src/main/res/mipmap-xhdpi/ic_launcher.pngbin0 -> 4569 bytes
-rw-r--r--android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.pngbin0 -> 7098 bytes
-rw-r--r--android/app/src/main/res/mipmap-xxhdpi/ic_launcher.pngbin0 -> 6464 bytes
-rw-r--r--android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.pngbin0 -> 10676 bytes
-rw-r--r--android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.pngbin0 -> 9250 bytes
-rw-r--r--android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.pngbin0 -> 15523 bytes
-rw-r--r--android/app/src/main/res/values/strings.xml3
-rw-r--r--android/app/src/main/res/values/styles.xml9
-rw-r--r--android/build.gradle30
-rw-r--r--android/gradle.properties45
-rw-r--r--android/gradle/wrapper/gradle-wrapper.jarbin0 -> 46175 bytes
-rw-r--r--android/gradle/wrapper/gradle-wrapper.properties7
-rwxr-xr-xandroid/gradlew248
-rw-r--r--android/gradlew.bat98
-rw-r--r--android/settings.gradle15
26 files changed, 707 insertions, 0 deletions
diff --git a/android/app/build.gradle b/android/app/build.gradle
new file mode 100644
index 0000000..853b346
--- /dev/null
+++ b/android/app/build.gradle
@@ -0,0 +1,120 @@
1apply plugin: "com.android.application"
2apply plugin: "org.jetbrains.kotlin.android"
3apply plugin: "com.facebook.react"
4
5/**
6 * This is the configuration block to customize your React Native Android app.
7 * By default you don't need to apply any configuration, just uncomment the lines you need.
8 */
9react {
10 /* Folders */
11 // The root of your project, i.e. where "package.json" lives. Default is '../..'
12 // root = file("../../")
13 // The folder where the react-native NPM package is. Default is ../../node_modules/react-native
14 // reactNativeDir = file("../../node_modules/react-native")
15 // The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
16 // codegenDir = file("../../node_modules/@react-native/codegen")
17 // The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js
18 // cliFile = file("../../node_modules/react-native/cli.js")
19
20 /* Variants */
21 // The list of variants to that are debuggable. For those we're going to
22 // skip the bundling of the JS bundle and the assets. Default is "debug", "debugOptimized".
23 // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
24 // debuggableVariants = ["liteDebug", "liteDebugOptimized", "prodDebug", "prodDebugOptimized"]
25
26 /* Bundling */
27 // A list containing the node command and its flags. Default is just 'node'.
28 // nodeExecutableAndArgs = ["node"]
29 //
30 // The command to run when bundling. By default is 'bundle'
31 // bundleCommand = "ram-bundle"
32 //
33 // The path to the CLI configuration file. Default is empty.
34 // bundleConfig = file(../rn-cli.config.js)
35 //
36 // The name of the generated asset file containing your JS bundle
37 // bundleAssetName = "MyApplication.android.bundle"
38 //
39 // The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
40 // entryFile = file("../js/MyApplication.android.js")
41 //
42 // A list of extra flags to pass to the 'bundle' commands.
43 // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
44 // extraPackagerArgs = []
45
46 /* Hermes Commands */
47 // The hermes compiler command to run. By default it is 'hermesc'
48 // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
49 //
50 // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
51 // hermesFlags = ["-O", "-output-source-map"]
52
53 /* Autolinking */
54 autolinkLibrariesWithApp()
55}
56
57/**
58 * Set this to true to Run Proguard on Release builds to minify the Java bytecode.
59 */
60def enableProguardInReleaseBuilds = false
61
62/**
63 * The preferred build flavor of JavaScriptCore (JSC)
64 *
65 * For example, to use the international variant, you can use:
66 * `def jscFlavor = io.github.react-native-community:jsc-android-intl:2026004.+`
67 *
68 * The international variant includes ICU i18n library and necessary data
69 * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
70 * give correct results when using with locales other than en-US. Note that
71 * this variant is about 6MiB larger per architecture than default.
72 */
73def jscFlavor = 'io.github.react-native-community:jsc-android:2026004.+'
74
75android {
76 ndkVersion rootProject.ext.ndkVersion
77 buildToolsVersion rootProject.ext.buildToolsVersion
78 compileSdk rootProject.ext.compileSdkVersion
79
80 namespace "com.ihealthscanner"
81 defaultConfig {
82 applicationId "com.ihealthscanner"
83 minSdkVersion rootProject.ext.minSdkVersion
84 targetSdkVersion rootProject.ext.targetSdkVersion
85 versionCode 1
86 versionName "1.0"
87 }
88 signingConfigs {
89 debug {
90 storeFile file('debug.keystore')
91 storePassword 'android'
92 keyAlias 'androiddebugkey'
93 keyPassword 'android'
94 }
95 }
96 buildTypes {
97 debug {
98 signingConfig signingConfigs.debug
99 }
100 release {
101 // Caution! In production, you need to generate your own keystore file.
102 // see https://reactnative.dev/docs/signed-apk-android.
103 signingConfig signingConfigs.debug
104 minifyEnabled enableProguardInReleaseBuilds
105 proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
106 }
107 }
108}
109
110dependencies {
111 // The version of react-native is set by the React Native Gradle Plugin
112 implementation("com.facebook.react:react-android")
113 implementation project(':ihealthlibrary-react-native')
114
115 if (hermesEnabled.toBoolean()) {
116 implementation("com.facebook.react:hermes-android")
117 } else {
118 implementation jscFlavor
119 }
120}
diff --git a/android/app/debug.keystore b/android/app/debug.keystore
new file mode 100644
index 0000000..364e105
--- /dev/null
+++ b/android/app/debug.keystore
Binary files differ
diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro
new file mode 100644
index 0000000..11b0257
--- /dev/null
+++ b/android/app/proguard-rules.pro
@@ -0,0 +1,10 @@
1# Add project specific ProGuard rules here.
2# By default, the flags in this file are appended to flags specified
3# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
4# You can edit the include path and order by changing the proguardFiles
5# directive in build.gradle.
6#
7# For more details, see
8# http://developer.android.com/guide/developing/tools/proguard.html
9
10# Add any project specific keep options here:
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..01db1e9
--- /dev/null
+++ b/android/app/src/main/AndroidManifest.xml
@@ -0,0 +1,35 @@
1<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
3 <uses-permission android:name="android.permission.INTERNET" />
4 <uses-permission android:name="android.permission.BLUETOOTH" />
5 <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
6 <uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
7 <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
8 <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
9 <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
10 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
11 <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
12
13 <application
14 android:name=".MainApplication"
15 android:label="@string/app_name"
16 android:icon="@mipmap/ic_launcher"
17 android:roundIcon="@mipmap/ic_launcher_round"
18 android:allowBackup="false"
19 android:theme="@style/AppTheme"
20 android:usesCleartextTraffic="${usesCleartextTraffic}"
21 android:supportsRtl="true">
22 <activity
23 android:name=".MainActivity"
24 android:label="@string/app_name"
25 android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
26 android:launchMode="singleTask"
27 android:windowSoftInputMode="adjustResize"
28 android:exported="true">
29 <intent-filter>
30 <action android:name="android.intent.action.MAIN" />
31 <category android:name="android.intent.category.LAUNCHER" />
32 </intent-filter>
33 </activity>
34 </application>
35</manifest>
diff --git a/android/app/src/main/java/com/ihealthscanner/MainActivity.kt b/android/app/src/main/java/com/ihealthscanner/MainActivity.kt
new file mode 100644
index 0000000..b22606b
--- /dev/null
+++ b/android/app/src/main/java/com/ihealthscanner/MainActivity.kt
@@ -0,0 +1,22 @@
1package com.ihealthscanner
2
3import com.facebook.react.ReactActivity
4import com.facebook.react.ReactActivityDelegate
5import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
6import com.facebook.react.defaults.DefaultReactActivityDelegate
7
8class MainActivity : ReactActivity() {
9
10 /**
11 * Returns the name of the main component registered from JavaScript. This is used to schedule
12 * rendering of the component.
13 */
14 override fun getMainComponentName(): String = "iHealthScanner"
15
16 /**
17 * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
18 * which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
19 */
20 override fun createReactActivityDelegate(): ReactActivityDelegate =
21 DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
22}
diff --git a/android/app/src/main/java/com/ihealthscanner/MainApplication.kt b/android/app/src/main/java/com/ihealthscanner/MainApplication.kt
new file mode 100644
index 0000000..c079966
--- /dev/null
+++ b/android/app/src/main/java/com/ihealthscanner/MainApplication.kt
@@ -0,0 +1,28 @@
1package com.ihealthscanner
2
3import android.app.Application
4import com.facebook.react.PackageList
5import com.facebook.react.ReactApplication
6import com.facebook.react.ReactHost
7import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative
8import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
9import com.ihealth.ihealthlibrary.iHealthDeviceManagerPackage
10
11class MainApplication : Application(), ReactApplication {
12
13 override val reactHost: ReactHost by lazy {
14 getDefaultReactHost(
15 context = applicationContext,
16 packageList =
17 PackageList(this).packages.apply {
18 // Packages that cannot be autolinked yet can be added manually here:
19 add(iHealthDeviceManagerPackage())
20 },
21 )
22 }
23
24 override fun onCreate() {
25 super.onCreate()
26 loadReactNative(this)
27 }
28}
diff --git a/android/app/src/main/res/drawable/rn_edit_text_material.xml b/android/app/src/main/res/drawable/rn_edit_text_material.xml
new file mode 100644
index 0000000..5c25e72
--- /dev/null
+++ b/android/app/src/main/res/drawable/rn_edit_text_material.xml
@@ -0,0 +1,37 @@
1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (C) 2014 The Android Open Source Project
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15-->
16<inset xmlns:android="http://schemas.android.com/apk/res/android"
17 android:insetLeft="@dimen/abc_edit_text_inset_horizontal_material"
18 android:insetRight="@dimen/abc_edit_text_inset_horizontal_material"
19 android:insetTop="@dimen/abc_edit_text_inset_top_material"
20 android:insetBottom="@dimen/abc_edit_text_inset_bottom_material"
21 >
22
23 <selector>
24 <!--
25 This file is a copy of abc_edit_text_material (https://bit.ly/3k8fX7I).
26 The item below with state_pressed="false" and state_focused="false" causes a NullPointerException.
27 NullPointerException:tempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources)'
28
29 <item android:state_pressed="false" android:state_focused="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/>
30
31 For more info, see https://bit.ly/3CdLStv (react-native/pull/29452) and https://bit.ly/3nxOMoR.
32 -->
33 <item android:state_enabled="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/>
34 <item android:drawable="@drawable/abc_textfield_activated_mtrl_alpha"/>
35 </selector>
36
37</inset>
diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..a2f5908
--- /dev/null
+++ b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Binary files differ
diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 0000000..1b52399
--- /dev/null
+++ b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
Binary files differ
diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..ff10afd
--- /dev/null
+++ b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Binary files differ
diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 0000000..115a4c7
--- /dev/null
+++ b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
Binary files differ
diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..dcd3cd8
--- /dev/null
+++ b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Binary files differ
diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..459ca60
--- /dev/null
+++ b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
Binary files differ
diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..8ca12fe
--- /dev/null
+++ b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..8e19b41
--- /dev/null
+++ b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
Binary files differ
diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..b824ebd
--- /dev/null
+++ b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Binary files differ
diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..4c19a13
--- /dev/null
+++ b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
Binary files differ
diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..23d685f
--- /dev/null
+++ b/android/app/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
1<resources>
2 <string name="app_name">iHealthScanner</string>
3</resources>
diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..7ba83a2
--- /dev/null
+++ b/android/app/src/main/res/values/styles.xml
@@ -0,0 +1,9 @@
1<resources>
2
3 <!-- Base application theme. -->
4 <style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
5 <!-- Customize your theme here. -->
6 <item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
7 </style>
8
9</resources>
diff --git a/android/build.gradle b/android/build.gradle
new file mode 100644
index 0000000..b9dbb81
--- /dev/null
+++ b/android/build.gradle
@@ -0,0 +1,30 @@
1buildscript {
2 ext {
3 buildToolsVersion = "36.0.0"
4 minSdkVersion = 24
5 compileSdkVersion = 36
6 targetSdkVersion = 36
7 ndkVersion = "27.1.12297006"
8 kotlinVersion = "2.1.20"
9 }
10 repositories {
11 google()
12 mavenCentral()
13 maven { url "https://jitpack.io" }
14 }
15 dependencies {
16 classpath("com.android.tools.build:gradle")
17 classpath("com.facebook.react:react-native-gradle-plugin")
18 classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
19 }
20}
21
22allprojects {
23 repositories {
24 google()
25 mavenCentral()
26 maven { url "https://jitpack.io" }
27 }
28}
29
30apply plugin: "com.facebook.react.rootproject"
diff --git a/android/gradle.properties b/android/gradle.properties
new file mode 100644
index 0000000..662c5ac
--- /dev/null
+++ b/android/gradle.properties
@@ -0,0 +1,45 @@
1# Project-wide Gradle settings.
2
3# IDE (e.g. Android Studio) users:
4# Gradle settings configured through the IDE *will override*
5# any settings specified in this file.
6
7# For more details on how to configure your build environment visit
8# http://www.gradle.org/docs/current/userguide/build_environment.html
9
10# Specifies the JVM arguments used for the daemon process.
11# The setting is particularly useful for tweaking memory settings.
12# Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
13org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
14
15# When configured, Gradle will run in incubating parallel mode.
16# This option should only be used with decoupled projects. More details, visit
17# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18# org.gradle.parallel=true
19
20# AndroidX package structure to make it clearer which packages are bundled with the
21# Android operating system, and which are packaged with your app's APK
22# https://developer.android.com/topic/libraries/support-library/androidx-rn
23android.useAndroidX=true
24android.enableJetifier=true
25
26# Use this property to specify which architecture you want to build.
27# You can also override it from the CLI using
28# ./gradlew <task> -PreactNativeArchitectures=x86_64
29reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
30
31# Use this property to enable support to the new architecture.
32# This will allow you to use TurboModules and the Fabric render in
33# your application. You should enable this flag either if you want
34# to write custom TurboModules/Fabric components OR use libraries that
35# are providing them.
36newArchEnabled=true
37
38# Use this property to enable or disable the Hermes JS engine.
39# If set to false, you will be using JSC instead.
40hermesEnabled=true
41
42# Use this property to enable edge-to-edge display support.
43# This allows your app to draw behind system bars for an immersive UI.
44# Note: Only works with ReactActivity and should not be used with custom Activity.
45edgeToEdgeEnabled=false
diff --git a/android/gradle/wrapper/gradle-wrapper.jar b/android/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..61285a6
--- /dev/null
+++ b/android/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..37f78a6
--- /dev/null
+++ b/android/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,7 @@
1distributionBase=GRADLE_USER_HOME
2distributionPath=wrapper/dists
3distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
4networkTimeout=10000
5validateDistributionUrl=true
6zipStoreBase=GRADLE_USER_HOME
7zipStorePath=wrapper/dists
diff --git a/android/gradlew b/android/gradlew
new file mode 100755
index 0000000..adff685
--- /dev/null
+++ b/android/gradlew
@@ -0,0 +1,248 @@
1#!/bin/sh
2
3#
4# Copyright © 2015 the original authors.
5#
6# Licensed under the Apache License, Version 2.0 (the "License");
7# you may not use this file except in compliance with the License.
8# You may obtain a copy of the License at
9#
10# https://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS,
14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
17#
18# SPDX-License-Identifier: Apache-2.0
19#
20
21##############################################################################
22#
23# Gradle start up script for POSIX generated by Gradle.
24#
25# Important for running:
26#
27# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
28# noncompliant, but you have some other compliant shell such as ksh or
29# bash, then to run this script, type that shell name before the whole
30# command line, like:
31#
32# ksh Gradle
33#
34# Busybox and similar reduced shells will NOT work, because this script
35# requires all of these POSIX shell features:
36# * functions;
37# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
38# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
39# * compound commands having a testable exit status, especially «case»;
40# * various built-in commands including «command», «set», and «ulimit».
41#
42# Important for patching:
43#
44# (2) This script targets any POSIX shell, so it avoids extensions provided
45# by Bash, Ksh, etc; in particular arrays are avoided.
46#
47# The "traditional" practice of packing multiple parameters into a
48# space-separated string is a well documented source of bugs and security
49# problems, so this is (mostly) avoided, by progressively accumulating
50# options in "$@", and eventually passing that to Java.
51#
52# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
53# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
54# see the in-line comments for details.
55#
56# There are tweaks for specific operating systems such as AIX, CygWin,
57# Darwin, MinGW, and NonStop.
58#
59# (3) This script is generated from the Groovy template
60# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
61# within the Gradle project.
62#
63# You can find Gradle at https://github.com/gradle/gradle/.
64#
65##############################################################################
66
67# Attempt to set APP_HOME
68
69# Resolve links: $0 may be a link
70app_path=$0
71
72# Need this for daisy-chained symlinks.
73while
74 APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
75 [ -h "$app_path" ]
76do
77 ls=$( ls -ld "$app_path" )
78 link=${ls#*' -> '}
79 case $link in #(
80 /*) app_path=$link ;; #(
81 *) app_path=$APP_HOME$link ;;
82 esac
83done
84
85# This is normally unused
86# shellcheck disable=SC2034
87APP_BASE_NAME=${0##*/}
88# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
89APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
90
91# Use the maximum available, or set MAX_FD != -1 to use that value.
92MAX_FD=maximum
93
94warn () {
95 echo "$*"
96} >&2
97
98die () {
99 echo
100 echo "$*"
101 echo
102 exit 1
103} >&2
104
105# OS specific support (must be 'true' or 'false').
106cygwin=false
107msys=false
108darwin=false
109nonstop=false
110case "$( uname )" in #(
111 CYGWIN* ) cygwin=true ;; #(
112 Darwin* ) darwin=true ;; #(
113 MSYS* | MINGW* ) msys=true ;; #(
114 NONSTOP* ) nonstop=true ;;
115esac
116
117
118
119# Determine the Java command to use to start the JVM.
120if [ -n "$JAVA_HOME" ] ; then
121 if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
122 # IBM's JDK on AIX uses strange locations for the executables
123 JAVACMD=$JAVA_HOME/jre/sh/java
124 else
125 JAVACMD=$JAVA_HOME/bin/java
126 fi
127 if [ ! -x "$JAVACMD" ] ; then
128 die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
129
130Please set the JAVA_HOME variable in your environment to match the
131location of your Java installation."
132 fi
133else
134 JAVACMD=java
135 if ! command -v java >/dev/null 2>&1
136 then
137 die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
138
139Please set the JAVA_HOME variable in your environment to match the
140location of your Java installation."
141 fi
142fi
143
144# Increase the maximum file descriptors if we can.
145if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
146 case $MAX_FD in #(
147 max*)
148 # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
149 # shellcheck disable=SC2039,SC3045
150 MAX_FD=$( ulimit -H -n ) ||
151 warn "Could not query maximum file descriptor limit"
152 esac
153 case $MAX_FD in #(
154 '' | soft) :;; #(
155 *)
156 # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
157 # shellcheck disable=SC2039,SC3045
158 ulimit -n "$MAX_FD" ||
159 warn "Could not set maximum file descriptor limit to $MAX_FD"
160 esac
161fi
162
163# Collect all arguments for the java command, stacking in reverse order:
164# * args from the command line
165# * the main class name
166# * -classpath
167# * -D...appname settings
168# * --module-path (only if needed)
169# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
170
171# For Cygwin or MSYS, switch paths to Windows format before running java
172if "$cygwin" || "$msys" ; then
173 APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
174
175 JAVACMD=$( cygpath --unix "$JAVACMD" )
176
177 # Now convert the arguments - kludge to limit ourselves to /bin/sh
178 for arg do
179 if
180 case $arg in #(
181 -*) false ;; # don't mess with options #(
182 /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
183 [ -e "$t" ] ;; #(
184 *) false ;;
185 esac
186 then
187 arg=$( cygpath --path --ignore --mixed "$arg" )
188 fi
189 # Roll the args list around exactly as many times as the number of
190 # args, so each arg winds up back in the position where it started, but
191 # possibly modified.
192 #
193 # NB: a `for` loop captures its iteration list before it begins, so
194 # changing the positional parameters here affects neither the number of
195 # iterations, nor the values presented in `arg`.
196 shift # remove old arg
197 set -- "$@" "$arg" # push replacement arg
198 done
199fi
200
201
202# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
203DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
204
205# Collect all arguments for the java command:
206# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
207# and any embedded shellness will be escaped.
208# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
209# treated as '${Hostname}' itself on the command line.
210
211set -- \
212 "-Dorg.gradle.appname=$APP_BASE_NAME" \
213 -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
214 "$@"
215
216# Stop when "xargs" is not available.
217if ! command -v xargs >/dev/null 2>&1
218then
219 die "xargs is not available"
220fi
221
222# Use "xargs" to parse quoted args.
223#
224# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
225#
226# In Bash we could simply go:
227#
228# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
229# set -- "${ARGS[@]}" "$@"
230#
231# but POSIX shell has neither arrays nor command substitution, so instead we
232# post-process each arg (as a line of input to sed) to backslash-escape any
233# character that might be a shell metacharacter, then use eval to reverse
234# that process (while maintaining the separation between arguments), and wrap
235# the whole thing up as a single "set" statement.
236#
237# This will of course break if any of these variables contains a newline or
238# an unmatched quote.
239#
240
241eval "set -- $(
242 printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
243 xargs -n1 |
244 sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
245 tr '\n' ' '
246 )" '"$@"'
247
248exec "$JAVACMD" "$@"
diff --git a/android/gradlew.bat b/android/gradlew.bat
new file mode 100644
index 0000000..39baf4d
--- /dev/null
+++ b/android/gradlew.bat
@@ -0,0 +1,98 @@
1@REM Copyright (c) Meta Platforms, Inc. and affiliates.
2@REM
3@REM This source code is licensed under the MIT license found in the
4@REM LICENSE file in the root directory of this source tree.
5
6@rem
7@rem Copyright 2015 the original author or authors.
8@rem
9@rem Licensed under the Apache License, Version 2.0 (the "License");
10@rem you may not use this file except in compliance with the License.
11@rem You may obtain a copy of the License at
12@rem
13@rem https://www.apache.org/licenses/LICENSE-2.0
14@rem
15@rem Unless required by applicable law or agreed to in writing, software
16@rem distributed under the License is distributed on an "AS IS" BASIS,
17@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18@rem See the License for the specific language governing permissions and
19@rem limitations under the License.
20@rem
21@rem SPDX-License-Identifier: Apache-2.0
22@rem
23
24@if "%DEBUG%"=="" @echo off
25@rem ##########################################################################
26@rem
27@rem Gradle startup script for Windows
28@rem
29@rem ##########################################################################
30
31@rem Set local scope for the variables with windows NT shell
32if "%OS%"=="Windows_NT" setlocal
33
34set DIRNAME=%~dp0
35if "%DIRNAME%"=="" set DIRNAME=.
36@rem This is normally unused
37set APP_BASE_NAME=%~n0
38set APP_HOME=%DIRNAME%
39
40@rem Resolve any "." and ".." in APP_HOME to make it shorter.
41for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
42
43@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
44set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
45
46@rem Find java.exe
47if defined JAVA_HOME goto findJavaFromJavaHome
48
49set JAVA_EXE=java.exe
50%JAVA_EXE% -version >NUL 2>&1
51if %ERRORLEVEL% equ 0 goto execute
52
53echo. 1>&2
54echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
55echo. 1>&2
56echo Please set the JAVA_HOME variable in your environment to match the 1>&2
57echo location of your Java installation. 1>&2
58
59goto fail
60
61:findJavaFromJavaHome
62set JAVA_HOME=%JAVA_HOME:"=%
63set JAVA_EXE=%JAVA_HOME%/bin/java.exe
64
65if exist "%JAVA_EXE%" goto execute
66
67echo. 1>&2
68echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
69echo. 1>&2
70echo Please set the JAVA_HOME variable in your environment to match the 1>&2
71echo location of your Java installation. 1>&2
72
73goto fail
74
75:execute
76@rem Setup the command line
77
78
79
80@rem Execute Gradle
81"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
82
83:end
84@rem End local scope for the variables with windows NT shell
85if %ERRORLEVEL% equ 0 goto mainEnd
86
87:fail
88rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
89rem the _cmd.exe /c_ return code!
90set EXIT_CODE=%ERRORLEVEL%
91if %EXIT_CODE% equ 0 set EXIT_CODE=1
92if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
93exit /b %EXIT_CODE%
94
95:mainEnd
96if "%OS%"=="Windows_NT" endlocal
97
98:omega
diff --git a/android/settings.gradle b/android/settings.gradle
new file mode 100644
index 0000000..6c47ee0
--- /dev/null
+++ b/android/settings.gradle
@@ -0,0 +1,15 @@
1pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") }
2plugins { id("com.facebook.react.settings") }
3extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }
4dependencyResolutionManagement {
5 repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
6 repositories {
7 google()
8 mavenCentral()
9 }
10}
11rootProject.name = 'iHealthScanner'
12include ':app'
13include ':ihealthlibrary-react-native'
14project(':ihealthlibrary-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/@ihealth/ihealthlibrary-react-native/android')
15includeBuild('../node_modules/@react-native/gradle-plugin')