Repository: HMS-Core/hms-react-native-plugin Branch: master Commit: 2092905c9b17 Files: 1595 Total size: 10.3 MB Directory structure: gitextract_n1z5l90w/ ├── .github/ │ └── ISSUE_TEMPLATE/ │ └── issue-with-the-sample-code.md ├── LICENSE ├── README.md ├── react-native-hms-account/ │ ├── LICENSE │ ├── README.md │ ├── android/ │ │ ├── build.gradle │ │ ├── gradle/ │ │ │ └── wrapper/ │ │ │ └── gradle-wrapper.properties │ │ ├── gradle.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── src/ │ │ └── main/ │ │ ├── AndroidManifest.xml │ │ └── java/ │ │ └── com/ │ │ └── huawei/ │ │ └── hms/ │ │ └── rn/ │ │ └── account/ │ │ ├── HMSAccountPackage.java │ │ ├── constants/ │ │ │ └── ClassConstants.java │ │ ├── logger/ │ │ │ └── HMSLogger.java │ │ ├── modules/ │ │ │ ├── HMSAccount.java │ │ │ ├── HMSAccountAuthManager.java │ │ │ ├── HMSAccountAuthService.java │ │ │ ├── HMSHuaweiIdAuthManager.java │ │ │ ├── HMSHuaweiIdAuthTool.java │ │ │ ├── HMSNetworkTool.java │ │ │ └── HMSReadSMSManager.java │ │ ├── utils/ │ │ │ └── Utils.java │ │ └── views/ │ │ └── HMSHuaweiIdAuthButton.java │ ├── example/ │ │ ├── .gitignore │ │ ├── App.js │ │ ├── README.md │ │ ├── android/ │ │ │ ├── app/ │ │ │ │ ├── BUCK │ │ │ │ ├── build.gradle │ │ │ │ ├── proguard-rules.pro │ │ │ │ └── src/ │ │ │ │ └── main/ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── java/ │ │ │ │ │ └── com/ │ │ │ │ │ └── huawei/ │ │ │ │ │ └── hms/ │ │ │ │ │ └── rn/ │ │ │ │ │ └── account/ │ │ │ │ │ └── demo/ │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MainApplication.java │ │ │ │ └── res/ │ │ │ │ └── values/ │ │ │ │ └── styles.xml │ │ │ ├── build.gradle │ │ │ ├── gradle/ │ │ │ │ └── wrapper/ │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── gradle.properties │ │ │ ├── gradlew │ │ │ ├── gradlew.bat │ │ │ └── settings.gradle │ │ ├── app.json │ │ ├── babel.config.js │ │ ├── index.js │ │ ├── metro.config.js │ │ └── package.json │ ├── package.json │ └── src/ │ ├── index.d.ts │ └── index.js ├── react-native-hms-ads/ │ ├── LICENSE │ ├── OpenSourceSoftwareNotice.html │ ├── README.md │ ├── android/ │ │ ├── build.gradle │ │ ├── gradle/ │ │ │ └── wrapper/ │ │ │ └── gradle-wrapper.properties │ │ ├── gradle.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── src/ │ │ └── main/ │ │ ├── AndroidManifest.xml │ │ ├── java/ │ │ │ └── com/ │ │ │ └── huawei/ │ │ │ └── hms/ │ │ │ └── rn/ │ │ │ └── ads/ │ │ │ ├── HMSAdsBannerView.java │ │ │ ├── HMSAdsInstallReferrerModule.java │ │ │ ├── HMSAdsInstreamView.java │ │ │ ├── HMSAdsInterstitialAdModule.java │ │ │ ├── HMSAdsModule.java │ │ │ ├── HMSAdsNativeView.java │ │ │ ├── HMSAdsOaidModule.java │ │ │ ├── HMSAdsPackage.java │ │ │ ├── HMSAdsRewardAdModule.java │ │ │ ├── HMSAdsSplashActivity.java │ │ │ ├── HMSAdsSplashAdModule.java │ │ │ ├── HMSAdsVastModule.java │ │ │ ├── HMSAdsVastView.java │ │ │ ├── custome/ │ │ │ │ └── CustomVideoController.java │ │ │ ├── logger/ │ │ │ │ └── HMSLogger.java │ │ │ └── utils/ │ │ │ ├── CommonUtils.java │ │ │ ├── Constants.java │ │ │ ├── ReactUtils.java │ │ │ └── ResourceUtils.java │ │ └── res/ │ │ ├── drawable/ │ │ │ ├── native_button_rounded_corners_shape.xml │ │ │ └── native_flag_rounded_corners_shape.xml │ │ ├── layout/ │ │ │ ├── activity_splash.xml │ │ │ ├── activity_video_player.xml │ │ │ ├── button_layout.xml │ │ │ ├── media_view.xml │ │ │ ├── native_small_template.xml │ │ │ ├── native_video_template.xml │ │ │ └── vast_template.xml │ │ └── values/ │ │ └── strings.xml │ ├── example/ │ │ ├── App.js │ │ ├── LICENSE │ │ ├── README.md │ │ ├── android/ │ │ │ ├── app/ │ │ │ │ ├── build.gradle │ │ │ │ ├── proguard-rules.pro │ │ │ │ └── src/ │ │ │ │ ├── debug/ │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ └── main/ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── java/ │ │ │ │ │ └── com/ │ │ │ │ │ └── huawei/ │ │ │ │ │ └── hms/ │ │ │ │ │ └── rn/ │ │ │ │ │ └── ads/ │ │ │ │ │ └── demo/ │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MainApplication.java │ │ │ │ └── res/ │ │ │ │ └── values/ │ │ │ │ └── styles.xml │ │ │ ├── build.gradle │ │ │ ├── gradle/ │ │ │ │ └── wrapper/ │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── gradle.properties │ │ │ ├── gradlew │ │ │ ├── gradlew.bat │ │ │ └── settings.gradle │ │ ├── app.json │ │ ├── babel.config.js │ │ ├── index.js │ │ ├── jest.config.js │ │ ├── metro.config.js │ │ └── package.json │ ├── package.json │ └── src/ │ ├── Ads.js │ ├── Banner.js │ ├── InstallReferrer.js │ ├── Instream.js │ ├── Interstitial.js │ ├── Native.js │ ├── Oaid.js │ ├── Reward.js │ ├── Splash.js │ ├── Vast.js │ ├── VastView.js │ ├── index.d.ts │ ├── index.js │ └── utils.js ├── react-native-hms-adsprime/ │ ├── LICENSE │ ├── OpenSourceSoftwareNotice.html │ ├── README.md │ ├── android/ │ │ ├── build.gradle │ │ ├── gradle/ │ │ │ └── wrapper/ │ │ │ └── gradle-wrapper.properties │ │ ├── gradle.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── src/ │ │ └── main/ │ │ ├── AndroidManifest.xml │ │ ├── java/ │ │ │ └── com/ │ │ │ └── huawei/ │ │ │ └── hms/ │ │ │ └── rn/ │ │ │ └── ads/ │ │ │ ├── HMSAdsPrimeBannerView.java │ │ │ ├── HMSAdsPrimeInstallReferrerModule.java │ │ │ ├── HMSAdsPrimeInstreamView.java │ │ │ ├── HMSAdsPrimeInterstitialAdModule.java │ │ │ ├── HMSAdsPrimeModule.java │ │ │ ├── HMSAdsPrimeNativeView.java │ │ │ ├── HMSAdsPrimeOaidModule.java │ │ │ ├── HMSAdsPrimePackage.java │ │ │ ├── HMSAdsPrimeRewardAdModule.java │ │ │ ├── HMSAdsPrimeSplashActivity.java │ │ │ ├── HMSAdsPrimeSplashAdModule.java │ │ │ ├── HMSAdsPrimeVastModule.java │ │ │ ├── HMSAdsPrimeVastView.java │ │ │ ├── custome/ │ │ │ │ └── CustomVideoController.java │ │ │ ├── logger/ │ │ │ │ └── HMSLogger.java │ │ │ └── utils/ │ │ │ ├── CommonUtils.java │ │ │ ├── Constants.java │ │ │ ├── ReactUtils.java │ │ │ └── ResourceUtils.java │ │ └── res/ │ │ ├── drawable/ │ │ │ ├── native_button_rounded_corners_shape.xml │ │ │ └── native_flag_rounded_corners_shape.xml │ │ ├── layout/ │ │ │ ├── activity_splash.xml │ │ │ ├── activity_video_player.xml │ │ │ ├── button_layout.xml │ │ │ ├── media_view.xml │ │ │ ├── native_small_template.xml │ │ │ ├── native_video_template.xml │ │ │ └── vast_template.xml │ │ └── values/ │ │ └── strings.xml │ ├── example/ │ │ ├── .gitattributes │ │ ├── .gitignore │ │ ├── App.js │ │ ├── LICENSE │ │ ├── README.md │ │ ├── android/ │ │ │ ├── app/ │ │ │ │ ├── build.gradle │ │ │ │ ├── proguard-rules.pro │ │ │ │ └── src/ │ │ │ │ ├── debug/ │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ └── main/ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── java/ │ │ │ │ │ └── com/ │ │ │ │ │ └── huawei/ │ │ │ │ │ └── hms/ │ │ │ │ │ └── rn/ │ │ │ │ │ └── ads/ │ │ │ │ │ └── demo/ │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MainApplication.java │ │ │ │ └── res/ │ │ │ │ └── values/ │ │ │ │ └── styles.xml │ │ │ ├── build.gradle │ │ │ ├── gradle/ │ │ │ │ └── wrapper/ │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── gradle.properties │ │ │ ├── gradlew │ │ │ ├── gradlew.bat │ │ │ └── settings.gradle │ │ ├── app.json │ │ ├── babel.config.js │ │ ├── index.js │ │ ├── jest.config.js │ │ ├── metro.config.js │ │ └── package.json │ ├── package.json │ └── src/ │ ├── AdsPrime.js │ ├── Banner.js │ ├── InstallReferrer.js │ ├── Instream.js │ ├── Interstitial.js │ ├── Native.js │ ├── Oaid.js │ ├── Reward.js │ ├── Splash.js │ ├── Vast.js │ ├── VastView.js │ ├── index.d.ts │ ├── index.js │ └── utils.js ├── react-native-hms-analytics/ │ ├── LICENSE │ ├── README.md │ ├── android/ │ │ ├── build.gradle │ │ ├── gradle/ │ │ │ └── wrapper/ │ │ │ └── gradle-wrapper.properties │ │ ├── gradle.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── src/ │ │ └── main/ │ │ ├── AndroidManifest.xml │ │ └── java/ │ │ └── com/ │ │ └── huawei/ │ │ └── hms/ │ │ └── rn/ │ │ └── analytics/ │ │ ├── HMSAnalyticsModule.java │ │ ├── HMSAnalyticsPackage.java │ │ ├── HMSAnalyticsProvider.java │ │ ├── HMSAnalyticsWrapper.java │ │ └── logger/ │ │ └── HMSLogger.java │ ├── example/ │ │ ├── .gitignore │ │ ├── App.js │ │ ├── LICENSE │ │ ├── README.md │ │ ├── android/ │ │ │ ├── app/ │ │ │ │ ├── BUCK │ │ │ │ ├── build.gradle │ │ │ │ ├── proguard-rules.pro │ │ │ │ └── src/ │ │ │ │ ├── debug/ │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ └── main/ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── java/ │ │ │ │ │ └── com/ │ │ │ │ │ └── huawei/ │ │ │ │ │ └── hms/ │ │ │ │ │ └── rn/ │ │ │ │ │ └── analytics/ │ │ │ │ │ └── example/ │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MainApplication.java │ │ │ │ └── res/ │ │ │ │ └── values/ │ │ │ │ └── styles.xml │ │ │ ├── build.gradle │ │ │ ├── gradle/ │ │ │ │ └── wrapper/ │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── gradle.properties │ │ │ ├── gradlew │ │ │ ├── gradlew.bat │ │ │ └── settings.gradle │ │ ├── babel.config.js │ │ ├── constants/ │ │ │ └── Data.js │ │ ├── customViews/ │ │ │ ├── ComboBox.js │ │ │ └── RenderComponent.js │ │ ├── index.js │ │ ├── ios/ │ │ │ ├── Example.swift │ │ │ ├── Podfile │ │ │ ├── example/ │ │ │ │ ├── AppDelegate.h │ │ │ │ ├── AppDelegate.m │ │ │ │ ├── Images.xcassets/ │ │ │ │ │ ├── AppIcon.appiconset/ │ │ │ │ │ │ └── Contents.json │ │ │ │ │ └── Contents.json │ │ │ │ ├── Info.plist │ │ │ │ ├── LaunchScreen.storyboard │ │ │ │ └── main.m │ │ │ ├── example-Bridging-Header.h │ │ │ ├── example-tvOS/ │ │ │ │ └── Info.plist │ │ │ ├── example-tvOSTests/ │ │ │ │ └── Info.plist │ │ │ ├── example.xcodeproj/ │ │ │ │ ├── project.pbxproj │ │ │ │ └── xcshareddata/ │ │ │ │ └── xcschemes/ │ │ │ │ ├── example-tvOS.xcscheme │ │ │ │ └── example.xcscheme │ │ │ ├── example.xcworkspace/ │ │ │ │ ├── contents.xcworkspacedata │ │ │ │ └── xcshareddata/ │ │ │ │ └── IDEWorkspaceChecks.plist │ │ │ └── exampleTests/ │ │ │ ├── Info.plist │ │ │ └── exampleTests.m │ │ ├── metro.config.js │ │ └── package.json │ ├── ios/ │ │ ├── AnalyticsViewModel.swift │ │ ├── HmsAnalytics-Bridging-Header.h │ │ ├── HmsAnalytics.m │ │ ├── HmsAnalytics.swift │ │ ├── HmsAnalytics.xcodeproj/ │ │ │ └── project.pbxproj │ │ ├── HmsAnalytics.xcworkspace/ │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata/ │ │ │ └── IDEWorkspaceChecks.plist │ │ ├── Logger.swift │ │ └── Promise.swift │ ├── package.json │ ├── react-native-hms-analytics.podspec │ └── src/ │ ├── constants/ │ │ ├── Constants.js │ │ ├── HAEventType.js │ │ ├── HAParamType.js │ │ ├── HAUserProfileType.js │ │ └── ReportPolicyType.js │ ├── index.d.ts │ └── index.js ├── react-native-hms-ar/ │ ├── LICENCE │ ├── README.md │ ├── THIRD PARTY OPEN SOURCE SOFTWARE NOTICE.txt │ ├── android/ │ │ ├── build.gradle │ │ ├── gradle/ │ │ │ └── wrapper/ │ │ │ └── gradle-wrapper.properties │ │ ├── gradle.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── src/ │ │ └── main/ │ │ ├── AndroidManifest.xml │ │ ├── java/ │ │ │ └── com/ │ │ │ └── huawei/ │ │ │ └── hms/ │ │ │ ├── plugin/ │ │ │ │ └── ar/ │ │ │ │ └── core/ │ │ │ │ ├── ARSetupFacade.java │ │ │ │ ├── config/ │ │ │ │ │ ├── ARPluginConfigAugmentedImage.java │ │ │ │ │ ├── ARPluginConfigBase.java │ │ │ │ │ ├── ARPluginConfigBasePointLine.java │ │ │ │ │ ├── ARPluginConfigBaseWorld.java │ │ │ │ │ ├── ARPluginConfigBody.java │ │ │ │ │ ├── ARPluginConfigFace.java │ │ │ │ │ ├── ARPluginConfigHand.java │ │ │ │ │ ├── ARPluginConfigSceneMesh.java │ │ │ │ │ ├── ARPluginConfigWorld.java │ │ │ │ │ ├── ARPluginConfigWorldBody.java │ │ │ │ │ └── ColorRGBA.java │ │ │ │ ├── helper/ │ │ │ │ │ ├── ArDemoRuntimeException.java │ │ │ │ │ ├── AugmentedImage/ │ │ │ │ │ │ ├── CornerType.java │ │ │ │ │ │ ├── ImageKeyBase.java │ │ │ │ │ │ ├── ImageKeyLineDisplay.java │ │ │ │ │ │ ├── ImageKeyPointDisplay.java │ │ │ │ │ │ └── ImageShaderUtil.java │ │ │ │ │ ├── CameraConfigListener.java │ │ │ │ │ ├── CameraIntrinsicsListener.java │ │ │ │ │ ├── DisplayRotationManager.java │ │ │ │ │ ├── GestureEvent.java │ │ │ │ │ ├── LabelDisplay.java │ │ │ │ │ ├── MessageTextListener.java │ │ │ │ │ ├── ObjectDisplay.java │ │ │ │ │ ├── PluginCallbackHelper.java │ │ │ │ │ ├── PointCloudRenderer.java │ │ │ │ │ ├── SceneMesh/ │ │ │ │ │ │ ├── SceneMeshDisplay.java │ │ │ │ │ │ └── SceneMeshDrawFrameListener.java │ │ │ │ │ ├── TextureDisplay.java │ │ │ │ │ ├── VirtualObject.java │ │ │ │ │ ├── body/ │ │ │ │ │ │ ├── BodySkeletonDisplay.java │ │ │ │ │ │ └── BodySkeletonLineDisplay.java │ │ │ │ │ ├── face/ │ │ │ │ │ │ ├── FaceGeometryDisplay.java │ │ │ │ │ │ └── FaceHealtyResult.java │ │ │ │ │ └── hand/ │ │ │ │ │ ├── HandBoxDisplay.java │ │ │ │ │ ├── HandSkeletonDisplay.java │ │ │ │ │ └── HandSkeletonLineDisplay.java │ │ │ │ ├── model/ │ │ │ │ │ └── AugmentedImageDBModel.java │ │ │ │ ├── renderer/ │ │ │ │ │ ├── ARAugmentedImageRender.java │ │ │ │ │ ├── ARBaseDrawObject.java │ │ │ │ │ ├── ARBaseRenderer.java │ │ │ │ │ ├── ARBodyRenderer.java │ │ │ │ │ ├── ARCloud3DObjectRenderer.java │ │ │ │ │ ├── ARFaceRenderer.java │ │ │ │ │ ├── ARHandRenderer.java │ │ │ │ │ ├── ARSceneMeshRenderer.java │ │ │ │ │ ├── ARWorldBodyRenderer.java │ │ │ │ │ └── ARWorldRenderer.java │ │ │ │ ├── serializer/ │ │ │ │ │ ├── CommonSerializer.java │ │ │ │ │ ├── PluginARAugmentedImageSerializer.java │ │ │ │ │ ├── PluginARBodySerializer.java │ │ │ │ │ ├── PluginARFaceSerializer.java │ │ │ │ │ ├── PluginARHandSerializer.java │ │ │ │ │ ├── PluginARPlaneSerializer.java │ │ │ │ │ ├── PluginARTargetSerializer.java │ │ │ │ │ └── PluginARTrackableSerializer.java │ │ │ │ └── util/ │ │ │ │ ├── AREngineAvailability.java │ │ │ │ ├── ApplicationUtil.java │ │ │ │ ├── BodyShaderUtil.java │ │ │ │ ├── ErrorUtil.java │ │ │ │ ├── HandShaderUtil.java │ │ │ │ ├── MatrixUtil.java │ │ │ │ ├── ModeInformation.java │ │ │ │ ├── OpenGLUtil.java │ │ │ │ ├── SceneMeshShaderUtil.java │ │ │ │ └── WorldShaderUtil.java │ │ │ └── rn/ │ │ │ └── ar/ │ │ │ ├── ARSurfaceView.java │ │ │ ├── HmsARModule.java │ │ │ ├── HmsARPackage.java │ │ │ ├── logger/ │ │ │ │ └── HMSLogger.java │ │ │ └── utils/ │ │ │ ├── Converter.java │ │ │ └── EnumGenerator.java │ │ └── res/ │ │ └── drawable/ │ │ ├── colors.xml │ │ └── scanningframe.xml │ ├── example/ │ │ ├── App.js │ │ ├── LICENCE │ │ ├── README.md │ │ ├── android/ │ │ │ ├── app/ │ │ │ │ ├── BUCK │ │ │ │ ├── build.gradle │ │ │ │ ├── proguard-rules.pro │ │ │ │ └── src/ │ │ │ │ ├── debug/ │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ └── main/ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── assets/ │ │ │ │ │ ├── AR_logo.obj │ │ │ │ │ ├── blub.obj │ │ │ │ │ └── bob.obj │ │ │ │ ├── java/ │ │ │ │ │ └── com/ │ │ │ │ │ └── huawei/ │ │ │ │ │ └── hms/ │ │ │ │ │ └── rn/ │ │ │ │ │ └── ar/ │ │ │ │ │ └── demo/ │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MainApplication.java │ │ │ │ └── res/ │ │ │ │ └── values/ │ │ │ │ └── styles.xml │ │ │ ├── build.gradle │ │ │ ├── gradle/ │ │ │ │ └── wrapper/ │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── gradle.properties │ │ │ ├── gradlew │ │ │ ├── gradlew.bat │ │ │ └── settings.gradle │ │ ├── app.json │ │ ├── babel.config.js │ │ ├── index.js │ │ ├── metro.config.js │ │ └── package.json │ ├── package.json │ └── src/ │ ├── index.d.ts │ └── index.js ├── react-native-hms-availability/ │ ├── LICENSE │ ├── README.md │ ├── android/ │ │ ├── build.gradle │ │ ├── gradle/ │ │ │ └── wrapper/ │ │ │ └── gradle-wrapper.properties │ │ ├── gradle.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── src/ │ │ └── main/ │ │ ├── AndroidManifest.xml │ │ └── java/ │ │ └── com/ │ │ └── huawei/ │ │ └── hms/ │ │ └── rn/ │ │ └── availability/ │ │ ├── HMSAvailabilityModule.java │ │ ├── HMSAvailabilityPackage.java │ │ └── Util.java │ ├── example/ │ │ ├── LICENSE │ │ ├── android/ │ │ │ ├── app/ │ │ │ │ ├── build.gradle │ │ │ │ ├── proguard-rules.pro │ │ │ │ └── src/ │ │ │ │ ├── debug/ │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ └── main/ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── java/ │ │ │ │ │ └── com/ │ │ │ │ │ └── huawei/ │ │ │ │ │ └── hms/ │ │ │ │ │ └── rn/ │ │ │ │ │ └── availability/ │ │ │ │ │ └── demo/ │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MainApplication.java │ │ │ │ └── res/ │ │ │ │ └── values/ │ │ │ │ └── styles.xml │ │ │ ├── build.gradle │ │ │ ├── gradle/ │ │ │ │ └── wrapper/ │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── gradle.properties │ │ │ ├── gradlew │ │ │ ├── gradlew.bat │ │ │ └── settings.gradle │ │ ├── app.json │ │ ├── babel.config.js │ │ ├── index.js │ │ ├── jest.config.js │ │ ├── metro.config.js │ │ ├── package.json │ │ └── src/ │ │ ├── App.js │ │ └── styles.js │ ├── package.json │ └── src/ │ ├── Availability.js │ ├── index.d.ts │ └── index.js ├── react-native-hms-awareness/ │ ├── LICENSE │ ├── README.md │ ├── android/ │ │ ├── build.gradle │ │ ├── gradle/ │ │ │ └── wrapper/ │ │ │ └── gradle-wrapper.properties │ │ ├── gradle.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── src/ │ │ └── main/ │ │ ├── AndroidManifest.xml │ │ └── java/ │ │ └── com/ │ │ └── huawei/ │ │ └── hms/ │ │ └── rn/ │ │ └── awareness/ │ │ ├── HMSAwarenessPackage.java │ │ ├── constants/ │ │ │ ├── Constants.java │ │ │ └── LocaleConstants.java │ │ ├── logger/ │ │ │ └── HMSLogger.java │ │ ├── modules/ │ │ │ ├── HMSAwarenessBarrierModule.java │ │ │ ├── HMSAwarenessCaptureModule.java │ │ │ └── HMSLoggerModule.java │ │ ├── utils/ │ │ │ ├── BackgroundBarrierReceiver.java │ │ │ ├── BarrierReceiver.java │ │ │ ├── DataUtils.java │ │ │ └── TaskService.java │ │ └── wrapper/ │ │ ├── AwarenessBarrierWrapper.java │ │ ├── AwarenessCaptureWrapper.java │ │ └── AwarenessCombinationBarrierWrapper.java │ ├── example/ │ │ ├── .gitignore │ │ ├── App.js │ │ ├── README.md │ │ ├── android/ │ │ │ ├── app/ │ │ │ │ ├── build.gradle │ │ │ │ ├── proguard-rules.pro │ │ │ │ └── src/ │ │ │ │ ├── debug/ │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ └── main/ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── java/ │ │ │ │ │ └── com/ │ │ │ │ │ └── huawei/ │ │ │ │ │ └── hms/ │ │ │ │ │ └── rn/ │ │ │ │ │ └── awareness/ │ │ │ │ │ └── demo/ │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MainApplication.java │ │ │ │ └── res/ │ │ │ │ └── values/ │ │ │ │ └── styles.xml │ │ │ ├── build.gradle │ │ │ ├── gradle/ │ │ │ │ └── wrapper/ │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── gradle.properties │ │ │ ├── gradlew │ │ │ ├── gradlew.bat │ │ │ └── settings.gradle │ │ ├── babel.config.js │ │ ├── components/ │ │ │ ├── Barrier.js │ │ │ ├── Capture.js │ │ │ └── UpdateBarrier.js │ │ ├── constants/ │ │ │ ├── Colors.js │ │ │ └── Data.js │ │ ├── index.js │ │ ├── metro.config.js │ │ └── package.json │ ├── index.js │ └── package.json ├── react-native-hms-contactshield/ │ ├── LICENCE │ ├── README.md │ ├── THIRD PARTY OPEN SOURCE SOFTWARE NOTICE.txt │ ├── android/ │ │ ├── build.gradle │ │ ├── gradle/ │ │ │ └── wrapper/ │ │ │ └── gradle-wrapper.properties │ │ ├── gradle.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── src/ │ │ └── main/ │ │ ├── AndroidManifest.xml │ │ └── java/ │ │ └── com/ │ │ └── huawei/ │ │ └── hms/ │ │ └── rn/ │ │ └── contactshield/ │ │ ├── HMSContactShieldModule.java │ │ ├── HMSContactShieldPackage.java │ │ ├── constants/ │ │ │ ├── IntentAction.java │ │ │ └── RequestCode.java │ │ ├── handlers/ │ │ │ ├── ContactShieldBroadcastReceiver.java │ │ │ └── ContactShieldCallbackHandler.java │ │ ├── logger/ │ │ │ └── HMSLogger.java │ │ └── utils/ │ │ ├── ObjectProvider.java │ │ └── Utils.java │ ├── example/ │ │ ├── .gitignore │ │ ├── App.js │ │ ├── README.md │ │ ├── android/ │ │ │ ├── app/ │ │ │ │ ├── build.gradle │ │ │ │ ├── proguard-rules.pro │ │ │ │ └── src/ │ │ │ │ ├── debug/ │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ └── main/ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── java/ │ │ │ │ │ └── com/ │ │ │ │ │ └── huawei/ │ │ │ │ │ └── hms/ │ │ │ │ │ └── rn/ │ │ │ │ │ └── contactshield/ │ │ │ │ │ └── demo/ │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MainApplication.java │ │ │ │ └── res/ │ │ │ │ └── values/ │ │ │ │ └── styles.xml │ │ │ ├── build.gradle │ │ │ ├── gradle/ │ │ │ │ └── wrapper/ │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── gradle.properties │ │ │ ├── gradlew │ │ │ ├── gradlew.bat │ │ │ └── settings.gradle │ │ ├── app.json │ │ ├── babel.config.js │ │ ├── index.js │ │ ├── metro.config.js │ │ └── package.json │ ├── package.json │ └── src/ │ ├── index.d.ts │ └── index.js ├── react-native-hms-dtm/ │ ├── LICENSE │ ├── README.md │ ├── android/ │ │ ├── build.gradle │ │ ├── gradle/ │ │ │ └── wrapper/ │ │ │ └── gradle-wrapper.properties │ │ ├── gradle.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── src/ │ │ └── main/ │ │ ├── AndroidManifest.xml │ │ └── java/ │ │ └── com/ │ │ └── huawei/ │ │ └── hms/ │ │ └── rn/ │ │ └── dtm/ │ │ ├── HMSDtmModule.java │ │ ├── HMSDtmPackage.java │ │ ├── HMSDtmProvider.java │ │ ├── HMSDtmWrapper.java │ │ ├── helpers/ │ │ │ ├── ContextHolder.java │ │ │ └── MapHelper.java │ │ ├── interfaces/ │ │ │ ├── CustomTag.java │ │ │ └── CustomVariable.java │ │ └── logger/ │ │ └── HMSLogger.java │ ├── example/ │ │ ├── .gitignore │ │ ├── App.js │ │ ├── LICENSE │ │ ├── README.md │ │ ├── android/ │ │ │ ├── app/ │ │ │ │ ├── BUCK │ │ │ │ ├── build.gradle │ │ │ │ ├── proguard-rules.pro │ │ │ │ └── src/ │ │ │ │ ├── debug/ │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ └── main/ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── java/ │ │ │ │ │ └── com/ │ │ │ │ │ └── huawei/ │ │ │ │ │ └── hms/ │ │ │ │ │ └── rn/ │ │ │ │ │ └── dtm/ │ │ │ │ │ └── demo/ │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MainApplication.java │ │ │ │ └── res/ │ │ │ │ └── values/ │ │ │ │ └── styles.xml │ │ │ ├── build.gradle │ │ │ ├── gradle/ │ │ │ │ └── wrapper/ │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── gradle.properties │ │ │ ├── gradlew │ │ │ ├── gradlew.bat │ │ │ └── settings.gradle │ │ ├── babel.config.js │ │ ├── index.js │ │ ├── metro.config.js │ │ └── package.json │ ├── package.json │ └── src/ │ ├── index.d.ts │ └── index.js ├── react-native-hms-health/ │ ├── LICENSE │ ├── README.md │ ├── android/ │ │ ├── build.gradle │ │ ├── gradle/ │ │ │ └── wrapper/ │ │ │ └── gradle-wrapper.properties │ │ ├── gradle.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── src/ │ │ └── main/ │ │ ├── AndroidManifest.xml │ │ └── java/ │ │ └── com/ │ │ └── huawei/ │ │ └── hms/ │ │ └── rn/ │ │ └── health/ │ │ ├── HmsHealthPackage.java │ │ ├── foundation/ │ │ │ ├── constant/ │ │ │ │ └── Constants.java │ │ │ ├── helper/ │ │ │ │ ├── ResultHelper.java │ │ │ │ └── VoidResultHelper.java │ │ │ ├── listener/ │ │ │ │ ├── ResultListener.java │ │ │ │ └── VoidResultListener.java │ │ │ ├── util/ │ │ │ │ ├── ExceptionHandler.java │ │ │ │ ├── HMSLogger.java │ │ │ │ ├── MapUtils.java │ │ │ │ └── Utils.java │ │ │ └── view/ │ │ │ ├── BaseController.java │ │ │ └── BaseProtocol.java │ │ └── kits/ │ │ ├── account/ │ │ │ ├── HmsHealthAccount.java │ │ │ ├── listener/ │ │ │ │ └── AccountResultListener.java │ │ │ ├── util/ │ │ │ │ ├── AccountConstants.java │ │ │ │ └── AccountUtils.java │ │ │ └── viewmodel/ │ │ │ ├── AccountService.java │ │ │ └── AccountViewModel.java │ │ ├── activityrecords/ │ │ │ ├── HmsActivityRecordsController.java │ │ │ ├── receiver/ │ │ │ │ └── ActivityRecordsMonitorReceiver.java │ │ │ ├── util/ │ │ │ │ ├── ActivityRecordBackgroundService.java │ │ │ │ ├── ActivityRecordsConstants.java │ │ │ │ └── ActivityRecordsUtils.java │ │ │ └── viewmodel/ │ │ │ ├── ActivityRecordsService.java │ │ │ └── ActivityRecordsViewModel.java │ │ ├── autorecorder/ │ │ │ ├── HmsAutoRecorderController.java │ │ │ ├── listener/ │ │ │ │ ├── RecordListResultListener.java │ │ │ │ └── TaskVoidResultListener.java │ │ │ ├── utils/ │ │ │ │ ├── AutoRecorderBackgroundService.java │ │ │ │ └── AutoRecorderConstants.java │ │ │ └── viewmodel/ │ │ │ ├── AutoRecorderService.java │ │ │ └── AutoRecorderViewModel.java │ │ ├── consents/ │ │ │ ├── HmsConsentsController.java │ │ │ └── viewmodel/ │ │ │ ├── ConsentsService.java │ │ │ └── ConsentsViewModel.java │ │ ├── datacontroller/ │ │ │ ├── HmsDataController.java │ │ │ ├── model/ │ │ │ │ └── OptionModel.java │ │ │ ├── util/ │ │ │ │ ├── DataControllerConstants.java │ │ │ │ └── DataControllerUtils.java │ │ │ └── viewmodel/ │ │ │ ├── DataService.java │ │ │ └── DataViewModel.java │ │ ├── healthrecordcontroller/ │ │ │ ├── HmsHealthRecordController.java │ │ │ ├── util/ │ │ │ │ └── HealthRecordControllerUtils.java │ │ │ └── viewmodel/ │ │ │ ├── HealthRecordService.java │ │ │ └── HealthRecordViewModel.java │ │ └── settings/ │ │ ├── HmsSettingController.java │ │ └── viewmodel/ │ │ ├── SettingsService.java │ │ └── SettingsViewModel.java │ ├── example/ │ │ ├── .gitignore │ │ ├── App.js │ │ ├── README.md │ │ ├── android/ │ │ │ ├── app/ │ │ │ │ ├── BUCK │ │ │ │ ├── build.gradle │ │ │ │ ├── proguard-rules.pro │ │ │ │ └── src/ │ │ │ │ ├── debug/ │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ └── main/ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── java/ │ │ │ │ │ └── com/ │ │ │ │ │ └── huawei/ │ │ │ │ │ └── hms/ │ │ │ │ │ └── rn/ │ │ │ │ │ └── health/ │ │ │ │ │ └── demo/ │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MainApplication.java │ │ │ │ └── res/ │ │ │ │ └── values/ │ │ │ │ └── styles.xml │ │ │ ├── build.gradle │ │ │ ├── gradle/ │ │ │ │ └── wrapper/ │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── gradle.properties │ │ │ ├── gradlew │ │ │ ├── gradlew.bat │ │ │ └── settings.gradle │ │ ├── app.json │ │ ├── babel.config.js │ │ ├── index.js │ │ ├── metro.config.js │ │ ├── package.json │ │ └── src/ │ │ ├── ActivityRecordsController.js │ │ ├── AutoRecorderController.js │ │ ├── ConsentsController.js │ │ ├── DataController.js │ │ ├── HealthRecordController.js │ │ ├── MainPage.js │ │ ├── SettingController.js │ │ ├── Utils.js │ │ └── styles.js │ ├── package.json │ └── src/ │ ├── index.d.ts │ └── index.js ├── react-native-hms-iap/ │ ├── LICENSE │ ├── OpenSourceSoftwareNotice.html │ ├── README.md │ ├── android/ │ │ ├── README.md │ │ ├── build.gradle │ │ ├── gradle/ │ │ │ └── wrapper/ │ │ │ └── gradle-wrapper.properties │ │ ├── gradle.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── src/ │ │ └── main/ │ │ ├── AndroidManifest.xml │ │ └── java/ │ │ └── com/ │ │ └── huawei/ │ │ └── hms/ │ │ └── rn/ │ │ └── iap/ │ │ ├── HMSIapModule.java │ │ ├── HMSIapPackage.java │ │ └── client/ │ │ ├── Helper.java │ │ ├── logger/ │ │ │ └── HMSLogger.java │ │ ├── utils/ │ │ │ ├── Constants.java │ │ │ ├── DataUtils.java │ │ │ ├── ExceptionHandler.java │ │ │ └── MapUtil.java │ │ └── viewmodel/ │ │ ├── Service.java │ │ └── ViewModel.java │ ├── example/ │ │ ├── .gitignore │ │ ├── App.js │ │ ├── README.md │ │ ├── android/ │ │ │ ├── app/ │ │ │ │ ├── build.gradle │ │ │ │ ├── proguard-rules.pro │ │ │ │ └── src/ │ │ │ │ ├── debug/ │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ └── main/ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── java/ │ │ │ │ │ └── com/ │ │ │ │ │ └── huawei/ │ │ │ │ │ └── hms/ │ │ │ │ │ └── rn/ │ │ │ │ │ └── iap/ │ │ │ │ │ └── demo/ │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MainApplication.java │ │ │ │ └── res/ │ │ │ │ └── values/ │ │ │ │ └── styles.xml │ │ │ ├── build.gradle │ │ │ ├── gradle/ │ │ │ │ └── wrapper/ │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── gradle.properties │ │ │ ├── gradlew │ │ │ ├── gradlew.bat │ │ │ └── settings.gradle │ │ ├── app.json │ │ ├── babel.config.js │ │ ├── index.js │ │ ├── metro.config.js │ │ ├── package.json │ │ └── src/ │ │ ├── HmsIapModule.js │ │ ├── foundation/ │ │ │ ├── ProductTypes.js │ │ │ └── PurchaseTypes.js │ │ ├── ui/ │ │ │ ├── AvailableProductsListView.js │ │ │ ├── PartialView.js │ │ │ ├── PurchaseRecordListView.js │ │ │ ├── PurchasedProductListView.js │ │ │ └── TitleView.js │ │ └── utils/ │ │ ├── Globals.js │ │ └── Utils.js │ ├── package.json │ └── src/ │ ├── index.d.ts │ └── index.js ├── react-native-hms-location/ │ ├── LICENSE │ ├── README.md │ ├── android/ │ │ ├── build.gradle │ │ ├── gradle/ │ │ │ └── wrapper/ │ │ │ └── gradle-wrapper.properties │ │ ├── gradle.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── src/ │ │ └── main/ │ │ ├── AndroidManifest.xml │ │ └── java/ │ │ └── com/ │ │ └── huawei/ │ │ └── hms/ │ │ └── rn/ │ │ └── location/ │ │ ├── RNHMSLocationPackage.java │ │ ├── RNLocationBroadcastReceiver.java │ │ ├── RNTaskService.java │ │ ├── backend/ │ │ │ ├── helpers/ │ │ │ │ ├── Constants.java │ │ │ │ ├── Exceptions.java │ │ │ │ ├── HMSBroadcastReceiver.java │ │ │ │ ├── LocationCallbackWithHandler.java │ │ │ │ └── Pair.java │ │ │ ├── interfaces/ │ │ │ │ ├── EventSender.java │ │ │ │ ├── HMSCallback.java │ │ │ │ ├── HMSProvider.java │ │ │ │ ├── JSONMapper.java │ │ │ │ ├── JSONTriMapper.java │ │ │ │ ├── Mapper.java │ │ │ │ ├── PermissionHandler.java │ │ │ │ ├── ResultHandler.java │ │ │ │ └── TriMapper.java │ │ │ ├── logger/ │ │ │ │ ├── HMSLogger.java │ │ │ │ └── HMSMethod.java │ │ │ ├── providers/ │ │ │ │ ├── ActivityIdentificationProvider.java │ │ │ │ ├── FusedLocationProvider.java │ │ │ │ ├── GeocoderProvider.java │ │ │ │ └── GeofenceProvider.java │ │ │ └── utils/ │ │ │ ├── ActivityUtils.java │ │ │ ├── GeocoderUtils.java │ │ │ ├── GeofenceUtils.java │ │ │ ├── LocationUtils.java │ │ │ ├── PermissionUtils.java │ │ │ └── PlatformUtils.java │ │ ├── helpers/ │ │ │ ├── RNCallback.java │ │ │ └── ReactUtils.java │ │ └── modules/ │ │ ├── RNActivityIdentificationModule.java │ │ ├── RNFusedLocationModule.java │ │ ├── RNGeocoderModule.java │ │ ├── RNGeofenceModule.java │ │ └── RNLocationKitModule.java │ ├── example/ │ │ ├── App.js │ │ ├── LICENSE │ │ ├── README.md │ │ ├── android/ │ │ │ ├── app/ │ │ │ │ ├── build.gradle │ │ │ │ ├── proguard-rules.pro │ │ │ │ └── src/ │ │ │ │ ├── debug/ │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ └── main/ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── java/ │ │ │ │ │ └── com/ │ │ │ │ │ └── huawei/ │ │ │ │ │ └── hms/ │ │ │ │ │ └── rn/ │ │ │ │ │ └── location/ │ │ │ │ │ └── demo/ │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MainApplication.java │ │ │ │ └── res/ │ │ │ │ └── values/ │ │ │ │ └── styles.xml │ │ │ ├── build.gradle │ │ │ ├── gradle/ │ │ │ │ └── wrapper/ │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── gradle.properties │ │ │ ├── gradlew │ │ │ ├── gradlew.bat │ │ │ └── settings.gradle │ │ ├── app.json │ │ ├── babel.config.js │ │ ├── index.js │ │ ├── metro.config.js │ │ └── package.json │ ├── package.json │ └── src/ │ ├── index.d.ts │ ├── index.js │ └── modules/ │ ├── ActivityIdentification.js │ ├── FusedLocation.js │ ├── Geocoder.js │ ├── Geofence.js │ └── LocationKit.js ├── react-native-hms-map/ │ ├── LICENSE │ ├── README.md │ ├── android/ │ │ ├── build.gradle │ │ ├── gradle/ │ │ │ └── wrapper/ │ │ │ └── gradle-wrapper.properties │ │ ├── gradle.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── src/ │ │ └── main/ │ │ ├── AndroidManifest.xml │ │ └── java/ │ │ └── com/ │ │ └── huawei/ │ │ └── hms/ │ │ └── rn/ │ │ └── map/ │ │ ├── HMSCircleView.java │ │ ├── HMSGroundOverlayView.java │ │ ├── HMSHeatMapView.java │ │ ├── HMSInfoWindowView.java │ │ ├── HMSMapPackage.java │ │ ├── HMSMapView.java │ │ ├── HMSMarkerView.java │ │ ├── HMSPolygonView.java │ │ ├── HMSPolylineView.java │ │ ├── HMSTileOverlayView.java │ │ ├── logger/ │ │ │ └── HMSLogger.java │ │ └── utils/ │ │ ├── ReactUtils.java │ │ ├── UriIconController.java │ │ └── UriIconView.java │ ├── example/ │ │ ├── App.js │ │ ├── LICENSE │ │ ├── README.md │ │ ├── android/ │ │ │ ├── app/ │ │ │ │ ├── BUCK │ │ │ │ ├── build.gradle │ │ │ │ ├── proguard-rules.pro │ │ │ │ └── src/ │ │ │ │ ├── debug/ │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ └── main/ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── java/ │ │ │ │ │ └── com/ │ │ │ │ │ └── huawei/ │ │ │ │ │ └── rnhmsmapdemo/ │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MainApplication.java │ │ │ │ └── res/ │ │ │ │ └── values/ │ │ │ │ └── styles.xml │ │ │ ├── build.gradle │ │ │ ├── gradle/ │ │ │ │ └── wrapper/ │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── gradle.properties │ │ │ ├── gradlew │ │ │ ├── gradlew.bat │ │ │ └── settings.gradle │ │ ├── app.json │ │ ├── babel.config.js │ │ ├── earthquakes_with_usa.json │ │ ├── index.js │ │ ├── mapStyle.json │ │ ├── metro.config.js │ │ ├── package.json │ │ ├── screens/ │ │ │ ├── AdvancedMap.js │ │ │ ├── BasicMap.js │ │ │ ├── CameraControl.js │ │ │ ├── Gestures.js │ │ │ ├── HeatMap.js │ │ │ ├── Location.js │ │ │ ├── MapLayers.js │ │ │ ├── MapStyle.js │ │ │ └── Markers.js │ │ └── styles/ │ │ └── styles.js │ ├── package.json │ └── src/ │ ├── CircleView.js │ ├── GroundOverlayView.js │ ├── HeatMapView.js │ ├── InfoWindowView.js │ ├── MapView.js │ ├── MarkerView.js │ ├── PolygonView.js │ ├── PolylineView.js │ ├── TileOverlayView.js │ ├── constants.js │ ├── index.d.ts │ └── index.js ├── react-native-hms-ml/ │ ├── LICENCE │ ├── README.md │ ├── THIRD PARTY OPEN SOURCE SOFTWARE NOTICE.txt │ ├── android/ │ │ ├── build.gradle │ │ ├── gradle/ │ │ │ └── wrapper/ │ │ │ └── gradle-wrapper.properties │ │ ├── gradle.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── src/ │ │ └── main/ │ │ ├── AndroidManifest.xml │ │ ├── java/ │ │ │ └── com/ │ │ │ └── huawei/ │ │ │ └── hms/ │ │ │ └── rn/ │ │ │ └── ml/ │ │ │ ├── HMSBase.java │ │ │ ├── HMSML.java │ │ │ ├── commonservices/ │ │ │ │ ├── HMSApplication.java │ │ │ │ ├── HMSComposite.java │ │ │ │ └── HMSLensEngine.java │ │ │ ├── facebodyrelatedservices/ │ │ │ │ ├── HMSFaceRecognition.java │ │ │ │ ├── HMSFaceVerification.java │ │ │ │ ├── HMSGestureDetection.java │ │ │ │ ├── HMSHandKeypointDetection.java │ │ │ │ ├── HMSLivenessDetection.java │ │ │ │ └── HMSSkeletonDetection.java │ │ │ ├── helpers/ │ │ │ │ ├── adapters/ │ │ │ │ │ └── HMSBottomSheetAdapter.java │ │ │ │ ├── constants/ │ │ │ │ │ ├── HMSConstants.java │ │ │ │ │ └── HMSResults.java │ │ │ │ ├── creators/ │ │ │ │ │ ├── HMSObjectCreator.java │ │ │ │ │ └── HMSResultCreator.java │ │ │ │ ├── fragments/ │ │ │ │ │ └── HMSProductFragment.java │ │ │ │ ├── models/ │ │ │ │ │ └── HMSProductModel.java │ │ │ │ ├── transactors/ │ │ │ │ │ ├── HMS2DFaceAnalyzerTransactor.java │ │ │ │ │ ├── HMS3DFaceAnalyzerTransactor.java │ │ │ │ │ ├── HMSBaseTransactor.java │ │ │ │ │ ├── HMSClassificationAnalyzerTransactor.java │ │ │ │ │ ├── HMSGestureTransactor.java │ │ │ │ │ ├── HMSHandKeypointTransactor.java │ │ │ │ │ ├── HMSObjectAnalyzerTransactor.java │ │ │ │ │ ├── HMSSceneDetectionAnalyzerTransactor.java │ │ │ │ │ ├── HMSSkeletonAnalyzerTransactor.java │ │ │ │ │ └── HMSTextAnalyzerTransactor.java │ │ │ │ ├── utils/ │ │ │ │ │ ├── HMSBackgroundTasks.java │ │ │ │ │ ├── HMSLogger.java │ │ │ │ │ └── HMSUtils.java │ │ │ │ └── views/ │ │ │ │ ├── HMSBottomSheetGridView.java │ │ │ │ ├── HMSCustomSurfaceView.java │ │ │ │ └── HMSSurfaceView.java │ │ │ ├── imagerelatedservices/ │ │ │ │ ├── HMSDocumentSkewCorrection.java │ │ │ │ ├── HMSFrame.java │ │ │ │ ├── HMSImageClassification.java │ │ │ │ ├── HMSImageSegmentation.java │ │ │ │ ├── HMSImageSuperResolution.java │ │ │ │ ├── HMSLandmarkRecognition.java │ │ │ │ ├── HMSObjectRecognition.java │ │ │ │ ├── HMSProductVisionSearch.java │ │ │ │ ├── HMSSceneDetection.java │ │ │ │ └── HMSTextImageSuperResolution.java │ │ │ ├── languagevoicerelatedservices/ │ │ │ │ ├── HMSAft.java │ │ │ │ ├── HMSAsr.java │ │ │ │ ├── HMSLanguageDetection.java │ │ │ │ ├── HMSSoundDetect.java │ │ │ │ ├── HMSSpeechRtt.java │ │ │ │ ├── HMSTextToSpeech.java │ │ │ │ └── HMSTranslate.java │ │ │ ├── modelrelatedservices/ │ │ │ │ ├── HMSCustomModel.java │ │ │ │ └── HMSModelDownload.java │ │ │ ├── nlprelatedservices/ │ │ │ │ └── HMSTextEmbedding.java │ │ │ └── textrelatedservices/ │ │ │ ├── HMSBankCardRecognition.java │ │ │ ├── HMSDocumentRecognition.java │ │ │ ├── HMSFormRecognition.java │ │ │ ├── HMSGeneralCardRecognition.java │ │ │ ├── HMSIDCardRecognition.java │ │ │ ├── HMSTextRecognition.java │ │ │ └── HMSVietnamCardRecognition.java │ │ └── res/ │ │ └── layout/ │ │ ├── hms_product_fragment.xml │ │ └── hms_product_item.xml │ ├── example/ │ │ ├── .gitignore │ │ ├── App.js │ │ ├── README.md │ │ ├── android/ │ │ │ ├── app/ │ │ │ │ ├── build.gradle │ │ │ │ ├── proguard-rules.pro │ │ │ │ └── src/ │ │ │ │ ├── debug/ │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ └── main/ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── java/ │ │ │ │ │ └── com/ │ │ │ │ │ └── huawei/ │ │ │ │ │ └── hms/ │ │ │ │ │ └── rn/ │ │ │ │ │ └── ml/ │ │ │ │ │ └── demo/ │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MainApplication.java │ │ │ │ └── res/ │ │ │ │ └── values/ │ │ │ │ └── styles.xml │ │ │ ├── build.gradle │ │ │ ├── gradle/ │ │ │ │ └── wrapper/ │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── gradle.properties │ │ │ ├── gradlew │ │ │ ├── gradlew.bat │ │ │ └── settings.gradle │ │ ├── app.json │ │ ├── babel.config.js │ │ ├── index.js │ │ ├── metro.config.js │ │ ├── package.json │ │ └── src/ │ │ ├── HmsFaceBodyRelatedServices/ │ │ │ ├── FaceRecognition.js │ │ │ ├── FaceRecognitionLive.js │ │ │ ├── FaceVerification.js │ │ │ ├── GestureDetection.js │ │ │ ├── GestureDetectionLive.js │ │ │ ├── HandDetection.js │ │ │ ├── HandDetectionLive.js │ │ │ ├── LivenessDetection.js │ │ │ ├── SkeletonDetection.js │ │ │ └── SkeletonDetectionLive.js │ │ ├── HmsImageRelatedServices/ │ │ │ ├── DocumentSkewCorrection.js │ │ │ ├── Frame.js │ │ │ ├── ImageClassification.js │ │ │ ├── ImageClassificationLive.js │ │ │ ├── ImageSegmentation.js │ │ │ ├── ImageSuperResolution.js │ │ │ ├── LandmarkRecognition.js │ │ │ ├── ObjectDetection.js │ │ │ ├── ObjectDetectionLive.js │ │ │ ├── ProductVisualSearch.js │ │ │ ├── SceneDetection.js │ │ │ ├── SceneDetectionLive.js │ │ │ └── TextImageSuperResolution.js │ │ ├── HmsLanguageVoiceRelatedServices/ │ │ │ ├── AudioFileTranscription.js │ │ │ ├── AutomaticSpeechRecognition.js │ │ │ ├── LanguageDetection.js │ │ │ ├── RealTimeTranscription.js │ │ │ ├── SoundDetection.js │ │ │ ├── TextToSpeech.js │ │ │ └── Translation.js │ │ ├── HmsNaturalLanguageProcessingServices/ │ │ │ └── TextEmbedding.js │ │ ├── HmsOtherServices/ │ │ │ ├── CustomModel.js │ │ │ ├── HMSCompositeAnalyzer.js │ │ │ ├── Helper.js │ │ │ └── ModelDownload.js │ │ ├── HmsTextRelatedServices/ │ │ │ ├── BankCardRecognition.js │ │ │ ├── DocumentRecognition.js │ │ │ ├── FormRecognition.js │ │ │ ├── GeneralCardRecognition.js │ │ │ ├── IDCardRecognition.js │ │ │ ├── TextRecognition.js │ │ │ ├── TextRecognitionLive.js │ │ │ └── VietnamIDCardRecognition.js │ │ ├── StartPage.js │ │ └── Styles.js │ ├── package.json │ └── src/ │ ├── index.d.ts │ └── index.js ├── react-native-hms-mlbody/ │ ├── LICENSE │ ├── OpenSourceSoftwareNotice.html │ ├── README.md │ ├── android/ │ │ ├── build.gradle │ │ ├── gradle/ │ │ │ └── wrapper/ │ │ │ └── gradle-wrapper.properties │ │ ├── gradle.properties │ │ └── src/ │ │ └── main/ │ │ ├── AndroidManifest.xml │ │ ├── java/ │ │ │ └── com/ │ │ │ └── huawei/ │ │ │ └── hms/ │ │ │ └── rn/ │ │ │ └── mlbody/ │ │ │ ├── HMSBase.java │ │ │ ├── HMSMLBody.java │ │ │ ├── commonservices/ │ │ │ │ ├── HMSApplication.java │ │ │ │ └── HMSLensEngine.java │ │ │ ├── facebodyrelatedservices/ │ │ │ │ ├── HMSFaceRecognition.java │ │ │ │ ├── HMSFaceVerification.java │ │ │ │ ├── HMSGestureDetection.java │ │ │ │ ├── HMSHandKeypointDetection.java │ │ │ │ ├── HMSInteractiveCustomLivenessDetectionActivity.java │ │ │ │ ├── HMSInteractiveLivenessCustomDetectionHandler.java │ │ │ │ ├── HMSInteractiveLivenessDetection.java │ │ │ │ ├── HMSLivenessDetection.java │ │ │ │ └── HMSSkeletonDetection.java │ │ │ └── helpers/ │ │ │ ├── constants/ │ │ │ │ ├── HMSConstants.java │ │ │ │ └── HMSResults.java │ │ │ ├── creators/ │ │ │ │ ├── HMSObjectCreator.java │ │ │ │ └── HMSResultCreator.java │ │ │ ├── transactors/ │ │ │ │ ├── HMS2DFaceAnalyzerTransactor.java │ │ │ │ ├── HMS3DFaceAnalyzerTransactor.java │ │ │ │ ├── HMSBaseTransactor.java │ │ │ │ ├── HMSGestureTransactor.java │ │ │ │ ├── HMSHandKeypointTransactor.java │ │ │ │ └── HMSSkeletonAnalyzerTransactor.java │ │ │ ├── utils/ │ │ │ │ ├── HMSBackgroundTasks.java │ │ │ │ ├── HMSLogger.java │ │ │ │ └── HMSUtils.java │ │ │ └── views/ │ │ │ ├── HMSCustomSurfaceView.java │ │ │ └── HMSSurfaceView.java │ │ └── res/ │ │ ├── layout/ │ │ │ ├── activity_liveness_custom_detection.xml │ │ │ ├── hms_product_fragment.xml │ │ │ └── hms_product_item.xml │ │ └── values/ │ │ └── strings.xml │ ├── example/ │ │ ├── .gitignore │ │ ├── App.js │ │ ├── README.md │ │ ├── android/ │ │ │ ├── app/ │ │ │ │ ├── build.gradle │ │ │ │ ├── proguard-rules.pro │ │ │ │ └── src/ │ │ │ │ ├── debug/ │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ └── main/ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── java/ │ │ │ │ │ └── com/ │ │ │ │ │ └── huawei/ │ │ │ │ │ └── hms/ │ │ │ │ │ └── rn/ │ │ │ │ │ └── mlbody/ │ │ │ │ │ └── demo/ │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MainApplication.java │ │ │ │ └── res/ │ │ │ │ └── values/ │ │ │ │ └── styles.xml │ │ │ ├── build.gradle │ │ │ ├── gradle/ │ │ │ │ └── wrapper/ │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── gradle.properties │ │ │ └── settings.gradle │ │ ├── app.json │ │ ├── babel.config.js │ │ ├── index.js │ │ ├── metro.config.js │ │ ├── package.json │ │ └── src/ │ │ ├── HmsFaceBodyRelatedServices/ │ │ │ ├── FaceRecognition.js │ │ │ ├── FaceRecognitionLive.js │ │ │ ├── FaceVerification.js │ │ │ ├── GestureDetection.js │ │ │ ├── GestureDetectionLive.js │ │ │ ├── HandDetection.js │ │ │ ├── HandDetectionLive.js │ │ │ ├── InteractiveLivenessDetection.js │ │ │ ├── LivenessDetection.js │ │ │ ├── SkeletonDetection.js │ │ │ └── SkeletonDetectionLive.js │ │ ├── HmsOtherServices/ │ │ │ └── Helper.js │ │ ├── StartPage.js │ │ └── Styles.js │ ├── package.json │ └── src/ │ ├── index.d.ts │ └── index.js ├── react-native-hms-mlimage/ │ ├── LICENSE │ ├── OpenSourceSoftwareNotice.html │ ├── README.md │ ├── android/ │ │ ├── build.gradle │ │ ├── gradle/ │ │ │ └── wrapper/ │ │ │ └── gradle-wrapper.properties │ │ ├── gradle.properties │ │ └── src/ │ │ └── main/ │ │ ├── AndroidManifest.xml │ │ ├── java/ │ │ │ └── com/ │ │ │ └── huawei/ │ │ │ └── hms/ │ │ │ └── rn/ │ │ │ └── mlimage/ │ │ │ ├── HMSBase.java │ │ │ ├── HMSMLImage.java │ │ │ ├── commonservices/ │ │ │ │ ├── HMSApplication.java │ │ │ │ ├── HMSComposite.java │ │ │ │ └── HMSLensEngine.java │ │ │ ├── helpers/ │ │ │ │ ├── adapters/ │ │ │ │ │ └── HMSBottomSheetAdapter.java │ │ │ │ ├── constants/ │ │ │ │ │ ├── HMSConstants.java │ │ │ │ │ └── HMSResults.java │ │ │ │ ├── creators/ │ │ │ │ │ ├── HMSObjectCreator.java │ │ │ │ │ └── HMSResultCreator.java │ │ │ │ ├── fragments/ │ │ │ │ │ └── HMSProductFragment.java │ │ │ │ ├── models/ │ │ │ │ │ └── HMSProductModel.java │ │ │ │ ├── transactors/ │ │ │ │ │ ├── HMSBaseTransactor.java │ │ │ │ │ ├── HMSClassificationAnalyzerTransactor.java │ │ │ │ │ ├── HMSObjectAnalyzerTransactor.java │ │ │ │ │ └── HMSSceneDetectionAnalyzerTransactor.java │ │ │ │ ├── utils/ │ │ │ │ │ ├── HMSBackgroundTasks.java │ │ │ │ │ ├── HMSLogger.java │ │ │ │ │ └── HMSUtils.java │ │ │ │ └── views/ │ │ │ │ ├── HMSBottomSheetGridView.java │ │ │ │ ├── HMSCustomSurfaceView.java │ │ │ │ └── HMSSurfaceView.java │ │ │ └── imagerelatedservices/ │ │ │ ├── HMSDocumentSkewCorrection.java │ │ │ ├── HMSFrame.java │ │ │ ├── HMSImageClassification.java │ │ │ ├── HMSImageSegmentation.java │ │ │ ├── HMSImageSuperResolution.java │ │ │ ├── HMSLandmarkRecognition.java │ │ │ ├── HMSObjectRecognition.java │ │ │ ├── HMSProductVisionSearch.java │ │ │ ├── HMSSceneDetection.java │ │ │ └── HMSTextImageSuperResolution.java │ │ └── res/ │ │ └── layout/ │ │ ├── hms_product_fragment.xml │ │ └── hms_product_item.xml │ ├── example/ │ │ ├── .gitignore │ │ ├── App.js │ │ ├── LICENSE │ │ ├── README.md │ │ ├── android/ │ │ │ ├── app/ │ │ │ │ ├── build.gradle │ │ │ │ ├── proguard-rules.pro │ │ │ │ └── src/ │ │ │ │ ├── debug/ │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ └── main/ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── java/ │ │ │ │ │ └── com/ │ │ │ │ │ └── huawei/ │ │ │ │ │ └── hms/ │ │ │ │ │ └── rn/ │ │ │ │ │ └── ml/ │ │ │ │ │ └── demo/ │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MainApplication.java │ │ │ │ └── res/ │ │ │ │ └── values/ │ │ │ │ └── styles.xml │ │ │ ├── build.gradle │ │ │ ├── gradle/ │ │ │ │ └── wrapper/ │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── gradle.properties │ │ │ └── settings.gradle │ │ ├── app.json │ │ ├── babel.config.js │ │ ├── index.js │ │ ├── metro.config.js │ │ ├── package.json │ │ └── src/ │ │ ├── HmsImageRelatedServices/ │ │ │ ├── DocumentSkewCorrection.js │ │ │ ├── Frame.js │ │ │ ├── ImageClassification.js │ │ │ ├── ImageClassificationLive.js │ │ │ ├── ImageSegmentation.js │ │ │ ├── ImageSuperResolution.js │ │ │ ├── LandmarkRecognition.js │ │ │ ├── ObjectDetection.js │ │ │ ├── ObjectDetectionLive.js │ │ │ ├── ProductVisualSearch.js │ │ │ ├── SceneDetection.js │ │ │ ├── SceneDetectionLive.js │ │ │ └── TextImageSuperResolution.js │ │ ├── HmsOtherServices/ │ │ │ ├── HMSCompositeAnalyzer.js │ │ │ └── Helper.js │ │ ├── StartPage.js │ │ └── Styles.js │ ├── package.json │ └── src/ │ ├── constants.js │ ├── index.d.ts │ └── index.js ├── react-native-hms-mllanguage/ │ ├── LICENSE │ ├── OpenSourceSoftwareNotice.html │ ├── README.md │ ├── android/ │ │ ├── build.gradle │ │ ├── gradle/ │ │ │ └── wrapper/ │ │ │ └── gradle-wrapper.properties │ │ ├── gradle.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── src/ │ │ └── main/ │ │ ├── AndroidManifest.xml │ │ ├── java/ │ │ │ └── com/ │ │ │ └── huawei/ │ │ │ └── hms/ │ │ │ └── rn/ │ │ │ └── mllanguage/ │ │ │ ├── HMSBase.java │ │ │ ├── HMSML.java │ │ │ ├── commonservices/ │ │ │ │ └── HMSApplication.java │ │ │ ├── helpers/ │ │ │ │ ├── constants/ │ │ │ │ │ ├── HMSConstants.java │ │ │ │ │ └── HMSResults.java │ │ │ │ ├── creators/ │ │ │ │ │ ├── HMSObjectCreator.java │ │ │ │ │ └── HMSResultCreator.java │ │ │ │ ├── utils/ │ │ │ │ │ ├── HMSLogger.java │ │ │ │ │ └── HMSUtils.java │ │ │ │ └── views/ │ │ │ │ └── HMSBottomSheetGridView.java │ │ │ ├── languagevoicerelatedservices/ │ │ │ │ ├── HMSAft.java │ │ │ │ ├── HMSAsr.java │ │ │ │ ├── HMSLanguageDetection.java │ │ │ │ ├── HMSSoundDetect.java │ │ │ │ ├── HMSSpeechRtt.java │ │ │ │ ├── HMSTextToSpeech.java │ │ │ │ └── HMSTranslate.java │ │ │ └── modelrelatedservices/ │ │ │ ├── HMSCustomModel.java │ │ │ └── HMSModelDownload.java │ │ └── res/ │ │ └── layout/ │ │ ├── hms_product_fragment.xml │ │ └── hms_product_item.xml │ ├── example/ │ │ ├── .gitignore │ │ ├── App.js │ │ ├── LICENSE │ │ ├── README.md │ │ ├── android/ │ │ │ ├── app/ │ │ │ │ ├── build.gradle │ │ │ │ ├── proguard-rules.pro │ │ │ │ └── src/ │ │ │ │ ├── debug/ │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ └── main/ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── java/ │ │ │ │ │ └── com/ │ │ │ │ │ └── huawei/ │ │ │ │ │ └── hms/ │ │ │ │ │ └── rn/ │ │ │ │ │ └── mllanguage/ │ │ │ │ │ └── demo/ │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MainApplication.java │ │ │ │ └── res/ │ │ │ │ └── values/ │ │ │ │ └── styles.xml │ │ │ ├── build.gradle │ │ │ ├── gradle/ │ │ │ │ └── wrapper/ │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── gradle.properties │ │ │ ├── gradlew │ │ │ ├── gradlew.bat │ │ │ └── settings.gradle │ │ ├── app.json │ │ ├── babel.config.js │ │ ├── index.js │ │ ├── metro.config.js │ │ ├── package.json │ │ └── src/ │ │ ├── HmsLanguageVoiceRelatedServices/ │ │ │ ├── AudioFileTranscription.js │ │ │ ├── AutomaticSpeechRecognition.js │ │ │ ├── LanguageDetection.js │ │ │ ├── RealTimeTranscription.js │ │ │ ├── SoundDetection.js │ │ │ ├── TextToSpeech.js │ │ │ └── Translation.js │ │ ├── HmsOtherServices/ │ │ │ ├── CustomModel.js │ │ │ ├── Helper.js │ │ │ └── ModelDownload.js │ │ ├── StartPage.js │ │ └── Styles.js │ ├── package.json │ └── src/ │ ├── index.d.ts │ └── index.js ├── react-native-hms-mltext/ │ ├── LICENSE │ ├── OpenSourceSoftwareNotice.html │ ├── README.md │ ├── android/ │ │ ├── build.gradle │ │ ├── gradle/ │ │ │ └── wrapper/ │ │ │ └── gradle-wrapper.properties │ │ ├── gradle.properties │ │ └── src/ │ │ └── main/ │ │ ├── AndroidManifest.xml │ │ ├── java/ │ │ │ └── com/ │ │ │ └── huawei/ │ │ │ └── hms/ │ │ │ └── rn/ │ │ │ └── mltext/ │ │ │ ├── HMSBase.java │ │ │ ├── HMSMLText.java │ │ │ ├── commonservices/ │ │ │ │ ├── HMSApplication.java │ │ │ │ └── HMSLensEngine.java │ │ │ ├── helpers/ │ │ │ │ ├── constants/ │ │ │ │ │ ├── HMSConstants.java │ │ │ │ │ └── HMSResults.java │ │ │ │ ├── creators/ │ │ │ │ │ ├── HMSObjectCreator.java │ │ │ │ │ └── HMSResultCreator.java │ │ │ │ ├── transactors/ │ │ │ │ │ ├── HMSBaseTransactor.java │ │ │ │ │ └── HMSTextAnalyzerTransactor.java │ │ │ │ ├── utils/ │ │ │ │ │ ├── HMSBackgroundTasks.java │ │ │ │ │ ├── HMSLogger.java │ │ │ │ │ └── HMSUtils.java │ │ │ │ └── views/ │ │ │ │ ├── CustomViewActivity.java │ │ │ │ ├── HMSCustomSurfaceView.java │ │ │ │ ├── HMSSurfaceView.java │ │ │ │ └── ViewfinderView.java │ │ │ ├── nlprelatedservices/ │ │ │ │ └── HMSTextEmbedding.java │ │ │ └── textrelatedservices/ │ │ │ ├── CustomViewHandler.java │ │ │ ├── HMSBankCardRecognition.java │ │ │ ├── HMSDocumentRecognition.java │ │ │ ├── HMSFormRecognition.java │ │ │ ├── HMSGeneralCardRecognition.java │ │ │ ├── HMSIDCardRecognition.java │ │ │ ├── HMSTextRecognition.java │ │ │ └── HMSVietnamCardRecognition.java │ │ └── res/ │ │ ├── layout/ │ │ │ └── activity_custom.xml │ │ └── values/ │ │ └── color.xml │ ├── example/ │ │ ├── .gitignore │ │ ├── App.js │ │ ├── README.md │ │ ├── android/ │ │ │ ├── app/ │ │ │ │ ├── build.gradle │ │ │ │ ├── proguard-rules.pro │ │ │ │ └── src/ │ │ │ │ ├── debug/ │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ └── main/ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── java/ │ │ │ │ │ └── com/ │ │ │ │ │ └── huawei/ │ │ │ │ │ └── hms/ │ │ │ │ │ └── rn/ │ │ │ │ │ └── mltext/ │ │ │ │ │ └── demo/ │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MainApplication.java │ │ │ │ └── res/ │ │ │ │ └── values/ │ │ │ │ └── styles.xml │ │ │ ├── build.gradle │ │ │ ├── gradle/ │ │ │ │ └── wrapper/ │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── gradle.properties │ │ │ └── settings.gradle │ │ ├── app.json │ │ ├── babel.config.js │ │ ├── index.js │ │ ├── metro.config.js │ │ ├── package.json │ │ └── src/ │ │ ├── HmsNaturalLanguageProcessingServices/ │ │ │ └── TextEmbedding.js │ │ ├── HmsOtherServices/ │ │ │ └── Helper.js │ │ ├── HmsTextRelatedServices/ │ │ │ ├── BankCardRecognition.js │ │ │ ├── DocumentRecognition.js │ │ │ ├── FormRecognition.js │ │ │ ├── GeneralCardRecognition.js │ │ │ ├── IDCardRecognition.js │ │ │ ├── TextRecognition.js │ │ │ ├── TextRecognitionLive.js │ │ │ └── VietnamIDCardRecognition.js │ │ ├── StartPage.js │ │ └── Styles.js │ ├── package.json │ └── src/ │ ├── BankCardRecognitionCustomizedView.js │ ├── index.d.ts │ ├── index.js │ └── utils.js ├── react-native-hms-nearby/ │ ├── LICENSE │ ├── OpenSourceSoftwareNotice.html │ ├── README.md │ ├── android/ │ │ ├── build.gradle │ │ ├── gradle/ │ │ │ └── wrapper/ │ │ │ └── gradle-wrapper.properties │ │ ├── gradle.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── src/ │ │ └── main/ │ │ ├── AndroidManifest.xml │ │ └── java/ │ │ └── com/ │ │ └── huawei/ │ │ └── hms/ │ │ └── rn/ │ │ └── nearby/ │ │ ├── HMSNearby.java │ │ ├── constants/ │ │ │ └── HMSConstants.java │ │ ├── modules/ │ │ │ ├── HMSBase.java │ │ │ ├── HMSBeacon.java │ │ │ ├── HMSDiscovery.java │ │ │ ├── HMSMessage.java │ │ │ ├── HMSNearbyApplication.java │ │ │ └── HMSTransfer.java │ │ └── utils/ │ │ ├── HMSLogger.java │ │ ├── HMSResult.java │ │ └── HMSUtils.java │ ├── example/ │ │ ├── .gitignore │ │ ├── App.js │ │ ├── README.md │ │ ├── android/ │ │ │ ├── app/ │ │ │ │ ├── build.gradle │ │ │ │ ├── proguard-rules.pro │ │ │ │ └── src/ │ │ │ │ ├── debug/ │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ └── main/ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── java/ │ │ │ │ │ └── com/ │ │ │ │ │ └── huawei/ │ │ │ │ │ └── hms/ │ │ │ │ │ └── rn/ │ │ │ │ │ └── nearby/ │ │ │ │ │ └── demo/ │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MainApplication.java │ │ │ │ └── res/ │ │ │ │ └── values/ │ │ │ │ └── styles.xml │ │ │ ├── build.gradle │ │ │ ├── gradle/ │ │ │ │ └── wrapper/ │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── gradle.properties │ │ │ ├── gradlew │ │ │ ├── gradlew.bat │ │ │ └── settings.gradle │ │ ├── app.json │ │ ├── babel.config.js │ │ ├── index.js │ │ ├── metro.config.js │ │ ├── package.json │ │ └── src/ │ │ ├── Beacon.js │ │ ├── Connection.js │ │ ├── Converter.js │ │ ├── Message.js │ │ ├── StartPage.js │ │ └── Styles.js │ ├── package.json │ └── src/ │ ├── index.d.ts │ └── index.js ├── react-native-hms-push/ │ ├── LICENSE │ ├── README.md │ ├── android/ │ │ ├── build.gradle │ │ ├── gradle/ │ │ │ └── wrapper/ │ │ │ └── gradle-wrapper.properties │ │ ├── gradle.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── src/ │ │ └── main/ │ │ ├── AndroidManifest.xml │ │ └── java/ │ │ └── com/ │ │ └── huawei/ │ │ └── hms/ │ │ └── rn/ │ │ └── push/ │ │ ├── HmsPushPackage.java │ │ ├── config/ │ │ │ └── NotificationAttributes.java │ │ ├── constants/ │ │ │ ├── Core.java │ │ │ ├── LocalNotification.java │ │ │ ├── NotificationConstants.java │ │ │ ├── RemoteMessageAttributes.java │ │ │ └── ResultCode.java │ │ ├── local/ │ │ │ ├── BitmapDataSubscriber.java │ │ │ ├── HmsLocalNotification.java │ │ │ ├── HmsLocalNotificationActionPublisher.java │ │ │ ├── HmsLocalNotificationController.java │ │ │ └── HmsLocalNotificationPicturesLoader.java │ │ ├── logger/ │ │ │ └── HMSLogger.java │ │ ├── opendevice/ │ │ │ └── HmsPushOpenDevice.java │ │ ├── receiver/ │ │ │ ├── HmsLocalNotificationActionsReceiver.java │ │ │ ├── HmsLocalNotificationBootEventReceiver.java │ │ │ ├── HmsLocalNotificationScheduledPublisher.java │ │ │ └── NotificationActionHandler.java │ │ ├── remote/ │ │ │ ├── HmsMessagePublisher.java │ │ │ ├── HmsPushInstanceId.java │ │ │ ├── HmsPushMessageService.java │ │ │ ├── HmsPushMessaging.java │ │ │ └── HmsPushProfile.java │ │ ├── services/ │ │ │ └── MessagingHeadlessService.java │ │ └── utils/ │ │ ├── ActivityUtils.java │ │ ├── ApplicationUtils.java │ │ ├── ArrayUtils.java │ │ ├── BundleUtils.java │ │ ├── MapUtils.java │ │ ├── NotificationConfigUtils.java │ │ ├── RemoteMessageUtils.java │ │ └── ResultUtils.java │ ├── example/ │ │ ├── .gitignore │ │ ├── App.js │ │ ├── LICENCE │ │ ├── README.md │ │ ├── android/ │ │ │ ├── app/ │ │ │ │ ├── build.gradle │ │ │ │ ├── proguard-rules.pro │ │ │ │ └── src/ │ │ │ │ ├── debug/ │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ └── main/ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── java/ │ │ │ │ │ └── com/ │ │ │ │ │ └── huawei/ │ │ │ │ │ └── hms/ │ │ │ │ │ └── rn/ │ │ │ │ │ └── push/ │ │ │ │ │ └── demo/ │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MainApplication.java │ │ │ │ └── res/ │ │ │ │ └── values/ │ │ │ │ └── styles.xml │ │ │ ├── build.gradle │ │ │ ├── gradle/ │ │ │ │ └── wrapper/ │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── gradle.properties │ │ │ ├── gradlew │ │ │ ├── gradlew.bat │ │ │ └── settings.gradle │ │ ├── app.json │ │ ├── babel.config.js │ │ ├── exampleCustomIntentLinks.html │ │ ├── index.js │ │ ├── metro.config.js │ │ ├── package.json │ │ └── src/ │ │ ├── LocalNotification.js │ │ ├── MainPage.js │ │ └── styles.js │ ├── package.json │ └── src/ │ ├── HmsPushEvent.js │ ├── HmsPushProfileTypes.js │ ├── HmsPushResultCode.js │ ├── LocalNotification/ │ │ ├── Importance.js │ │ ├── Priority.js │ │ ├── RepeatType.js │ │ ├── Visibility.js │ │ └── index.js │ ├── RNRemoteMessage.js │ ├── RemoteMessageBuilder.js │ ├── index.d.ts │ └── index.js ├── react-native-hms-push-fcm/ │ ├── LICENCE │ ├── README.md │ ├── android/ │ │ ├── .gradle/ │ │ │ ├── 6.3/ │ │ │ │ └── gc.properties │ │ │ ├── buildOutputCleanup/ │ │ │ │ └── cache.properties │ │ │ └── vcs-1/ │ │ │ └── gc.properties │ │ ├── build.gradle │ │ ├── gradle/ │ │ │ └── wrapper/ │ │ │ └── gradle-wrapper.properties │ │ ├── gradle.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ ├── local.properties │ │ └── src/ │ │ └── main/ │ │ ├── AndroidManifest.xml │ │ └── java/ │ │ └── com/ │ │ └── huawei/ │ │ └── hms/ │ │ └── rn/ │ │ └── push/ │ │ └── fcm/ │ │ ├── HMSLogger.java │ │ ├── HMSPushFCM.java │ │ └── HmsPushFCMPackage.java │ ├── example/ │ │ ├── .gitignore │ │ ├── App.js │ │ ├── LICENCE │ │ ├── README.md │ │ ├── android/ │ │ │ ├── app/ │ │ │ │ ├── build.gradle │ │ │ │ ├── proguard-rules.pro │ │ │ │ └── src/ │ │ │ │ ├── debug/ │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ └── main/ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── java/ │ │ │ │ │ └── com/ │ │ │ │ │ └── huawei/ │ │ │ │ │ └── hms/ │ │ │ │ │ └── rn/ │ │ │ │ │ └── push/ │ │ │ │ │ └── fcm/ │ │ │ │ │ └── demo/ │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MainApplication.java │ │ │ │ └── res/ │ │ │ │ └── values/ │ │ │ │ └── styles.xml │ │ │ ├── build.gradle │ │ │ ├── gradle/ │ │ │ │ └── wrapper/ │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── gradle.properties │ │ │ ├── gradlew │ │ │ ├── gradlew.bat │ │ │ └── settings.gradle │ │ ├── app.json │ │ ├── babel.config.js │ │ ├── index.js │ │ ├── metro.config.js │ │ ├── package.json │ │ └── src/ │ │ ├── MainPage.js │ │ └── styles.js │ ├── index.js │ └── package.json ├── react-native-hms-safetydetect/ │ ├── LICENSE │ ├── README.md │ ├── android/ │ │ ├── build.gradle │ │ ├── gradle/ │ │ │ └── wrapper/ │ │ │ └── gradle-wrapper.properties │ │ ├── gradle.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── src/ │ │ └── main/ │ │ ├── AndroidManifest.xml │ │ └── java/ │ │ └── com/ │ │ └── huawei/ │ │ └── hms/ │ │ └── rn/ │ │ └── safetydetect/ │ │ ├── HMSSafetyDetectPackage.java │ │ ├── appcheck/ │ │ │ ├── AppCheckModule.java │ │ │ ├── AppCheckService.java │ │ │ └── AppCheckUtils.java │ │ ├── huaweiapi/ │ │ │ ├── HuaweiApiModule.java │ │ │ └── HuaweiApiService.java │ │ ├── logger/ │ │ │ └── HMSLogger.java │ │ ├── sysintegrity/ │ │ │ ├── SysIntegrityModule.java │ │ │ └── SysIntegrityService.java │ │ ├── urlcheck/ │ │ │ ├── UrlCheckModule.java │ │ │ ├── UrlCheckService.java │ │ │ └── UrlCheckUtils.java │ │ ├── userdetect/ │ │ │ ├── UserDetectModule.java │ │ │ └── UserDetectService.java │ │ ├── utils/ │ │ │ └── HMSSafetyDetectUtils.java │ │ └── wifidetect/ │ │ ├── WifiDetectModule.java │ │ └── WifiDetectService.java │ ├── example/ │ │ ├── .gitignore │ │ ├── App.js │ │ ├── LICENSE │ │ ├── README.md │ │ ├── android/ │ │ │ ├── app/ │ │ │ │ ├── build.gradle │ │ │ │ ├── proguard-rules.pro │ │ │ │ └── src/ │ │ │ │ ├── debug/ │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ └── main/ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── java/ │ │ │ │ │ └── com/ │ │ │ │ │ └── huawei/ │ │ │ │ │ └── hms/ │ │ │ │ │ └── rn/ │ │ │ │ │ └── safetydetect/ │ │ │ │ │ └── demo/ │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MainApplication.java │ │ │ │ └── res/ │ │ │ │ └── values/ │ │ │ │ └── styles.xml │ │ │ ├── build.gradle │ │ │ ├── gradle/ │ │ │ │ └── wrapper/ │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── gradle.properties │ │ │ ├── gradlew │ │ │ ├── gradlew.bat │ │ │ └── settings.gradle │ │ ├── app.json │ │ ├── babel.config.js │ │ ├── index.js │ │ ├── metro.config.js │ │ └── package.json │ ├── package.json │ └── src/ │ ├── index.d.ts │ └── index.js ├── react-native-hms-scan/ │ ├── LICENSE │ ├── OpenSourceSoftwareNotice.html │ ├── README.md │ ├── android/ │ │ ├── build.gradle │ │ ├── gradle/ │ │ │ └── wrapper/ │ │ │ └── gradle-wrapper.properties │ │ ├── gradle.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── src/ │ │ └── main/ │ │ ├── AndroidManifest.xml │ │ ├── java/ │ │ │ └── com/ │ │ │ └── huawei/ │ │ │ └── hms/ │ │ │ └── rn/ │ │ │ └── scan/ │ │ │ ├── RNHMSScanPackage.java │ │ │ ├── customized/ │ │ │ │ ├── CustomizedViewActivity.java │ │ │ │ └── RNHMSScanCustomizedViewModule.java │ │ │ ├── logger/ │ │ │ │ └── HMSLogger.java │ │ │ ├── multi/ │ │ │ │ ├── CommonActivity.java │ │ │ │ ├── CommonCamera.java │ │ │ │ ├── CommonHandler.java │ │ │ │ ├── RNHMSScanMultiProcessorModule.java │ │ │ │ ├── ScanResultView.java │ │ │ │ └── ScanTextOptions.java │ │ │ ├── scanutils/ │ │ │ │ └── RNHMSScanUtilsModule.java │ │ │ └── utils/ │ │ │ ├── Errors.java │ │ │ └── ReactUtils.java │ │ └── res/ │ │ ├── drawable/ │ │ │ ├── colors.xml │ │ │ └── scanningframe.xml │ │ └── layout/ │ │ ├── activity_defined.xml │ │ └── activity_multiprocessor.xml │ ├── example/ │ │ ├── App.js │ │ ├── LICENSE │ │ ├── README.md │ │ ├── android/ │ │ │ ├── app/ │ │ │ │ ├── BUCK │ │ │ │ ├── build.gradle │ │ │ │ ├── proguard-rules.pro │ │ │ │ └── src/ │ │ │ │ ├── debug/ │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ └── main/ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── java/ │ │ │ │ │ └── com/ │ │ │ │ │ └── huawei/ │ │ │ │ │ └── rnhmsscandemo/ │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MainApplication.java │ │ │ │ └── res/ │ │ │ │ └── values/ │ │ │ │ └── styles.xml │ │ │ ├── build.gradle │ │ │ ├── gradle/ │ │ │ │ └── wrapper/ │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── gradle.properties │ │ │ ├── gradlew │ │ │ ├── gradlew.bat │ │ │ └── settings.gradle │ │ ├── app.json │ │ ├── babel.config.js │ │ ├── images/ │ │ │ └── images.json │ │ ├── index.js │ │ ├── metro.config.js │ │ └── package.json │ ├── package.json │ └── src/ │ ├── ScanCustomizedView.js │ ├── ScanMultiProcessor.js │ ├── ScanUtils.js │ ├── index.d.ts │ ├── index.js │ └── utils.js └── react-native-hms-site/ ├── LICENCE ├── README.md ├── android/ │ ├── build.gradle │ ├── gradle/ │ │ └── wrapper/ │ │ └── gradle-wrapper.properties │ ├── gradle.properties │ ├── gradlew │ ├── gradlew.bat │ └── src/ │ └── main/ │ ├── AndroidManifest.xml │ └── java/ │ └── com/ │ └── huawei/ │ └── hms/ │ └── rn/ │ └── site/ │ ├── HMSLogger.java │ ├── RNHMSSiteModule.java │ ├── RNHMSSitePackage.java │ ├── RNHMSSiteUtils.java │ ├── RNHMSSiteWrapper.java │ └── RNHMSWidgetWrapper.java ├── example/ │ ├── App.js │ ├── LICENCE │ ├── README.md │ ├── android/ │ │ ├── app/ │ │ │ ├── build.gradle │ │ │ ├── proguard-rules.pro │ │ │ └── src/ │ │ │ ├── debug/ │ │ │ │ └── AndroidManifest.xml │ │ │ └── main/ │ │ │ ├── AndroidManifest.xml │ │ │ ├── java/ │ │ │ │ └── com/ │ │ │ │ └── huawei/ │ │ │ │ └── hms/ │ │ │ │ └── rn/ │ │ │ │ └── site/ │ │ │ │ └── demo/ │ │ │ │ ├── MainActivity.java │ │ │ │ └── MainApplication.java │ │ │ └── res/ │ │ │ └── values/ │ │ │ └── styles.xml │ │ ├── build.gradle │ │ ├── gradle/ │ │ │ └── wrapper/ │ │ │ └── gradle-wrapper.properties │ │ ├── gradle.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── settings.gradle │ ├── app.json │ ├── babel.config.js │ ├── index.js │ ├── metro.config.js │ ├── package.json │ └── src/ │ └── styles.js ├── package.json └── src/ ├── constants/ │ ├── HwLocationType.js │ └── LocationType.js ├── index.d.ts └── index.js ================================================ FILE CONTENTS ================================================ ================================================ FILE: .github/ISSUE_TEMPLATE/issue-with-the-sample-code.md ================================================ --- name: Issue with the sample code about: Are you having issues when running the code in this repo? title: '' labels: '' assignees: '' --- **Description** Description of what the issue is about **Expected behavior** What you expected to happen? **Current behavior** What actually happened? **Screenshots** If applicable, add screenshots to help explain your issue **Logs** Post logs here or paste them to [Ghostbin](https://ghostbin.co) and insert the link here. **Environment** - Platform: [e.g. React-Native/Cordova/Flutter/Xamarin] - Kit: [e.g. Push/Map/Ads/Account/IAP] - Kit Version [e.g. 5.0.3] - OS Version [e.g. Android 11] - Android Studio version (if applicable) [e.g. 4.1] - Platform version (if applicable) - Node Version (if applicable) - Your Location/Region (if applicable) **Other** Add any other context about the problem here ================================================ FILE: LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: You must give any other recipients of the Work or Derivative Works a copy of this License; and You must cause any modified files to carry prominent notices stating that You changed the files; and You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS ================================================ FILE: README.md ================================================ # HMS React-Native Plugins [![license](https://img.shields.io/badge/license-Apache--2.0-green)](./LICENSE) This repo contains the source code for HMS React-Native first-party plugins, which are developed by the HMS Core team. These plugins enable access to using kit-specific APIs. For more information about plugins, and how to use them, see [Official Documentations](https://developer.huawei.com/consumer/en/doc/overview/HMS-Core-Plugin?ha_source=hms1). ## Plugins These are the available plugins in this repository. | Plugin | Version | Downloads | Documentation | Demo Project | | --- | --- | --- | --- | --- | | [**Account**](./react-native-hms-account) | [![version](https://img.shields.io/npm/v/@hmscore/react-native-hms-account?color=%23ed2a1c&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-account) | [![download-npm](https://img.shields.io/npm/dm/@hmscore/react-native-hms-account?color=%23007EC6&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-account) | [Getting Started](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides/preparing-the-development-environment-0000001050766307?ha_source=hms1)
[API Reference](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-References/overview-0000001051087380?ha_source=hms1) | [example](./react-native-hms-account/example) | | [**Ads**](./react-native-hms-ads) | [![version](https://img.shields.io/npm/v/@hmscore/react-native-hms-ads?color=%23ed2a1c&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-ads) | [![download-npm](https://img.shields.io/npm/dm/@hmscore/react-native-hms-ads?color=%23007EC6&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-ads) | [Getting Started](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides/dev-env-0000001050442053?ha_source=hms1)
[API Reference](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-References/ads-0000001050311042?ha_source=hms1) | [example](./react-native-hms-ads/example) | | [**Ads-Prime**](./react-native-hms-adsprime) | [![version](https://img.shields.io/npm/v/@hmscore/react-native-hms-adsprime?color=%23ed2a1c&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-ads) | [![download-npm](https://img.shields.io/npm/dm/@hmscore/react-native-hms-adsprime?color=%23007EC6&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-adsprime) | [Getting Started](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides/dev-env-0000001050442053?ha_source=hms1)
[API Reference](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-References/ads-0000001050311042?ha_source=hms1) | [example](./react-native-hms-adsprime/example) | | [**Analytics**](./react-native-hms-analytics) | [![version](https://img.shields.io/npm/v/@hmscore/react-native-hms-analytics?color=%23ed2a1c&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-analytics) | [![download-npm](https://img.shields.io/npm/dm/@hmscore/react-native-hms-analytics?color=%23007EC6&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-analytics) | [Getting Started](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides/preparedevenv-0000001051387084?ha_source=hms1)
[API Reference](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-References/overview-0000001053026463?ha_source=hms1) | [example](./react-native-hms-analytics/example) | | [**AR**](./react-native-hms-ar) | [![version](https://img.shields.io/npm/v/@hmscore/react-native-hms-ar?color=%23ed2a1c&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-ar) | [![download-npm](https://img.shields.io/npm/dm/@hmscore/react-native-hms-ar?color=%23007EC6&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-ar) | [Getting Started](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides/preparedevenv-0000001058623563?ha_source=hms1)
[API Reference](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-References/overview-0000001058415717?ha_source=hms1) | [example](./react-native-hms-ar/example) | | [**Availability**](./react-native-hms-availability) | [![version](https://img.shields.io/npm/v/@hmscore/react-native-hms-availability?color=%23ed2a1c&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-availability) | [![download-npm](https://img.shields.io/npm/dm/@hmscore/react-native-hms-availability?color=%23007EC6&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-availability) | [Getting Started](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides/preparing-the-development-environment-0000001091092010?ha_source=hms1)
[API Reference](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-References/overview-0000001092614672?ha_source=hms1) | [example](./react-native-hms-availability/example) | | [**Awareness**](./react-native-hms-awareness) | [![version](https://img.shields.io/npm/v/@hmscore/react-native-hms-awareness?color=%23ed2a1c&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-awareness) | [![download-npm](https://img.shields.io/npm/dm/@hmscore/react-native-hms-awareness?color=%23007EC6&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-awareness) | [Getting Started](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides/preparing-the-development-environment-0000001073515903?ha_source=hms1)
[API Reference](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-References/overview-0000001074268798?ha_source=hms1) | [example](./react-native-hms-awareness/example) | | [**Contact Shield**](./react-native-hms-contactshield) | [![version](https://img.shields.io/npm/v/@hmscore/react-native-hms-contactshield?color=%23ed2a1c&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-contactshield) | [![download-npm](https://img.shields.io/npm/dm/@hmscore/react-native-hms-contactshield?color=%23007EC6&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-contactshield) | [Getting Started](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides/preparedevenv-0000001062519333?ha_source=hms1)
[API Reference](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-References/overview-0000001062825598?ha_source=hms1) | [example](./react-native-hms-contactshield/example) | | [**DTM**](./react-native-hms-dtm) | [![version](https://img.shields.io/npm/v/@hmscore/react-native-hms-dtm?color=%23ed2a1c&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-dtm) | [![download-npm](https://img.shields.io/npm/dm/@hmscore/react-native-hms-dtm?color=%23007EC6&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-dtm) | [Getting Started](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides/prepare-development-environment-0000001056858057?ha_source=hms1)
[API Reference](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-References/overview-0000001057153998?ha_source=hms1) | [example](./react-native-hms-health/example) | | [**Health**](./react-native-hms-health) | [![version](https://img.shields.io/npm/v/@hmscore/react-native-hms-health?color=%23ed2a1c&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-health) | [![download-npm](https://img.shields.io/npm/dm/@hmscore/react-native-hms-health?color=%23007EC6&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-health) | [Getting Started](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides/preparedevenv-0000001050157757?ha_source=hms1)
[API Reference](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-References/overview-0000001074141482?ha_source=hms1) | [example](./react-native-hms-dtm/example) | | [**IAP**](./react-native-hms-iap) | [![version](https://img.shields.io/npm/v/@hmscore/react-native-hms-iap?color=%23ed2a1c&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-iap) | [![download-npm](https://img.shields.io/npm/dm/@hmscore/react-native-hms-iap?color=%23007EC6&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-iap) | [Getting Started](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides/preparedevenv-0000001050766241?ha_source=hms1)
[API Reference](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-References/overview-0000001051087324?ha_source=hms1) | [example](./react-native-hms-iap/example) | | [**Location**](./react-native-hms-location) | [![version](https://img.shields.io/npm/v/@hmscore/react-native-hms-location?color=%23ed2a1c&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-location) | [![download-npm](https://img.shields.io/npm/dm/@hmscore/react-native-hms-location?color=%23007EC6&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-location) | [Getting Started](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides/preparedevenv-0000001050041326?ha_source=hms1)
[API Reference](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-References/overview-0000001050041352?ha_source=hms1) | [example](./react-native-hms-location/example) | | [**Map**](./react-native-hms-map) | [![version](https://img.shields.io/npm/v/@hmscore/react-native-hms-map?color=%23ed2a1c&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-map) | [![download-npm](https://img.shields.io/npm/dm/@hmscore/react-native-hms-map?color=%23007EC6&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-map) | [Getting Started](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides/preparedevenv-0000001050032222?ha_source=hms1)
[API Reference](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-References/mapview-0000001051150160?ha_source=hms1) | [example](./react-native-hms-map/example) | | [**ML**](./react-native-hms-ml) | [![version](https://img.shields.io/npm/v/@hmscore/react-native-hms-ml?color=%23ed2a1c&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-ml) | [![download-npm](https://img.shields.io/npm/dm/@hmscore/react-native-hms-ml?color=%23007EC6&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-ml) | [Getting Started](https://developer.huawei.com/consumer/en/doc/HMS-Plugin-Guides/preparedevenv-0000001051006241?ha_source=hms1)
[API Reference](https://developer.huawei.com/consumer/en/doc/HMS-Plugin-References/introduction-0000001665009017-V1?ha_source=hms1) | [example](./react-native-hms-ml/example) | | [**ML Body**](./react-native-hms-mlbody) | [![version](https://img.shields.io/npm/v/@hmscore/react-native-hms-mlbody?color=%23ed2a1c&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-mlbody) | [![download-npm](https://img.shields.io/npm/dm/@hmscore/react-native-hms-mlbody?color=%23007EC6&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-mlbody) | [Getting Started](https://developer.huawei.com/consumer/en/doc/HMS-Plugin-Guides/preparedevenv-0000001051006241?ha_source=hms1)
[API Reference](https://developer.huawei.com/consumer/en/doc/HMS-Plugin-References/modules-overview-0000001693740344-V1?ha_source=hms1) | [example](./react-native-hms-mlbody/example) | | [**ML Image**](./react-native-hms-mlimage) | [![version](https://img.shields.io/npm/v/@hmscore/react-native-hms-mlimage?color=%23ed2a1c&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-mlimage) | [![download-npm](https://img.shields.io/npm/dm/@hmscore/react-native-hms-mlimage?color=%23007EC6&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-mlimage) | [Getting Started](https://developer.huawei.com/consumer/en/doc/HMS-Plugin-Guides/preparedevenv-0000001051006241?ha_source=hms1)
[API Reference](https://developer.huawei.com/consumer/en/doc/HMS-Plugin-References/modules-overview-0000001668659234-V1?ha_source=hms1) | [example](./react-native-hms-mlimage/example) | | [**ML Language**](./react-native-hms-mllanguage) | [![version](https://img.shields.io/npm/v/@hmscore/react-native-hms-mllanguage?color=%23ed2a1c&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-mllanguage) | [![download-npm](https://img.shields.io/npm/dm/@hmscore/react-native-hms-mllanguage?color=%23007EC6&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-mllanguage) | [Getting Started](https://developer.huawei.com/consumer/en/doc/HMS-Plugin-Guides/preparedevenv-0000001051006241?ha_source=hms1)
[API Reference](https://developer.huawei.com/consumer/en/doc/HMS-Plugin-References/overview-0000001664689457-V1?ha_source=hms1) | [example](./react-native-hms-mllanguage/example) | | [**ML Text**](./react-native-hms-mltext) | [![version](https://img.shields.io/npm/v/@hmscore/react-native-hms-mltext?color=%23ed2a1c&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-mltext) | [![download-npm](https://img.shields.io/npm/dm/@hmscore/react-native-hms-mltext?color=%23007EC6&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-mltext) | [Getting Started](https://developer.huawei.com/consumer/en/doc/HMS-Plugin-Guides/preparedevenv-0000001051006241?ha_source=hms1)
[API Reference](https://developer.huawei.com/consumer/en/doc/HMS-Plugin-References/modules-overview-0000001713816349-V1?ha_source=hms1) | [example](./react-native-hms-mltext/example) | | [**Nearby**](./react-native-hms-nearby) | [![version](https://img.shields.io/npm/v/@hmscore/react-native-hms-nearby?color=%23ed2a1c&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-nearby) | [![download-npm](https://img.shields.io/npm/dm/@hmscore/react-native-hms-nearby?color=%23007EC6&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-nearby) | [Getting Started](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides/prepare-development-environment-0000001054260430?ha_source=hms1)
[API Reference](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-References/overview-0000001053958778?ha_source=hms1) | [example](./react-native-hms-nearby/example) | | [**Push**](./react-native-hms-push) | [![version](https://img.shields.io/npm/v/@hmscore/react-native-hms-push?color=%23ed2a1c&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-push) | [![download-npm](https://img.shields.io/npm/dm/@hmscore/react-native-hms-push?color=%23007EC6&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-push) | [Getting Started](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides/preparedevenv-0000001050155838?ha_source=hms1)
[API Reference](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-References/push-overview-0000001193655312?ha_source=hms1) | [example](./react-native-hms-push/example) | | [**Push-Fcm**](./react-native-hms-push-fcm) | [![version](https://img.shields.io/npm/v/@hmscore/react-native-hms-push-fcm?color=%23ed2a1c&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-push-fcm) | [![download-npm](https://img.shields.io/npm/dm/@hmscore/react-native-hms-push-fcm?color=%23007EC6&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-push-fcm) | [Getting Started](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides/preparedevenv-0000001050155838?ha_source=hms1)
[API Reference](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-References/push-fcm-overview-0000001238655297?ha_source=hms1) | [example](./react-native-hms-push-fcm/example) | | [**Safety Detect**](./react-native-hms-safetydetect) | [![version](https://img.shields.io/npm/v/@hmscore/react-native-hms-safetydetect?color=%23ed2a1c&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-safetydetect) | [![download-npm](https://img.shields.io/npm/dm/@hmscore/react-native-hms-safetydetect?color=%23007EC6&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-safetydetect) | [Getting Started](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides/prepare-dev-env-0000001052646231?ha_source=hms1)
[API Reference](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-References/overview-0000001052765437?ha_source=hms1) | [example](./react-native-hms-scan/example) | | [**Scan**](./react-native-hms-scan) | [![version](https://img.shields.io/npm/v/@hmscore/react-native-hms-scan?color=%23ed2a1c&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-scan) | [![download-npm](https://img.shields.io/npm/dm/@hmscore/react-native-hms-scan?color=%23007EC6&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-scan) | [Getting Started](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides/prepare-dev-env-0000001056166177?ha_source=hms1)
[API Reference](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-References/overview-0000001057541182?ha_source=hms1) | [example](./react-native-hms-scan/example) | | [**Site**](./react-native-hms-site) | [![version](https://img.shields.io/npm/v/@hmscore/react-native-hms-site?color=%23ed2a1c&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-site) | [![download-npm](https://img.shields.io/npm/dm/@hmscore/react-native-hms-site?color=%23007EC6&style=for-the-badge)](https://www.npmjs.com/package/@hmscore/react-native-hms-site) | [Getting Started](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides/dev-env-0000001050442053?ha_source=hms1)
[API Reference](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-References/overview-0000001051070802?ha_source=hms1) | [example](./react-native-hms-site/example) | ## Question or issues If you want to evaluate more about HMS Core, [r/HMSCore on Reddit](https://www.reddit.com/r/HuaweiDevelopers/) is for you to keep up with latest news about HMS Core, and to exchange insights with other developers. If you have questions about how to use HMS samples, try the following options: - [Stack Overflow](https://stackoverflow.com/questions/tagged/huawei-mobile-services) is the best place for any programming questions. Be sure to tag your question with `huawei-mobile-services`. - [Huawei Developer Forum](https://forums.developer.huawei.com/forumPortal/en/home?fid=0101187876626530001?ha_source=hms1) HMS Core Module is great for general questions, or seeking recommendations and opinions. If you run into a bug in our samples, please submit an [issue](https://github.com/HMS-Core/hms-react-native-plugin/issues) to the Repository. Even better you can submit a [Pull Request](https://github.com/HMS-Core/hms-react-native-plugin/pulls) with a fix. ================================================ FILE: react-native-hms-account/LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: You must give any other recipients of the Work or Derivative Works a copy of this License; and You must cause any modified files to carry prominent notices stating that You changed the files; and You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS ================================================ FILE: react-native-hms-account/README.md ================================================

React-Native HMS Account

downloads NPM version License

---- HUAWEI Account Kit enables communication between Huawei Account SDK and React Native platform. [> Learn More](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides/introduction-0000001051086206?ha_source=hms1) ## Installation ```bash $ npm i @hmscore/react-native-hms-account ``` ## Documentation - [Quick Start](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides/preparing-the-development-environment-0000001050766307?ha_source=hms1) - [Reference](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-References/overview-0000001051087380?ha_source=hms1) ### Additional Topics - [HMSAuthButton](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides/huawei-id-auth-button-0000001051087180?ha_source=hms1) ## Questions or Issues If you have questions about how to use HMS samples, try the following options: - [Stack Overflow](https://stackoverflow.com/questions/tagged/huawei-mobile-services) is the best place for any programming questions. Be sure to tag your question with **huawei-mobile-services**. - [Github](https://github.com/HMS-Core/hms-react-native-plugin) is the official repository for these plugins, You can open an issue or submit your ideas. - [Huawei Developer Forum](https://forums.developer.huawei.com/forumPortal/en/home?fid=0101187876626530001&ha_source=hms1) HMS Core Module is great for general questions, or seeking recommendations and opinions. - [Huawei Developer Docs](https://developer.huawei.com/consumer/en/doc/overview/HMS-Core-Plugin?ha_source=hms1) is place to official documentation for all HMS Core Kits, you can find detailed documentations in there. If you run into a bug in our samples, please submit an issue to the [GitHub repository](https://github.com/HMS-Core/hms-react-native-plugin). ## Licence Huawei React-Native Plugin is licenced under [Apache 2.0 licence](LICENSE) ================================================ FILE: react-native-hms-account/android/build.gradle ================================================ apply plugin: 'com.android.library' apply plugin: 'maven-publish' buildscript { repositories { mavenCentral() google() jcenter() maven { url 'https://developer.huawei.com/repo/' } } dependencies { classpath 'com.android.tools.build:gradle:3.6.0' } } android { compileSdkVersion 33 buildToolsVersion "31.0.0" defaultConfig { minSdkVersion 19 targetSdkVersion 33 versionCode 1 versionName "1.0" } lintOptions { abortOnError false } compileOptions { sourceCompatibility = 1.8 targetCompatibility = 1.8 } } repositories { mavenLocal() maven { url "$rootDir/../node_modules/react-native/android" } maven { url "$rootDir/../node_modules/jsc-android/dist" } maven { url 'https://developer.huawei.com/repo/' } jcenter() mavenCentral() google() } dependencies { implementation fileTree(dir: "libs", include: ["*.jar"]) implementation 'com.facebook.react:react-native:+' // From node_modules implementation 'com.huawei.hms:hwid:6.12.0.300' } ================================================ FILE: react-native-hms-account/android/gradle/wrapper/gradle-wrapper.properties ================================================ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists ================================================ FILE: react-native-hms-account/android/gradle.properties ================================================ android.useAndroidX=true android.enableJetifier=true org.gradle.jvmargs=-Xmx4608m ================================================ FILE: react-native-hms-account/android/gradlew ================================================ #!/usr/bin/env sh # # Copyright 2015 the original author or authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ############################################################################## ## ## Gradle start up script for UN*X ## ############################################################################## # Attempt to set APP_HOME # Resolve links: $0 may be a link PRG="$0" # Need this for relative symlinks. while [ -h "$PRG" ] ; do ls=`ls -ld "$PRG"` link=`expr "$ls" : '.*-> \(.*\)$'` if expr "$link" : '/.*' > /dev/null; then PRG="$link" else PRG=`dirname "$PRG"`"/$link" fi done SAVED="`pwd`" cd "`dirname \"$PRG\"`/" >/dev/null APP_HOME="`pwd -P`" cd "$SAVED" >/dev/null APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" warn () { echo "$*" } die () { echo echo "$*" echo exit 1 } # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false case "`uname`" in CYGWIN* ) cygwin=true ;; Darwin* ) darwin=true ;; MINGW* ) msys=true ;; NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables JAVACMD="$JAVA_HOME/jre/sh/java" else JAVACMD="$JAVA_HOME/bin/java" fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else JAVACMD="java" which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi # Increase the maximum file descriptors if we can. if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then MAX_FD_LIMIT=`ulimit -H -n` if [ $? -eq 0 ] ; then if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then MAX_FD="$MAX_FD_LIMIT" fi ulimit -n $MAX_FD if [ $? -ne 0 ] ; then warn "Could not set maximum file descriptor limit: $MAX_FD" fi else warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" fi fi # For Darwin, add options to specify how the application appears in the dock if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi # For Cygwin or MSYS, switch paths to Windows format before running java if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` SEP="" for dir in $ROOTDIRSRAW ; do ROOTDIRS="$ROOTDIRS$SEP$dir" SEP="|" done OURCYGPATTERN="(^($ROOTDIRS))" # Add a user-defined pattern to the cygpath arguments if [ "$GRADLE_CYGPATTERN" != "" ] ; then OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" fi # Now convert the arguments - kludge to limit ourselves to /bin/sh i=0 for arg in "$@" ; do CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` else eval `echo args$i`="\"$arg\"" fi i=`expr $i + 1` done case $i in 0) set -- ;; 1) set -- "$args0" ;; 2) set -- "$args0" "$args1" ;; 3) set -- "$args0" "$args1" "$args2" ;; 4) set -- "$args0" "$args1" "$args2" "$args3" ;; 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; esac fi # Escape application args save () { for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " " } APP_ARGS=`save "$@"` # Collect all arguments for the java command, following the shell quoting and substitution rules eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" exec "$JAVACMD" "$@" ================================================ FILE: react-native-hms-account/android/gradlew.bat ================================================ @rem @rem Copyright 2015 the original author or authors. @rem @rem Licensed under the Apache License, Version 2.0 (the "License"); @rem you may not use this file except in compliance with the License. @rem You may obtain a copy of the License at @rem @rem https://www.apache.org/licenses/LICENSE-2.0 @rem @rem Unless required by applicable law or agreed to in writing, software @rem distributed under the License is distributed on an "AS IS" BASIS, @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem @if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @rem @rem ########################################################################## @rem Set local scope for the variables with windows NT shell if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @rem Resolve any "." and ".." in APP_HOME to make it shorter. for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if "%ERRORLEVEL%" == "0" goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. echo. echo Please set the JAVA_HOME variable in your environment to match the echo location of your Java installation. goto fail :findJavaFromJavaHome set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% echo. echo Please set the JAVA_HOME variable in your environment to match the echo location of your Java installation. goto fail :execute @rem Setup the command line set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell if "%ERRORLEVEL%"=="0" goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 exit /b 1 :mainEnd if "%OS%"=="Windows_NT" endlocal :omega ================================================ FILE: react-native-hms-account/android/src/main/AndroidManifest.xml ================================================ ================================================ FILE: react-native-hms-account/android/src/main/java/com/huawei/hms/rn/account/HMSAccountPackage.java ================================================ /* Copyright 2020-2024. Huawei Technologies Co., Ltd. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License") you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package com.huawei.hms.rn.account; import androidx.annotation.NonNull; import com.huawei.hms.rn.account.modules.HMSAccount; import com.huawei.hms.rn.account.modules.HMSAccountAuthManager; import com.huawei.hms.rn.account.modules.HMSAccountAuthService; import com.huawei.hms.rn.account.modules.HMSHuaweiIdAuthManager; import com.huawei.hms.rn.account.modules.HMSHuaweiIdAuthTool; import com.huawei.hms.rn.account.modules.HMSNetworkTool; import com.huawei.hms.rn.account.modules.HMSReadSMSManager; import com.huawei.hms.rn.account.views.HMSHuaweiIdAuthButton; import com.facebook.react.ReactPackage; import com.facebook.react.bridge.NativeModule; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.uimanager.ViewManager; import java.util.Arrays; import java.util.Collections; import java.util.List; public class HMSAccountPackage implements ReactPackage { @NonNull @Override public List createNativeModules(@NonNull ReactApplicationContext reactContext) { return Arrays.asList(new HMSAccount(reactContext), new HMSAccountAuthService(reactContext), new HMSAccountAuthManager(reactContext), new HMSReadSMSManager(reactContext), new HMSHuaweiIdAuthManager(reactContext), new HMSHuaweiIdAuthTool(reactContext), new HMSNetworkTool(reactContext)); } @NonNull @Override public List createViewManagers(@NonNull ReactApplicationContext reactContext) { return Collections.singletonList(new HMSHuaweiIdAuthButton(reactContext)); } } ================================================ FILE: react-native-hms-account/android/src/main/java/com/huawei/hms/rn/account/constants/ClassConstants.java ================================================ /* Copyright 2020-2024. Huawei Technologies Co., Ltd. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License") you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package com.huawei.hms.rn.account.constants; import com.huawei.hms.support.hwid.ui.HuaweiIdAuthButton; import com.huawei.hms.support.sms.common.ReadSmsConstant; public enum ClassConstants { READ_SMS_CONSTANT_EXTRA_SMS_MESSAGE(ReadSmsConstant.EXTRA_SMS_MESSAGE), READ_SMS_CONSTANT_EXTRA_STATUS(ReadSmsConstant.EXTRA_STATUS), READ_SMS_BROADCAST_ACTION(ReadSmsConstant.READ_SMS_BROADCAST_ACTION), HUAWEI_ID_AUTH_BUTTON_COLOR_POLICY_RED(HuaweiIdAuthButton.COLOR_POLICY_RED), HUAWEI_ID_AUTH_BUTTON_COLOR_POLICY_WHITE(HuaweiIdAuthButton.COLOR_POLICY_WHITE), HUAWEI_ID_AUTH_BUTTON_COLOR_POLICY_WHITE_WITH_BORDER(HuaweiIdAuthButton.COLOR_POLICY_WHITE_WITH_BORDER), HUAWEI_ID_AUTH_BUTTON_COLOR_POLICY_BLACK(HuaweiIdAuthButton.COLOR_POLICY_BLACK), HUAWEI_ID_AUTH_BUTTON_COLOR_POLICY_GRAY(HuaweiIdAuthButton.COLOR_POLICY_GRAY), HUAWEI_ID_AUTH_BUTTON_THEME_FULL_TITLE(HuaweiIdAuthButton.THEME_FULL_TITLE), HUAWEI_ID_AUTH_BUTTON_THEME_NO_TITLE(HuaweiIdAuthButton.THEME_NO_TITLE), HUAWEI_ID_AUTH_BUTTON_CORNER_RADIUS_LARGE(HuaweiIdAuthButton.CORNER_RADIUS_LARGE), HUAWEI_ID_AUTH_BUTTON_CORNER_RADIUS_MEDIUM(HuaweiIdAuthButton.CORNER_RADIUS_MEDIUM), HUAWEI_ID_AUTH_BUTTON_CORNER_RADIUS_SMALL(HuaweiIdAuthButton.CORNER_RADIUS_SMALL); private String stringValue; private Integer intValue; ClassConstants(String stringValue) { this.stringValue = stringValue; } ClassConstants(Integer intValue) { this.intValue = intValue; } public Integer getIntValue() { return intValue; } public String getStringValue() { return stringValue; } } ================================================ FILE: react-native-hms-account/android/src/main/java/com/huawei/hms/rn/account/logger/HMSLogger.java ================================================ /* Copyright 2020-2024. Huawei Technologies Co., Ltd. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License") you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package com.huawei.hms.rn.account.logger; import static android.os.Build.DEVICE; import android.content.Context; import android.content.pm.PackageManager; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.util.Log; import com.huawei.agconnect.config.AGConnectServicesConfig; import com.huawei.hms.support.hianalytics.HiAnalyticsUtils; import com.huawei.hms.utils.HMSBIInitializer; import java.lang.ref.WeakReference; import java.util.Collections; import java.util.HashMap; import java.util.Map; public final class HMSLogger { private static final String TAG = "HMSLogger"; private static final String KIT = "Account"; private static final String PLATFORM = "ReactNative"; private static final String VERSION = "6.12.0.301"; private static final String SERVICE = "Cross-Platform"; private static final String SUCCESS = "0"; private static final String UNKNOWN = "UNKNOWN"; private static final String NOT_AVAILABLE = "NOT_AVAILABLE"; private static final String SINGLE_EVENT_ID = "60000"; private static final String PERIODIC_EVENT_ID = "60001"; private static final String NETWORK_TYPE_WIFI = "WIFI"; private static volatile HMSLogger instance; private final WeakReference weakContext; private final HiAnalyticsUtils hiAnalyticsUtils; private final ConnectivityManager connectivityManager; private final Map singleEventMap = new HashMap<>(); private final Map periodicEventMap = new HashMap<>(); private final Map allCountMap = new HashMap<>(); private final Map failCountMap = new HashMap<>(); private final Map startTimeMap = new HashMap<>(); private final Map firstReceiveTimeMap = new HashMap<>(); private final Map lastReceiveTimeMap = new HashMap<>(); private final Map> resultCodeCountMap = new HashMap<>(); private final Map networkTypeMap = createNetworkTypeMap(); private boolean isEnabled = false; /** * Private constructor of this class. * * @param context Application's context */ private HMSLogger(final Context context) { weakContext = new WeakReference<>(context); hiAnalyticsUtils = HiAnalyticsUtils.getInstance(); connectivityManager = objectCast(context.getSystemService(Context.CONNECTIVITY_SERVICE), ConnectivityManager.class); hiAnalyticsUtils.enableLog(); HMSBIInitializer.getInstance(context).initBI(); setupEventMap(singleEventMap); setupEventMap(periodicEventMap); enableLogger(); } /** * Returns the instance of this class. * * @param context Context object * @return HMSLogger instance */ public static synchronized HMSLogger getInstance(final Context context) { if (instance == null) { synchronized (HMSLogger.class) { if (instance == null) { instance = new HMSLogger(context.getApplicationContext()); } } } return instance; } /** * Returns actual context reference. * * @return Actual context reference */ private synchronized Context getContext() { return weakContext.get(); } /** * Enables HMSLogger. */ public synchronized void enableLogger() { isEnabled = true; Log.d(TAG, "HMS Plugin Dotting is Enabled!"); } /** * Disables HMSLogger. */ public synchronized void disableLogger() { isEnabled = false; Log.d(TAG, "HMS Plugin Dotting is Disabled!"); } /** * Sets method start time for given method name. * * @param methodName Name of the method that will be logged */ public synchronized void startMethodExecutionTimer(final String methodName) { startTimeMap.put(methodName, System.currentTimeMillis()); } /** * Sends successful single event. * * @param methodName The name of the method called */ public synchronized void sendSingleEvent(final String methodName) { sendEvent(SINGLE_EVENT_ID, methodName, SUCCESS); } /** * Sends unsuccessful single event * * @param methodName The name of the method called. * @param errorCode API error code */ public synchronized void sendSingleEvent(final String methodName, final String errorCode) { sendEvent(SINGLE_EVENT_ID, methodName, errorCode); } /** * Sends successful periodic event. * * @param methodName The name of the method called */ public synchronized void sendPeriodicEvent(final String methodName) { sendEvent(PERIODIC_EVENT_ID, methodName, SUCCESS); } /** * Sends unsuccessful periodic event. * * @param methodName The name of the method called * @param errorCode API error code */ public synchronized void sendPeriodicEvent(final String methodName, final String errorCode) { sendEvent(PERIODIC_EVENT_ID, methodName, errorCode); } /** * Sends the event based on eventId, methodName, and resultCode. * * @param eventId Constant id of the event * @param methodName The name of the method called * @param resultCode Code of the method's result. "0" for success, others for error */ private synchronized void sendEvent(final String eventId, final String methodName, final String resultCode) { if (isEnabled) { final long currentTime = System.currentTimeMillis(); if (eventId.equals(SINGLE_EVENT_ID)) { putToSingleEventMap(methodName, resultCode, currentTime); hiAnalyticsUtils.onNewEvent(getContext(), SINGLE_EVENT_ID, singleEventMap); Log.d(TAG, "singleEventMap -> " + singleEventMap); } else { putToPeriodicEventMap(methodName, resultCode, currentTime); hiAnalyticsUtils.onNewEvent(getContext(), PERIODIC_EVENT_ID, periodicEventMap); Log.d(TAG, "periodicEventMap -> " + periodicEventMap); } } } /** * Gets "client/app_id" value from agconnect-services.json file. * * @return app_id value or NOT_AVAILABLE if not found */ private synchronized String getAppId() { try { return AGConnectServicesConfig.fromContext(getContext()).getString("client/app_id"); } catch (final NullPointerException e) { Log.d(TAG, "AgConnect is not found. Setting appId value to " + NOT_AVAILABLE); } return NOT_AVAILABLE; } /** * Gets app version name. * * @param packageName Package name of the app * @return App version name in String type */ private synchronized String getAppVersionName(final String packageName) { try { return getContext().getPackageManager().getPackageInfo(packageName, 0).versionName; } catch (final PackageManager.NameNotFoundException e) { Log.e(TAG, "getAppVersionName -> Could not get appVersionName!"); return NOT_AVAILABLE; } } /** * Detects current network type. * * @return Human readable network type; such as WIFI, 4G */ private synchronized String getNetworkType() { if (connectivityManager != null) { final NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo(); if (networkInfo != null && networkInfo.isConnected()) { final int networkType = networkInfo.getType(); if (ConnectivityManager.TYPE_WIFI == networkType) { return NETWORK_TYPE_WIFI; } else if (ConnectivityManager.TYPE_MOBILE == networkType) { final int networkSubType = networkInfo.getSubtype(); return getOrDefault(networkTypeMap, networkSubType, UNKNOWN); } else { return UNKNOWN; } } else { return NOT_AVAILABLE; } } else { return NOT_AVAILABLE; } } /** * Sets default values to given map. * * @param map HashMap to put default values */ private synchronized void setupEventMap(final Map map) { map.put("kit", KIT); map.put("platform", PLATFORM); map.put("version", VERSION); map.put("service", SERVICE); map.put("appid", getAppId()); map.put("package", getContext().getPackageName()); map.put("cpAppVersion", getAppVersionName(getContext().getPackageName())); map.put("model", DEVICE); } /** * Prepares sing-event map according to input parameters. * * @param methodName The name of the method called * @param resultCode Code of the method's result. "0" for success, others for error * @param currentTime Current timestamp in millisecond */ private synchronized void putToSingleEventMap(final String methodName, final String resultCode, final long currentTime) { final long startTime = getOrDefault(startTimeMap, methodName, currentTime); final int costTime = (int) (currentTime - startTime); singleEventMap.put("apiName", methodName); singleEventMap.put("result", resultCode); singleEventMap.put("callTime", currentTime); singleEventMap.put("costTime", costTime); singleEventMap.put("networkType", getNetworkType()); } /** * Prepares periodic-event map according to input parameters. * * @param methodName The name of the method called * @param resultCode Code of the method's result. "0" for success, others for error * @param currentTime Current timestamp in millisecond */ private synchronized void putToPeriodicEventMap(final String methodName, final String resultCode, final long currentTime) { increaseResultCodeCount(methodName, resultCode); increaseMapValue(methodName, allCountMap); if (!resultCode.equals(SUCCESS)) { increaseMapValue(methodName, failCountMap); } final long firstReceiveTime = getOrDefault(firstReceiveTimeMap, methodName, currentTime); periodicEventMap.put("callTime", firstReceiveTime); final long lastReceiveTime = getOrDefault(lastReceiveTimeMap, methodName, currentTime); final int costTime = (int) (currentTime - lastReceiveTime); periodicEventMap.put("costTime", costTime); periodicEventMap.put("apiName", methodName); periodicEventMap.put("result", resultCodeCountMap.get(methodName)); final long allCount = getOrDefault(allCountMap, methodName, 0L); periodicEventMap.put("allCnt", allCount); final long failCount = getOrDefault(failCountMap, methodName, 0L); periodicEventMap.put("failCnt", failCount); periodicEventMap.put("lastCallTime", currentTime); periodicEventMap.put("networkType", getNetworkType()); putIfAbsent(firstReceiveTimeMap, methodName, currentTime); lastReceiveTimeMap.put(methodName, currentTime); } /** * Prepares HashMap of network type id and its human-readable string pairs. * * @return HashMap of human readable network type names */ private synchronized Map createNetworkTypeMap() { final Map map = new HashMap<>(); map.put(0, UNKNOWN); map.put(1, "2G"); map.put(2, "2G"); map.put(3, "3G"); map.put(4, "3G"); map.put(5, "3G"); map.put(6, "3G"); map.put(7, "2G"); map.put(8, "3G"); map.put(9, "3G"); map.put(10, "3G"); map.put(11, "2G"); map.put(12, "3G"); map.put(13, "4G"); map.put(14, "3G"); map.put(15, "3G"); map.put(16, "2G"); map.put(17, "3G"); map.put(18, "4G"); map.put(19, "4G"); map.put(20, "5G"); return Collections.unmodifiableMap(map); } /** * Increases count of the given result code. * * @param methodName Name of the calling method * @param resultCode Code of the method's result. "0" for success, others for error */ private synchronized void increaseResultCodeCount(final String methodName, final String resultCode) { final Map map = getOrDefault(resultCodeCountMap, methodName, new HashMap<>()); increaseMapValue(resultCode, map); resultCodeCountMap.put(methodName, map); } /** * Increases the value of the corresponding key which in the map. * * @param key Key for map lookup * @param map The Map that contains the key and its corresponding value */ private synchronized void increaseMapValue(final String key, final Map map) { map.put(key, getOrDefault(map, key, 0L) + 1); } /** * Get the corresponding value of the key. If the key does not exist in the map then the default value is returned. * * @param map The Map * @param key Lookup key * @param defaultValue The default value will be returned if the key is absent * @param Generic type of the key * @param Generic type of the value * @return Corresponding value or default value */ private synchronized V getOrDefault(final Map map, final K key, final V defaultValue) { return map.containsKey(key) ? map.get(key) : defaultValue; } /** * Put key-value pair to map if the key is absent. * * @param map The Map * @param key Lookup key * @param value The value will be put to the map if the key is absent * @param Generic type of the key * @param Generic type of the value */ private synchronized void putIfAbsent(final Map map, final K key, final V value) { if (!map.containsKey(key)) { map.put(key, value); } } /** * Utility method that castes given object to given class type. * * @param source Source object to be casted * @param clazz Class that object will be casted to its type * @param Source object's type * @param Destination type * @return Object that casted to D type */ private synchronized D objectCast(final S source, final Class clazz) { return clazz.cast(source); } } ================================================ FILE: react-native-hms-account/android/src/main/java/com/huawei/hms/rn/account/modules/HMSAccount.java ================================================ /* Copyright 2020-2024. Huawei Technologies Co., Ltd. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License") you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package com.huawei.hms.rn.account.modules; import android.app.Activity; import android.content.Intent; import android.view.View; import androidx.annotation.NonNull; import com.huawei.hmf.tasks.Task; import com.huawei.hms.rn.account.constants.ClassConstants; import com.huawei.hms.rn.account.logger.HMSLogger; import com.huawei.hms.rn.account.utils.Utils; import com.huawei.hms.support.hwid.HuaweiIdAuthManager; import com.huawei.hms.support.hwid.request.HuaweiIdAuthParams; import com.huawei.hms.support.hwid.request.HuaweiIdAuthParamsHelper; import com.huawei.hms.support.hwid.result.AuthHuaweiId; import com.huawei.hms.support.hwid.service.HuaweiIdAuthService; import com.huawei.hms.support.hwid.ui.HuaweiIdAuthButton; import com.facebook.react.bridge.ActivityEventListener; import com.facebook.react.bridge.Promise; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.bridge.ReactContextBaseJavaModule; import com.facebook.react.bridge.ReactMethod; import com.facebook.react.bridge.ReadableArray; import com.facebook.react.bridge.ReadableMap; import com.facebook.react.uimanager.UIManagerModule; import java.util.HashMap; import java.util.Map; import java.util.Objects; public class HMSAccount extends ReactContextBaseJavaModule implements ActivityEventListener { private static final int REQUEST_CODE_LOG_IN = 0; private static final String FIELD_HUAWEI_ID_AUTH_PARAMS = "huaweiIdAuthParams"; private static final String FIELD_REQUEST_OPTION = "authRequestOption"; private static final String FIELD_AUTH_SCOPES_LIST = "authScopeList"; private HuaweiIdAuthService huaweiIdService; private Promise mSignInPromise; private HMSLogger logger; public HMSAccount(ReactApplicationContext reactContext) { super(reactContext); logger = HMSLogger.getInstance(reactContext); reactContext.addActivityEventListener(this); } @Override public void onNewIntent(Intent intent) { } @NonNull @Override public String getName() { return "HMSAccount"; } @Override public Map getConstants() { final Map constantsToBeExposed = new HashMap<>(); for (ClassConstants constant : ClassConstants.values()) { constantsToBeExposed.put(constant.name(), constant.getIntValue() == null ? constant.getStringValue() : constant.getIntValue()); } return constantsToBeExposed; } @Override public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent intent) { if (requestCode == REQUEST_CODE_LOG_IN && mSignInPromise != null) { Task authHuaweiIdTask = HuaweiIdAuthManager.parseAuthResultFromIntent(intent); logger.sendSingleEvent("signIn"); authHuaweiIdTask.addOnSuccessListener(authHuaweiId -> mSignInPromise.resolve( Utils.parseAuthHuaweiId(authHuaweiId, getReactApplicationContext()))) .addOnFailureListener(e -> Utils.handleError(mSignInPromise, e)); } } @ReactMethod public void signIn(ReadableMap arguments, final Promise promise) { String fieldName = (String) Utils.argumentNullCheck(arguments, FIELD_HUAWEI_ID_AUTH_PARAMS); ReadableArray requestOption = (ReadableArray) Utils.argumentNullCheck(arguments, FIELD_REQUEST_OPTION); ReadableArray authScopeList = (ReadableArray) Utils.argumentNullCheck(arguments, FIELD_AUTH_SCOPES_LIST); if (fieldName == null) { promise.reject("3000", "Null huaweiIdAuthParams Parameter"); } else { logger.startMethodExecutionTimer("signIn"); huaweiIdService = HuaweiIdAuthManager.getService(Objects.requireNonNull(getCurrentActivity()), Utils.toHuaweiIdAuthParams(requestOption, fieldName, authScopeList, promise)); getCurrentActivity().startActivityForResult(huaweiIdService.getSignInIntent(), REQUEST_CODE_LOG_IN); this.mSignInPromise = promise; } } @ReactMethod public void signOut(final Promise promise) { if (huaweiIdService != null) { logger.startMethodExecutionTimer("signOut"); Task signOutTask = huaweiIdService.signOut(); logger.sendSingleEvent("signOut"); signOutTask.addOnSuccessListener(task -> promise.resolve(true)) .addOnFailureListener(e -> Utils.handleError(promise, e)); } else { promise.reject("3001", "Null service"); } } @ReactMethod public void silentSignIn(ReadableMap arguments, final Promise promise) { String fieldName = (String) Utils.argumentNullCheck(arguments, FIELD_HUAWEI_ID_AUTH_PARAMS); HuaweiIdAuthParams authParams = null; if (fieldName != null) { logger.startMethodExecutionTimer("silentSignIn"); if (fieldName.equals("DEFAULT_AUTH_REQUEST_PARAM")) { authParams = new HuaweiIdAuthParamsHelper(HuaweiIdAuthParams.DEFAULT_AUTH_REQUEST_PARAM).createParams(); } else if (fieldName.equals("DEFAULT_AUTH_REQUEST_PARAM_GAME")) { authParams = new HuaweiIdAuthParamsHelper( HuaweiIdAuthParams.DEFAULT_AUTH_REQUEST_PARAM_GAME).createParams(); } else { promise.reject("3003", "Invalid huaweiIdAuthParams Parameter"); } huaweiIdService = HuaweiIdAuthManager.getService(Objects.requireNonNull(getCurrentActivity()), authParams); Task silentSignInTask = huaweiIdService.silentSignIn(); logger.sendSingleEvent("silentSignIn"); silentSignInTask.addOnSuccessListener( authHuaweiId -> promise.resolve(Utils.parseAuthHuaweiId(authHuaweiId, getReactApplicationContext()))) .addOnFailureListener(e -> Utils.handleError(promise, e)); } else { promise.reject("3000", "Null huaweiIdAuthParams Parameter"); } } @ReactMethod public void cancelAuthorization(final Promise promise) { if (huaweiIdService != null) { logger.startMethodExecutionTimer("cancelAuthorization"); Task cancelAuthorizationTask = huaweiIdService.cancelAuthorization(); logger.sendSingleEvent("cancelAuthorization"); cancelAuthorizationTask.addOnSuccessListener(task -> promise.resolve(true)) .addOnFailureListener(e -> Utils.handleError(promise, e)); } else { promise.reject("3001", "Null service"); } } @ReactMethod public void getButtonInfo(final int viewId, final Promise promise) { UIManagerModule uiManager = getReactApplicationContext().getNativeModule(UIManagerModule.class); uiManager.addUIBlock(nativeViewHierarchyManager -> { View view = nativeViewHierarchyManager.resolveView(viewId); if (view instanceof HuaweiIdAuthButton) { HuaweiIdAuthButton button = (HuaweiIdAuthButton) view; promise.resolve(Utils.parseButton(button)); return; } promise.resolve(null); }); } @ReactMethod public void enableLogger() { logger.enableLogger(); } @ReactMethod public void disableLogger() { logger.disableLogger(); } } ================================================ FILE: react-native-hms-account/android/src/main/java/com/huawei/hms/rn/account/modules/HMSAccountAuthManager.java ================================================ /* Copyright 2020-2024. Huawei Technologies Co., Ltd. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License") you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package com.huawei.hms.rn.account.modules; import android.app.Activity; import android.content.Intent; import com.huawei.hms.rn.account.logger.HMSLogger; import com.huawei.hms.rn.account.utils.Utils; import com.huawei.hms.support.account.AccountAuthManager; import com.huawei.hms.support.account.common.AccountAuthException; import com.huawei.hms.support.account.result.AuthAccount; import com.huawei.hms.support.api.entity.auth.Scope; import com.facebook.react.bridge.ActivityEventListener; import com.facebook.react.bridge.Promise; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.bridge.ReactContextBaseJavaModule; import com.facebook.react.bridge.ReactMethod; import com.facebook.react.bridge.ReadableArray; import com.facebook.react.bridge.ReadableMap; import java.util.List; import java.util.Objects; import javax.annotation.Nonnull; public class HMSAccountAuthManager extends ReactContextBaseJavaModule implements ActivityEventListener { private static final String FIELD_AUTH_ACCOUNT = "authAccount"; private static final int REQUEST_ADD_AUTH_SCOPES = 999; private Promise mAddAuthScopesPromiseT; private HMSLogger logger; public HMSAccountAuthManager(ReactApplicationContext reactContext) { super(reactContext); logger = HMSLogger.getInstance(reactContext); reactContext.addActivityEventListener(this); } @Nonnull @Override public String getName() { return "HMSAccountAuthManager"; } @ReactMethod public void getAuthResult(Promise promise) { logger.startMethodExecutionTimer("getAuthResult"); ReadableMap parsedAuthAccount = Utils.parseAuthAccount(AccountAuthManager.getAuthResult(), getReactApplicationContext()); logger.sendSingleEvent("getAuthResult"); promise.resolve(parsedAuthAccount); } @ReactMethod public void getAuthResultWithScopes(ReadableMap arguments, Promise promise) { ReadableArray scope = Utils.getScopeArray(arguments); if (scope != null) { List scopeList = Utils.toScopeList(scope); try { logger.startMethodExecutionTimer("getAuthResultWithScopes"); ReadableMap parsedAuthAccount = Utils.parseAuthAccount( AccountAuthManager.getAuthResultWithScopes(scopeList), getReactApplicationContext()); logger.sendSingleEvent("getAuthResultWithScopes"); promise.resolve(parsedAuthAccount); } catch (AccountAuthException e) { Utils.handleError(promise, e); } } else { promise.reject("3004", "Null authScopeList"); } } @ReactMethod public void containScopes(ReadableMap readableMap, Promise promise) { ReadableMap fieldAuthAccount = (ReadableMap) Utils.argumentNullCheck(readableMap, FIELD_AUTH_ACCOUNT); ReadableArray array = Utils.getScopeArray(readableMap); if (fieldAuthAccount != null && array != null) { AuthAccount authAccount = Utils.toAuthResult(fieldAuthAccount, FIELD_AUTH_ACCOUNT); List scopeList = Utils.toScopeList(array); logger.startMethodExecutionTimer("containScopes"); boolean isContainScope = AccountAuthManager.containScopes(authAccount, scopeList); logger.sendSingleEvent("containScopes"); promise.resolve(isContainScope); } else { promise.reject("3016", "Null authAccount or authScopeList"); } } @ReactMethod public void addAuthScopes(ReadableMap readableMap, Promise promise) { logger.startMethodExecutionTimer("addAuthScopes"); mAddAuthScopesPromiseT = promise; AccountAuthManager.addAuthScopes(Objects.requireNonNull(getCurrentActivity()), REQUEST_ADD_AUTH_SCOPES, Utils.toScopeList(Utils.getScopeArray(readableMap))); } @Override public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent intent) { if (requestCode == REQUEST_ADD_AUTH_SCOPES && mAddAuthScopesPromiseT != null) { logger.sendSingleEvent("addAuthScopes"); mAddAuthScopesPromiseT.resolve(true); } } @Override public void onNewIntent(Intent intent) { } } ================================================ FILE: react-native-hms-account/android/src/main/java/com/huawei/hms/rn/account/modules/HMSAccountAuthService.java ================================================ /* Copyright 2020-2024. Huawei Technologies Co., Ltd. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License") you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package com.huawei.hms.rn.account.modules; import android.app.Activity; import android.content.Intent; import com.huawei.hmf.tasks.Task; import com.huawei.hms.rn.account.logger.HMSLogger; import com.huawei.hms.rn.account.utils.Utils; import com.huawei.hms.support.account.AccountAuthManager; import com.huawei.hms.support.account.request.AccountAuthParams; import com.huawei.hms.support.account.request.AccountAuthParamsHelper; import com.huawei.hms.support.account.result.AccountIcon; import com.huawei.hms.support.account.result.AuthAccount; import com.huawei.hms.support.account.service.AccountAuthService; import com.facebook.react.bridge.ActivityEventListener; import com.facebook.react.bridge.Promise; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.bridge.ReactContextBaseJavaModule; import com.facebook.react.bridge.ReactMethod; import com.facebook.react.bridge.ReadableArray; import com.facebook.react.bridge.ReadableMap; import java.util.Objects; import javax.annotation.Nonnull; public class HMSAccountAuthService extends ReactContextBaseJavaModule implements ActivityEventListener { private static final int REQUEST_CODE_LOG_IN = 0; private static final String FIELD_ACCOUNT_AUTH_PARAMS = "accountAuthParams"; private static final String FIELD_REQUEST_OPTION = "authRequestOption"; private static final String FIELD_AUTH_SCOPES_LIST = "authScopeList"; private AccountAuthService accountAuthService; private Promise mSignInAccountPromise; private HMSLogger logger; public HMSAccountAuthService(@Nonnull ReactApplicationContext reactContext) { super(reactContext); logger = HMSLogger.getInstance(reactContext); reactContext.addActivityEventListener(this); } @Nonnull @Override public String getName() { return "HMSAccountAuthService"; } @Override public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent intent) { if (requestCode == REQUEST_CODE_LOG_IN && mSignInAccountPromise != null) { Task accountAuthTask = AccountAuthManager.parseAuthResultFromIntent(intent); accountAuthTask.addOnSuccessListener(authAccount -> mSignInAccountPromise.resolve( Utils.parseAuthAccount(authAccount, getReactApplicationContext()))) .addOnFailureListener(e -> Utils.handleError(mSignInAccountPromise, e)); } } @ReactMethod public void signIn(ReadableMap arguments, final Promise promise) { String fieldName = (String) Utils.argumentNullCheck(arguments, FIELD_ACCOUNT_AUTH_PARAMS); ReadableArray requestOption = (ReadableArray) Utils.argumentNullCheck(arguments, FIELD_REQUEST_OPTION); ReadableArray authScopeList = (ReadableArray) Utils.argumentNullCheck(arguments, FIELD_AUTH_SCOPES_LIST); if (fieldName == null) { promise.reject("3014", "Null accountAuthParams Parameter"); } else { logger.startMethodExecutionTimer("signIn"); accountAuthService = AccountAuthManager.getService(Objects.requireNonNull(getCurrentActivity()), Utils.toAccountAuthParams(requestOption, fieldName, authScopeList, promise)); getCurrentActivity().startActivityForResult(accountAuthService.getSignInIntent(), REQUEST_CODE_LOG_IN); logger.sendSingleEvent("signIn"); this.mSignInAccountPromise = promise; } } @ReactMethod public void signOut(final Promise promise) { if (accountAuthService != null) { logger.startMethodExecutionTimer("signOut"); Task signOutTask = accountAuthService.signOut(); logger.sendSingleEvent("signOut"); signOutTask.addOnSuccessListener(task -> promise.resolve(true)) .addOnFailureListener(e -> Utils.handleError(promise, e)); } else { promise.reject("3001", "Null service"); } } @ReactMethod public void getChannel(final Promise promise) { if (accountAuthService != null) { logger.startMethodExecutionTimer("getChannel"); Task task = accountAuthService.getChannel(); logger.sendSingleEvent("getChannel"); task.addOnSuccessListener(accountIcon -> promise.resolve(Utils.parseAccountIcon(accountIcon))) .addOnFailureListener(e -> Utils.handleError(promise, e)); } else { promise.reject("3001", "Null service"); } } @ReactMethod public void silentSignIn(ReadableMap arguments, final Promise promise) { String fieldName = (String) Utils.argumentNullCheck(arguments, FIELD_ACCOUNT_AUTH_PARAMS); AccountAuthParams authParams = null; if (fieldName != null) { logger.startMethodExecutionTimer("silentSignIn"); if (fieldName.equals("DEFAULT_AUTH_REQUEST_PARAM")) { authParams = new AccountAuthParamsHelper(AccountAuthParams.DEFAULT_AUTH_REQUEST_PARAM).createParams(); } else if (fieldName.equals("DEFAULT_AUTH_REQUEST_PARAM_GAME")) { authParams = new AccountAuthParamsHelper( AccountAuthParams.DEFAULT_AUTH_REQUEST_PARAM_GAME).createParams(); } else { promise.reject("3015", "Invalid accountAuthParams Parameter"); } accountAuthService = AccountAuthManager.getService(Objects.requireNonNull(getCurrentActivity()), authParams); Task silentSignInTask = accountAuthService.silentSignIn(); logger.sendSingleEvent("silentSignIn"); silentSignInTask.addOnSuccessListener( authAccount -> promise.resolve(Utils.parseAuthAccount(authAccount, getReactApplicationContext()))) .addOnFailureListener(e -> Utils.handleError(promise, e)); } else { promise.reject("3014", "Null accountAuthParams Parameter"); } } @ReactMethod public void cancelAuthorization(final Promise promise) { if (accountAuthService != null) { logger.startMethodExecutionTimer("cancelAuthorization"); Task cancelAuthorizationTask = accountAuthService.cancelAuthorization(); logger.sendSingleEvent("cancelAuthorization"); cancelAuthorizationTask.addOnSuccessListener(task -> promise.resolve(true)) .addOnFailureListener(e -> Utils.handleError(promise, e)); } else { promise.reject("3001", "Null service"); } } @ReactMethod public void getIndependentSignInIntent(String accessToken, final Promise promise) { if (accessToken != null) { logger.startMethodExecutionTimer("getIndependentSignInIntent"); AccountAuthParams authParams = new AccountAuthParamsHelper().setProfile().createParams(); accountAuthService = AccountAuthManager.getService(Objects.requireNonNull(getCurrentActivity()), authParams); this.mSignInAccountPromise = promise; getCurrentActivity().startActivityForResult(accountAuthService.getIndependentSignInIntent(accessToken), REQUEST_CODE_LOG_IN); logger.sendSingleEvent("getIndependentSignInIntent"); } else { promise.reject("3017", "Null accessToken"); } } @Override public void onNewIntent(Intent intent) { } } ================================================ FILE: react-native-hms-account/android/src/main/java/com/huawei/hms/rn/account/modules/HMSHuaweiIdAuthManager.java ================================================ /* Copyright 2020-2024. Huawei Technologies Co., Ltd. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License") you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package com.huawei.hms.rn.account.modules; import android.app.Activity; import android.content.Intent; import androidx.annotation.NonNull; import com.huawei.hms.rn.account.logger.HMSLogger; import com.huawei.hms.rn.account.utils.Utils; import com.huawei.hms.support.api.entity.auth.Scope; import com.huawei.hms.support.hwid.HuaweiIdAuthManager; import com.huawei.hms.support.hwid.common.HuaweiIdAuthException; import com.huawei.hms.support.hwid.result.AuthHuaweiId; import com.facebook.react.bridge.ActivityEventListener; import com.facebook.react.bridge.Promise; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.bridge.ReactContextBaseJavaModule; import com.facebook.react.bridge.ReactMethod; import com.facebook.react.bridge.ReadableArray; import com.facebook.react.bridge.ReadableMap; import java.util.List; import java.util.Objects; public class HMSHuaweiIdAuthManager extends ReactContextBaseJavaModule implements ActivityEventListener { private static final String FIELD_AUTH_HUAWEI_ID = "authHuaweiId"; private static final int REQUEST_ADD_AUTH_SCOPES = 999; private Promise mAddAuthScopesPromise; private HMSLogger logger; public HMSHuaweiIdAuthManager(ReactApplicationContext reactContext) { super(reactContext); logger = HMSLogger.getInstance(reactContext); reactContext.addActivityEventListener(this); } @NonNull @Override public String getName() { return "HMSHuaweiIdAuthManager"; } @ReactMethod public void getAuthResult(Promise promise) { logger.startMethodExecutionTimer("getAuthResult"); ReadableMap parsedAuthHuaweiId = Utils.parseAuthHuaweiId(HuaweiIdAuthManager.getAuthResult(), getReactApplicationContext()); logger.sendSingleEvent("getAuthResult"); promise.resolve(parsedAuthHuaweiId); } @ReactMethod public void getAuthResultWithScopes(ReadableMap arguments, Promise promise) { ReadableArray scope = Utils.getScopeArray(arguments); if (scope != null) { List scopeList = Utils.toScopeList(scope); try { logger.startMethodExecutionTimer("getAuthResultWithScopes"); ReadableMap parsedAuthHuaweiId = Utils.parseAuthHuaweiId( HuaweiIdAuthManager.getAuthResultWithScopes(scopeList), getReactApplicationContext()); logger.sendSingleEvent("getAuthResultWithScopes"); promise.resolve(parsedAuthHuaweiId); } catch (HuaweiIdAuthException e) { Utils.handleError(promise, e); } } else { promise.reject("3004", "Null authScopeList"); } } @ReactMethod public void addAuthScopes(ReadableMap readableMap, Promise promise) { logger.startMethodExecutionTimer("addAuthScopes"); mAddAuthScopesPromise = promise; HuaweiIdAuthManager.addAuthScopes(Objects.requireNonNull(getCurrentActivity()), REQUEST_ADD_AUTH_SCOPES, Utils.toScopeList(Utils.getScopeArray(readableMap))); } @Override public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent intent) { if (requestCode == REQUEST_ADD_AUTH_SCOPES && mAddAuthScopesPromise != null) { logger.sendSingleEvent("addAuthScopes"); mAddAuthScopesPromise.resolve(true); } } @Override public void onNewIntent(Intent intent) { // ignored } @ReactMethod public void containScopes(ReadableMap readableMap, Promise promise) { ReadableMap fieldAuthHuaweiId = (ReadableMap) Utils.argumentNullCheck(readableMap, FIELD_AUTH_HUAWEI_ID); ReadableArray array = Utils.getScopeArray(readableMap); if (fieldAuthHuaweiId != null && array != null) { AuthHuaweiId authHuaweiId = Utils.toAuthResult(fieldAuthHuaweiId, FIELD_AUTH_HUAWEI_ID); List scopeList = Utils.toScopeList(array); logger.startMethodExecutionTimer("containScopes"); boolean isContainScope = HuaweiIdAuthManager.containScopes(authHuaweiId, scopeList); logger.sendSingleEvent("containScopes"); promise.resolve(isContainScope); } else { promise.reject("3005", "Null authHuaweiId or authScopeList"); } } } ================================================ FILE: react-native-hms-account/android/src/main/java/com/huawei/hms/rn/account/modules/HMSHuaweiIdAuthTool.java ================================================ /* Copyright 2020-2024. Huawei Technologies Co., Ltd. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License") you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package com.huawei.hms.rn.account.modules; import android.accounts.Account; import androidx.annotation.NonNull; import com.huawei.hms.rn.account.logger.HMSLogger; import com.huawei.hms.rn.account.utils.Utils; import com.huawei.hms.support.api.entity.auth.Scope; import com.huawei.hms.support.hwid.common.HuaweiIdAuthException; import com.huawei.hms.support.hwid.tools.HuaweiIdAuthTool; import com.facebook.react.bridge.Promise; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.bridge.ReactContextBaseJavaModule; import com.facebook.react.bridge.ReactMethod; import com.facebook.react.bridge.ReadableMap; import java.util.List; import java.util.Objects; public class HMSHuaweiIdAuthTool extends ReactContextBaseJavaModule { private static final String FIELD_ACCESS_TOKEN = "accessToken"; private static final String FIELD_HUAWEI_ACCOUNT_NAME = "huaweiAccountName"; private static final String FIELD_HUAWEI_ACCOUNT = "huaweiAccount"; private static final String FIELD_NAME = "name"; private static final String FIELD_TYPE = "type"; private HMSLogger logger; public HMSHuaweiIdAuthTool(ReactApplicationContext reactContext) { super(reactContext); logger = HMSLogger.getInstance(reactContext); } @NonNull @Override public String getName() { return "HMSHuaweiIdAuthTool"; } @ReactMethod public void deleteAuthInfo(ReadableMap arguments, Promise promise) { String fieldAccessToken = (String) Utils.argumentNullCheck(arguments, FIELD_ACCESS_TOKEN); if (fieldAccessToken != null) { logger.startMethodExecutionTimer("deleteAuthInfo"); try { HuaweiIdAuthTool.deleteAuthInfo(Objects.requireNonNull(getCurrentActivity()), fieldAccessToken); logger.sendSingleEvent("deleteAuthInfo"); promise.resolve(true); } catch (HuaweiIdAuthException e) { logger.sendSingleEvent("deleteAuthInfo", e.getLocalizedMessage()); Utils.handleError(promise, e); } } else { promise.reject("3006", "Null accessToken"); } } @ReactMethod public void requestUnionId(ReadableMap arguments, Promise promise) { String fieldAccountName = (String) Utils.argumentNullCheck(arguments, FIELD_HUAWEI_ACCOUNT_NAME); if (fieldAccountName != null) { logger.startMethodExecutionTimer("requestUnionId"); try { String requestedUnionId = HuaweiIdAuthTool.requestUnionId(Objects.requireNonNull(getCurrentActivity()), fieldAccountName); logger.sendSingleEvent("requestUnionId"); promise.resolve(requestedUnionId); } catch (HuaweiIdAuthException e) { logger.sendSingleEvent("requestUnionId", e.getLocalizedMessage()); Utils.handleError(promise, e); } } else { promise.reject("3007", "Null huaweiAccountName"); } } @ReactMethod public void requestAccessToken(ReadableMap arguments, Promise promise) { ReadableMap fieldAccount = (ReadableMap) Utils.argumentNullCheck(arguments, FIELD_HUAWEI_ACCOUNT); List scopeList = Utils.toScopeList(Utils.getScopeArray(arguments)); if (fieldAccount != null) { String fieldAccountName = (String) Utils.argumentNullCheck(fieldAccount, FIELD_NAME); String fieldAccountType = (String) Utils.argumentNullCheck(fieldAccount, FIELD_TYPE); if (fieldAccountName != null && fieldAccountType != null) { Account account = new Account(fieldAccountName, fieldAccountType); logger.startMethodExecutionTimer("requestAccessToken"); try { String requestedAccessToken = HuaweiIdAuthTool.requestAccessToken( Objects.requireNonNull(getCurrentActivity()), account, scopeList); logger.sendSingleEvent("requestAccessToken"); promise.resolve(requestedAccessToken); } catch (HuaweiIdAuthException e) { logger.sendSingleEvent("requestAccessToken", e.getLocalizedMessage()); Utils.handleError(promise, e); } } else { promise.reject("3009", "Null huaweiAccount name or type parameter"); } } else { promise.reject("3008", "Null huaweiAccount"); } } } ================================================ FILE: react-native-hms-account/android/src/main/java/com/huawei/hms/rn/account/modules/HMSNetworkTool.java ================================================ /* Copyright 2020-2024. Huawei Technologies Co., Ltd. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License") you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package com.huawei.hms.rn.account.modules; import androidx.annotation.NonNull; import com.huawei.hms.rn.account.logger.HMSLogger; import com.huawei.hms.rn.account.utils.Utils; import com.huawei.hms.support.hwid.tools.NetworkTool; import com.facebook.react.bridge.Promise; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.bridge.ReactContextBaseJavaModule; import com.facebook.react.bridge.ReactMethod; import com.facebook.react.bridge.ReadableMap; public class HMSNetworkTool extends ReactContextBaseJavaModule { private static final String FIELD_COOKIE_NAME = "cookieName"; private static final String FIELD_COOKIE_VALUE = "cookieValue"; private static final String FIELD_DOMAIN = "domain"; private static final String FIELD_PATH = "path"; private static final String FIELD_IS_HTTP_ONLY = "isHttpOnly"; private static final String FIELD_IS_SECURE = "isSecure"; private static final String FIELD_MAX_AGE = "maxAge"; private static final String FIELD_IS_USE_HTTPS = "isUseHttps"; private HMSLogger logger; public HMSNetworkTool(ReactApplicationContext reactContext) { super(reactContext); logger = HMSLogger.getInstance(reactContext); } @NonNull public String getName() { return "HMSNetworkTool"; } @ReactMethod public void buildNetworkCookie(ReadableMap arguments, Promise promise) { String fieldCookieName = (String) Utils.argumentNullCheck(arguments, FIELD_COOKIE_NAME); String fieldCookieValue = (String) Utils.argumentNullCheck(arguments, FIELD_COOKIE_VALUE); String fieldDomain = (String) Utils.argumentNullCheck(arguments, FIELD_DOMAIN); String fieldPath = (String) Utils.argumentNullCheck(arguments, FIELD_PATH); Boolean fieldIsHttpOnly = arguments.hasKey(FIELD_IS_HTTP_ONLY) && arguments.getBoolean(FIELD_IS_HTTP_ONLY); Boolean fieldIsSecure = arguments.hasKey(FIELD_IS_SECURE) && arguments.getBoolean(FIELD_IS_SECURE); Long fieldMaxAge = Utils.argumentNullCheckAndConvert(arguments, FIELD_MAX_AGE); if (fieldCookieName != null) { logger.startMethodExecutionTimer("buildNetworkCookie"); String networkCookieData = NetworkTool.buildNetworkCookie(fieldCookieName, fieldCookieValue, fieldDomain, fieldPath, fieldIsHttpOnly, fieldIsSecure, fieldMaxAge); logger.sendSingleEvent("buildNetworkCookie"); promise.resolve(networkCookieData); } else { promise.reject("3010", "Null cookieName"); } } @ReactMethod public void buildNetworkUrl(ReadableMap arguments, Promise promise) { String fieldDomain = (String) Utils.argumentNullCheck(arguments, FIELD_DOMAIN); Boolean fieldIsHttpOnly = arguments.hasKey(FIELD_IS_USE_HTTPS) && arguments.getBoolean(FIELD_IS_USE_HTTPS); if (fieldDomain != null) { logger.startMethodExecutionTimer("buildNetworkUrl"); String networkUrl = NetworkTool.buildNetworkUrl(fieldDomain, fieldIsHttpOnly); logger.sendSingleEvent("buildNetworkUrl"); promise.resolve(networkUrl); } else { promise.reject("3011", "Null domain"); } } } ================================================ FILE: react-native-hms-account/android/src/main/java/com/huawei/hms/rn/account/modules/HMSReadSMSManager.java ================================================ /* Copyright 2020-2024. Huawei Technologies Co., Ltd. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License") you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package com.huawei.hms.rn.account.modules; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.pm.PackageManager; import android.content.pm.Signature; import android.os.Build; import android.os.Bundle; import android.util.Base64; import android.util.Log; import androidx.annotation.NonNull; import com.huawei.hmf.tasks.Task; import com.huawei.hms.common.api.CommonStatusCodes; import com.huawei.hms.rn.account.logger.HMSLogger; import com.huawei.hms.rn.account.utils.Utils; import com.huawei.hms.support.api.client.Status; import com.huawei.hms.support.sms.ReadSmsManager; import com.huawei.hms.support.sms.common.ReadSmsConstant; import com.facebook.react.bridge.Arguments; import com.facebook.react.bridge.Promise; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.bridge.ReactContextBaseJavaModule; import com.facebook.react.bridge.ReactMethod; import com.facebook.react.bridge.WritableMap; import java.nio.charset.StandardCharsets; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.Arrays; import java.util.Objects; /** * @deprecated * It's not advised to use this module */ @Deprecated public class HMSReadSMSManager extends ReactContextBaseJavaModule { private static final String MODULE_NAME = "HMSReadSMSManager"; private static final String HASHING_ALGORITHM_SHA_256 = "SHA-256"; private static final String FIELD_BASE_64_HASH = "base64Hash"; private static final String FIELD_ERROR = "Error: "; private static final String FIELD_STATUS = "Status"; private static final String FIELD_MESSAGE = "Message"; private SMSBroadcastReceiver smsReceiver; private HMSLogger logger; public HMSReadSMSManager(ReactApplicationContext reactContext) { super(reactContext); logger = HMSLogger.getInstance(reactContext); } @NonNull public String getName() { return MODULE_NAME; } @ReactMethod @Deprecated public void smsVerificationCode(final Promise promise) { Task smsTask = ReadSmsManager.start(Objects.requireNonNull(getCurrentActivity())); startRegisterReceiver(smsTask, "smsVerificationCode", promise); } @ReactMethod @Deprecated public void startConsent(String phoneNumber, final Promise promise) { if (phoneNumber != null) { Task phoneNumberTask = ReadSmsManager.startConsent(Objects.requireNonNull(getCurrentActivity()), phoneNumber); startRegisterReceiver(phoneNumberTask, "startConsent", promise); } else { Task phoneNumberTask = ReadSmsManager.startConsent(Objects.requireNonNull(getCurrentActivity()), ""); startRegisterReceiver(phoneNumberTask, "startConsent", promise); } } private void startRegisterReceiver(Task taskRegisterReceiver, String methodName, final Promise promise) { taskRegisterReceiver.addOnCompleteListener(task -> { if (task.isSuccessful()) { if (smsReceiver != null) { Objects.requireNonNull(getCurrentActivity()).unregisterReceiver(smsReceiver); } IntentFilter intentPhoneFilter = new IntentFilter(ReadSmsConstant.READ_SMS_BROADCAST_ACTION); smsReceiver = new SMSBroadcastReceiver(promise, methodName); Objects.requireNonNull(getCurrentActivity()).registerReceiver(smsReceiver, intentPhoneFilter); } }).addOnFailureListener(e -> Utils.handleError(promise, e)); } @ReactMethod @Deprecated public void getHashCode(Promise promise) { logger.startMethodExecutionTimer("getHashCode"); MessageDigest messageDigest = getMessageDigest(); if (messageDigest == null) { logger.sendSingleEvent("getHashCode", "-1"); promise.reject("3012", "Null MessageDigest"); } else { String packageName = Objects.requireNonNull(getCurrentActivity()).getPackageName(); String signature = getSignature(getCurrentActivity(), packageName); String appInfo = packageName + " " + signature; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { messageDigest.update(appInfo.getBytes(StandardCharsets.UTF_8)); } byte[] hashSignature = messageDigest.digest(); hashSignature = Arrays.copyOfRange(hashSignature, 0, 9); String base64Hash = Base64.encodeToString(hashSignature, Base64.NO_PADDING | Base64.NO_WRAP); if (base64Hash.length() > 0) { base64Hash = base64Hash.substring(0, 11); WritableMap base64HashMap = Arguments.createMap(); base64HashMap.putString(FIELD_BASE_64_HASH, base64Hash); Log.i(MODULE_NAME, String.valueOf(base64HashMap)); logger.sendSingleEvent("getHashCode"); promise.resolve(base64HashMap); } else { logger.sendSingleEvent("getHashCode", "-1"); promise.reject("3013", "Invalid hashCode"); } } } private MessageDigest getMessageDigest() { MessageDigest messageDigest = null; try { messageDigest = MessageDigest.getInstance(HASHING_ALGORITHM_SHA_256); } catch (NoSuchAlgorithmException ex) { Log.e(MODULE_NAME, ex.getMessage()); } return messageDigest; } private String getSignature(Context context, String packageName) { PackageManager packageManager = context.getPackageManager(); Signature[] signatureArray; try { signatureArray = packageManager.getPackageInfo(packageName, PackageManager.GET_SIGNATURES).signatures; } catch (PackageManager.NameNotFoundException e) { return ""; } return Objects.requireNonNull(signatureArray)[0].toCharsString(); } private static class SMSBroadcastReceiver extends BroadcastReceiver { private final Promise promise; private final String methodName; public SMSBroadcastReceiver(Promise promise, String methodName) { this.promise = promise; this.methodName = methodName; } @Override public void onReceive(Context context, Intent intent) { Bundle bundle = intent.getExtras(); if (bundle != null) { Status status = bundle.getParcelable(ReadSmsConstant.EXTRA_STATUS); if (Objects.requireNonNull(status).getStatusCode() != CommonStatusCodes.SUCCESS) { HMSLogger.getInstance(context).sendPeriodicEvent(methodName, "-1"); promise.reject(FIELD_ERROR + Objects.requireNonNull(status).getStatusCode()); } else { WritableMap map = Arguments.createMap(); map.putMap(FIELD_STATUS, Utils.parseStatus(Objects.requireNonNull(status))); map.putString(FIELD_MESSAGE, bundle.getString(ReadSmsConstant.EXTRA_SMS_MESSAGE)); HMSLogger.getInstance(context).sendPeriodicEvent(methodName); promise.resolve(map); } } } } } ================================================ FILE: react-native-hms-account/android/src/main/java/com/huawei/hms/rn/account/utils/Utils.java ================================================ /* Copyright 2020-2024. Huawei Technologies Co., Ltd. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License") you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package com.huawei.hms.rn.account.utils; import android.accounts.Account; import android.content.Context; import android.graphics.Bitmap; import android.util.Base64; import com.huawei.hms.common.ApiException; import com.huawei.hms.support.account.request.AccountAuthParams; import com.huawei.hms.support.account.request.AccountAuthParamsHelper; import com.huawei.hms.support.account.result.AccountIcon; import com.huawei.hms.support.account.result.AuthAccount; import com.huawei.hms.support.api.client.Status; import com.huawei.hms.support.api.entity.auth.Scope; import com.huawei.hms.support.feature.result.AbstractAuthAccount; import com.huawei.hms.support.hwid.request.HuaweiIdAuthParams; import com.huawei.hms.support.hwid.request.HuaweiIdAuthParamsHelper; import com.huawei.hms.support.hwid.result.AuthHuaweiId; import com.huawei.hms.support.hwid.ui.HuaweiIdAuthButton; import com.facebook.react.bridge.Arguments; import com.facebook.react.bridge.Promise; import com.facebook.react.bridge.ReadableArray; import com.facebook.react.bridge.ReadableMap; import com.facebook.react.bridge.WritableArray; import com.facebook.react.bridge.WritableMap; import java.io.ByteArrayOutputStream; import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; public class Utils { private static final String FIELD_AUTH_HUAWEI_ID = "authHuaweiId"; private static final String FIELD_AUTH_ACCOUNT = "authAccount"; private static final String FIELD_ACCESS_TOKEN = "accessToken"; private static final String FIELD_DISPLAY_NAME = "displayName"; private static final String FIELD_EMAIL = "email"; private static final String FIELD_ID_TOKEN = "idToken"; private static final String FIELD_AUTHORIZATION_CODE = "authorizationCode"; private static final String FIELD_UNION_ID = "unionId"; private static final String FIELD_AGE_RANGE = "ageRange"; private static final String FIELD_COUNTRY_CODE = "countryCode"; private static final String FIELD_AVATAR_URI_STRING = "avatarUriString"; private static final String FIELD_EXPRESSION_TIME_SECS = "expressionTimeSecs"; private static final String FIELD_SERVICE_COUNTRY_CODE = "serviceCountryCode"; private static final String FIELD_UID = "uid"; private static final String FIELD_OPEN_ID = "openId"; private static final String FIELD_GENDER = "gender"; private static final String FIELD_DESCRIBE_CONTENTS = "describeContentsInAuthHuaweiId"; private static final String FIELD_NAME = "name"; private static final String FIELD_TYPE = "type"; private static final String FIELD_STATUS = "status"; private static final String FIELD_AUTHORIZED_SCOPES = "authorizedScopes"; private static final String FIELD_EXTENSION_SCOPE = "extensionScopes"; private static final String FIELD_SCOPE_ARRAY = "authScopeList"; private static final String FIELD_SERVER_AUTH_CODE = "serverAuthCode"; private static final String FIELD_ACCOUNT = "account"; private static final String FIELD_ERROR_STRING = "errorCode"; private static final String FIELD_STATUS_MESSAGE = "statusMessage"; private static final String FIELD_STATUS_CODE = "statusCode"; private static final String FIELD_COLOR_POLICY = "colorPolicy"; private static final String FIELD_CORNER_RADIUS = "cornerRadius"; private static final String FIELD_THEME = "theme"; private static final String FIELD_ACCOUNT_FLAG = "accountFlag"; private static final String FIELD_CARRIERID = "carrierId"; private static final String ICON = "icon"; private static final String ICON_DESCRIPTION = "description"; public static ReadableMap parseAuthHuaweiId(AuthHuaweiId authHuaweiId, Context context) { if (authHuaweiId == null) { return null; } WritableMap arguments = Arguments.createMap(); arguments.putString(FIELD_ACCESS_TOKEN, authHuaweiId.getAccessToken()); arguments.putString(FIELD_DISPLAY_NAME, authHuaweiId.getDisplayName()); arguments.putString(FIELD_EMAIL, authHuaweiId.getEmail()); arguments.putString(FIELD_ID_TOKEN, authHuaweiId.getIdToken()); arguments.putString(FIELD_AUTHORIZATION_CODE, authHuaweiId.getAuthorizationCode()); arguments.putString(FIELD_UNION_ID, authHuaweiId.getUnionId()); arguments.putString(FIELD_AGE_RANGE, authHuaweiId.getAgeRange()); arguments.putString(FIELD_COUNTRY_CODE, authHuaweiId.getCountryCode()); arguments.putString(FIELD_AVATAR_URI_STRING, authHuaweiId.getAvatarUriString()); arguments.putString(FIELD_SERVICE_COUNTRY_CODE, authHuaweiId.getServiceCountryCode()); arguments.putString(FIELD_UID, authHuaweiId.getUid()); arguments.putString(FIELD_OPEN_ID, authHuaweiId.getOpenId()); arguments.putInt(FIELD_GENDER, authHuaweiId.getGender()); arguments.putInt(FIELD_STATUS, authHuaweiId.getStatus()); arguments.putArray(FIELD_AUTHORIZED_SCOPES, parseScopeSet(authHuaweiId.getAuthorizedScopes())); arguments.putArray(FIELD_EXTENSION_SCOPE, parseScopeSet(authHuaweiId.getExtensionScopes())); arguments.putMap(FIELD_ACCOUNT, parseAccount(authHuaweiId.getHuaweiAccount(context))); return arguments; } public static ReadableMap parseAuthAccount(AuthAccount authAccount, Context context) { if (authAccount == null) { return null; } WritableMap arguments = Arguments.createMap(); arguments.putString(FIELD_ACCESS_TOKEN, authAccount.getAccessToken()); arguments.putString(FIELD_DISPLAY_NAME, authAccount.getDisplayName()); arguments.putString(FIELD_EMAIL, authAccount.getEmail()); arguments.putString(FIELD_ID_TOKEN, authAccount.getIdToken()); arguments.putString(FIELD_AUTHORIZATION_CODE, authAccount.getAuthorizationCode()); arguments.putString(FIELD_UNION_ID, authAccount.getUnionId()); arguments.putString(FIELD_AGE_RANGE, authAccount.getAgeRange()); arguments.putString(FIELD_COUNTRY_CODE, authAccount.getCountryCode()); arguments.putString(FIELD_AVATAR_URI_STRING, authAccount.getAvatarUriString()); arguments.putString(FIELD_SERVICE_COUNTRY_CODE, authAccount.getServiceCountryCode()); arguments.putString(FIELD_UID, authAccount.getUid()); arguments.putString(FIELD_OPEN_ID, authAccount.getOpenId()); arguments.putInt(FIELD_GENDER, authAccount.getGender()); arguments.putInt(FIELD_STATUS, authAccount.getStatus()); arguments.putArray(FIELD_AUTHORIZED_SCOPES, parseScopeSet(authAccount.getAuthorizedScopes())); arguments.putArray(FIELD_EXTENSION_SCOPE, parseScopeSet(authAccount.getExtensionScopes())); arguments.putMap(FIELD_ACCOUNT, parseAccount(authAccount.getAccount(context))); arguments.putInt(FIELD_ACCOUNT_FLAG, authAccount.getAccountFlag()); arguments.putInt(FIELD_CARRIERID, authAccount.getCarrierId()); return arguments; } public static WritableArray parseScopeSet(Set scopeSet) { WritableArray array = Arguments.createArray(); Iterator scopeIterator = scopeSet.iterator(); while (scopeIterator.hasNext()) { Scope scope = scopeIterator.next(); array.pushString(scope.getScopeUri()); } return array; } public static WritableMap parseButton(HuaweiIdAuthButton button) { if (button == null) { return null; } WritableMap arguments = Arguments.createMap(); arguments.putInt(FIELD_COLOR_POLICY, button.getColorPolicy()); arguments.putInt(FIELD_CORNER_RADIUS, button.getCornerRadius()); arguments.putInt(FIELD_THEME, button.getTheme()); return arguments; } private static WritableMap parseAccount(Account account) { if (account == null) { return null; } WritableMap arguments = Arguments.createMap(); arguments.putString(FIELD_NAME, account.name); arguments.putString(FIELD_TYPE, account.type); return arguments; } public static HuaweiIdAuthParams toHuaweiIdAuthParams(ReadableArray requestOption, String huaweiIdAuthParams, ReadableArray scopeList, Promise promise) { HuaweiIdAuthParamsHelper huaweiIdBuilder; if (huaweiIdAuthParams.equals("DEFAULT_AUTH_REQUEST_PARAM")) { huaweiIdBuilder = new HuaweiIdAuthParamsHelper(HuaweiIdAuthParams.DEFAULT_AUTH_REQUEST_PARAM); } else if (huaweiIdAuthParams.equals("DEFAULT_AUTH_REQUEST_PARAM_GAME")) { huaweiIdBuilder = new HuaweiIdAuthParamsHelper(HuaweiIdAuthParams.DEFAULT_AUTH_REQUEST_PARAM_GAME); } else { promise.reject("3003", "Invalid Parameter"); return null; } ArrayList huaweiIdListData = new ArrayList<>(); List scopeListData = toScopeList(scopeList); if (requestOption != null) { for (int i = 0; i < requestOption.size(); i++) { huaweiIdListData.add(requestOption.getString(i)); } } if (huaweiIdListData.contains("profile")) { huaweiIdBuilder.setProfile(); } if (huaweiIdListData.contains("idToken")) { huaweiIdBuilder.setIdToken(); } if (huaweiIdListData.contains("accessToken")) { huaweiIdBuilder.setAccessToken(); } if (huaweiIdListData.contains("mobileNumber")) { huaweiIdBuilder.setMobileNumber(); } if (huaweiIdListData.contains("email")) { huaweiIdBuilder.setEmail(); } if (huaweiIdListData.contains("shippingAddress")) { huaweiIdBuilder.setShippingAddress(); } if (huaweiIdListData.contains("uid")) { huaweiIdBuilder.setUid(); } if (huaweiIdListData.contains("id")) { huaweiIdBuilder.setId(); } if (huaweiIdListData.contains("authorizationCode")) { huaweiIdBuilder.setAuthorizationCode(); } if (scopeList != null) { huaweiIdBuilder.setScopeList(scopeListData); } return huaweiIdBuilder.createParams(); } public static AccountAuthParams toAccountAuthParams(ReadableArray requestOption, String accountdAuthParams, ReadableArray scopeList, Promise promise) { AccountAuthParamsHelper accountAuthBuilder; if (accountdAuthParams.equals("DEFAULT_AUTH_REQUEST_PARAM")) { accountAuthBuilder = new AccountAuthParamsHelper(AccountAuthParams.DEFAULT_AUTH_REQUEST_PARAM); } else if (accountdAuthParams.equals("DEFAULT_AUTH_REQUEST_PARAM_GAME")) { accountAuthBuilder = new AccountAuthParamsHelper(AccountAuthParams.DEFAULT_AUTH_REQUEST_PARAM_GAME); } else { promise.reject("3003", "Invalid AccountAuthParams Parameter"); return null; } ArrayList accountListData = new ArrayList<>(); List scopeListData = toScopeList(scopeList); if (requestOption != null) { for (int i = 0; i < requestOption.size(); i++) { if (requestOption.getType(i).name().equals("String")) { accountListData.add(requestOption.getString(i)); } else if (requestOption.getType(i).name().equals("Map")) { ReadableMap rm = requestOption.getMap(i); if (rm.hasKey("idTokenSignAlg")) { accountAuthBuilder.setIdTokenSignAlg(rm.getInt("idTokenSignAlg")); } } } } if (accountListData.contains("profile")) { accountAuthBuilder.setProfile(); } if (accountListData.contains("idToken")) { accountAuthBuilder.setIdToken(); } if (accountListData.contains("accessToken")) { accountAuthBuilder.setAccessToken(); } if (accountListData.contains("mobileNumber")) { accountAuthBuilder.setMobileNumber(); } if (accountListData.contains("email")) { accountAuthBuilder.setEmail(); } if (accountListData.contains("uid")) { accountAuthBuilder.setUid(); } if (accountListData.contains("id")) { accountAuthBuilder.setId(); } if (accountListData.contains("authorizationCode")) { accountAuthBuilder.setAuthorizationCode(); } if (accountListData.contains("carrierId")) { accountAuthBuilder.setCarrierId(); } if (scopeList != null) { accountAuthBuilder.setScopeList(scopeListData); } return accountAuthBuilder.createParams(); } public static T toAuthResult(ReadableMap readableMap, String authType) { T buildAuth = null; String openId = (String) Utils.argumentNullCheck(readableMap, FIELD_OPEN_ID); String unionId = (String) Utils.argumentNullCheck(readableMap, FIELD_UNION_ID); String uid = (String) Utils.argumentNullCheck(readableMap, FIELD_UID); Set scopeList = readableMap.hasKey(FIELD_SCOPE_ARRAY) ? (Set) (Object) toSet( readableMap.getArray(FIELD_SCOPE_ARRAY)) : new HashSet(); String displayName = (String) Utils.argumentNullCheck(readableMap, FIELD_DISPLAY_NAME); String photoUrl = (String) Utils.argumentNullCheck(readableMap, FIELD_AVATAR_URI_STRING); int gender = readableMap.hasKey(FIELD_GENDER) ? readableMap.getInt(FIELD_GENDER) : -1; String accessToken = (String) Utils.argumentNullCheck(readableMap, FIELD_ACCESS_TOKEN); String serviceCountryCode = (String) Utils.argumentNullCheck(readableMap, FIELD_SERVICE_COUNTRY_CODE); int status = readableMap.hasKey(FIELD_STATUS) ? readableMap.getInt(FIELD_STATUS) : 0; String serverAuthCode = (String) Utils.argumentNullCheck(readableMap, FIELD_SERVER_AUTH_CODE); String countryCode = (String) Utils.argumentNullCheck(readableMap, FIELD_COUNTRY_CODE); int carrierId = readableMap.hasKey(FIELD_CARRIERID) ? readableMap.getInt(FIELD_CARRIERID) : -1; if (authType.equals(FIELD_AUTH_HUAWEI_ID)) { buildAuth = (T) AuthHuaweiId.build(openId, uid, displayName, photoUrl, accessToken, serviceCountryCode, status, gender, scopeList, serverAuthCode, unionId, countryCode); } else if (authType.equals(FIELD_AUTH_ACCOUNT)) { buildAuth = (T) AuthAccount.build(openId, uid, displayName, photoUrl, accessToken, serviceCountryCode, status, gender, scopeList, serverAuthCode, unionId, countryCode, carrierId); } return buildAuth; } private static Set toSet(ReadableArray readableArray) { Set mySet = new HashSet<>(); for (int index = 0; index < readableArray.size(); index++) { String scopeUri = readableArray.getString(index); mySet.add(scopeUri == null ? new Scope() : new Scope(scopeUri)); } return mySet; } public static List toScopeList(ReadableArray scopeArray) { List scopeList = new ArrayList<>(); if (scopeArray != null) { for (int index = 0; index < scopeArray.size(); index++) { String scopeUri = scopeArray.getString(index); scopeList.add(scopeUri == null ? new Scope() : new Scope(scopeUri)); } } return scopeList; } public static ReadableArray getScopeArray(ReadableMap readableMap) { return (ReadableArray) Utils.argumentNullCheck(readableMap, FIELD_SCOPE_ARRAY); } public static WritableMap parseStatus(Status status) { WritableMap map = Arguments.createMap(); map.putString(FIELD_ERROR_STRING, status.getErrorString()); map.putString(FIELD_STATUS_MESSAGE, status.getStatusMessage()); map.putInt(FIELD_STATUS_CODE, status.getStatusCode()); return map; } public static WritableMap parseAccountIcon(AccountIcon accountIcon) { if (accountIcon == null) { return null; } WritableMap arguments = Arguments.createMap(); arguments.putString(ICON, String.valueOf(bitmapToByteArray(accountIcon.getIcon()))); arguments.putString(ICON_DESCRIPTION, accountIcon.getDescription()); return arguments; } public static String bitmapToByteArray(Bitmap bitmap) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.PNG, 100, baos); byte[] b = baos.toByteArray(); return Base64.encodeToString(b, Base64.DEFAULT); } public static void handleError(final Promise promise, Exception e) { String errCode = "GENERIC_ERR"; if (e instanceof ApiException) { errCode = String.valueOf(((ApiException) e).getStatusCode()); } promise.reject(errCode, e.getMessage()); } public static Object argumentNullCheck(final ReadableMap readableMap, final String key) { if (readableMap.hasKey(key)) { switch (readableMap.getType(key)) { case String: return readableMap.getString(key); case Number: return readableMap.getInt(key); case Map: return readableMap.getMap(key); case Array: return readableMap.getArray(key); } } return null; } public static Long argumentNullCheckAndConvert(final ReadableMap readableMap, final String key) { if (readableMap.hasKey(key)) { return ((Double) readableMap.getDouble(key)).longValue(); } return null; } } ================================================ FILE: react-native-hms-account/android/src/main/java/com/huawei/hms/rn/account/views/HMSHuaweiIdAuthButton.java ================================================ /* Copyright 2020-2024. Huawei Technologies Co., Ltd. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License") you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package com.huawei.hms.rn.account.views; import android.view.View; import androidx.annotation.NonNull; import com.huawei.hms.support.hwid.ui.HuaweiIdAuthButton; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.uimanager.SimpleViewManager; import com.facebook.react.uimanager.ThemedReactContext; import com.facebook.react.uimanager.annotations.ReactProp; public class HMSHuaweiIdAuthButton extends SimpleViewManager { private static final String NAME_AUTH_BUTTON = "HMSHuaweiIdAuthButton"; private static final String ARGUMENT_COLOR_POLICY = "colorPolicy"; private static final String ARGUMENT_ENABLED = "enabled"; private static final String ARGUMENT_THEME = "theme"; private static final String ARGUMENT_CORNER_RADIUS = "cornerRadius"; public HMSHuaweiIdAuthButton(ReactApplicationContext reactContext) { } @NonNull @Override public String getName() { return NAME_AUTH_BUTTON; } @NonNull @Override public HuaweiIdAuthButton createViewInstance(@NonNull ThemedReactContext reactContext) { HuaweiIdAuthButton button = new HuaweiIdAuthButton(reactContext); button.setVisibility(View.VISIBLE); button.setColorPolicy(HuaweiIdAuthButton.COLOR_POLICY_BLACK); return button; } @ReactProp(name = ARGUMENT_COLOR_POLICY) public void setColorPolicy(HuaweiIdAuthButton huaweiIdAuthButton, int colorPolicy) { huaweiIdAuthButton.setColorPolicy(colorPolicy); } @ReactProp(name = ARGUMENT_ENABLED) public void setEnabled(HuaweiIdAuthButton huaweiIdAuthButton, boolean isEnabled) { huaweiIdAuthButton.setEnabled(isEnabled); } @ReactProp(name = ARGUMENT_THEME) public void setTheme(HuaweiIdAuthButton huaweiIdAuthButton, int theme) { huaweiIdAuthButton.setTheme(theme); } @ReactProp(name = ARGUMENT_CORNER_RADIUS) public void setCornerRadius(HuaweiIdAuthButton huaweiIdAuthButton, int cornerRadius) { huaweiIdAuthButton.setCornerRadius(cornerRadius); } } ================================================ FILE: react-native-hms-account/example/.gitignore ================================================ # OSX # .DS_Store # Xcode # build/ *.pbxuser !default.pbxuser *.mode1v3 !default.mode1v3 *.mode2v3 !default.mode2v3 *.perspectivev3 !default.perspectivev3 xcuserdata *.xccheckout *.moved-aside DerivedData *.hmap *.ipa *.xcuserstate # Android/IntelliJ # build/ .idea gradle-wrapper.jar .gradle local.properties *.iml # node.js # node_modules/ npm-debug.log yarn-error.log package-lock.json # BUCK buck-out/ \.buckd/ *.keystore !debug.keystore # fastlane # # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the # screenshots whenever they are needed. # For more information about the recommended setup visit: # https://docs.fastlane.tools/best-practices/source-control/ */fastlane/report.xml */fastlane/Preview.html */fastlane/screenshots # Bundle artifact *.jsbundle # CocoaPods /ios/Pods/ agconnect-services.json *.jks *.keystore ================================================ FILE: react-native-hms-account/example/App.js ================================================ /* Copyright 2020-2024. Huawei Technologies Co., Ltd. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License") you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ import React from "react"; import { View, Text, StyleSheet, ScrollView, TouchableOpacity, Image } from "react-native"; import HMSAccount, { HMSAccountAuthService, HMSAccountAuthManager, HMSHuaweiIdAuthTool, HMSNetworkTool, HMSAuthButton, HMSAuthRequestOptionConstants, HMSAuthScopeListConstants, HMSAuthParamConstants } from "@hmscore/react-native-hms-account"; const styles = StyleSheet.create({ main: { marginBottom: 100, }, logText: { margin: 20, }, viewcontainer: { marginTop: 20, height: 38, }, header: { backgroundColor: "red", height: 100, width: "100%", flexDirection: "row", }, headerTitle: { flex: 1, fontSize: 25, color: "white", fontWeight: "bold", alignSelf: "center", textAlign: "center", }, subTitle: { flex: 1, fontSize: 15, marginTop: 15, fontWeight: "bold", color: "black", alignSelf: "center", textAlign: "center", }, row: { flex: 1, height: 1, backgroundColor: 'black' }, customButton: { marginTop: 15, width: 200, height: 45, justifyContent: "center", alignSelf: "center", borderRadius: 10, marginLeft: 5, marginRight: 5, borderColor: "red", borderWidth: 1, }, buttonText: { fontSize: 14, color: "red", textAlign: "center", }, }); const Button = (props) => ( {props.text} ); class App extends React.Component { constructor() { super(); this.state = { icon: "", log: "", }; } logger = (method, response) => { this.setState({ log: method + JSON.stringify(response) + '\n' + this.state.log }); }; errorLogger = (method, response) => { this.setState({ log: method + response + '\n' + this.state.log }); } signInWithIdToken = () => { let signInData = { accountAuthParams: HMSAuthParamConstants.DEFAULT_AUTH_REQUEST_PARAM, authRequestOption: [HMSAuthRequestOptionConstants.ID_TOKEN, HMSAuthRequestOptionConstants.ACCESS_TOKEN, HMSAuthRequestOptionConstants.CARRIERID], authScopeList: [HMSAuthScopeListConstants.EMAIL] }; HMSAccountAuthService.signIn(signInData) .then((response) => { this.logger("Sign In With IdToken -> ", response) }) .catch((err) => { this.errorLogger("Sign In With IdToken -> ", err) }); }; signInWithAuthorizationCode = () => { let signInData = { accountAuthParams: HMSAuthParamConstants.DEFAULT_AUTH_REQUEST_PARAM, authRequestOption: [HMSAuthRequestOptionConstants.AUTHORIZATION_CODE, HMSAuthRequestOptionConstants.ACCESS_TOKEN], }; HMSAccountAuthService.signIn(signInData) .then((response) => { this.logger("Sign In With AuthorizaionCode -> ", response) }) .catch((err) => { this.errorLogger("Sign In With AuthorizaionCode -> ", err) }); }; signOut = () => HMSAccountAuthService.signOut() .then((response) => { this.logger("signOut -> ", response) }) .catch((err) => { this.errorLogger("signOut -> ", err) }); silentSignIn = () => { let silentSignInData = { accountAuthParams: HMSAuthParamConstants.DEFAULT_AUTH_REQUEST_PARAM, }; HMSAccountAuthService.silentSignIn(silentSignInData) .then((response) => { this.logger("silentSignIn -> ", response) }) .catch((err) => { this.errorLogger("silentSignIn -> ", err) }); }; cancelAuthorization = () => { HMSAccountAuthService.cancelAuthorization() .then((response) => { this.logger("cancelAuthorization -> ", response) }) .catch((err) => { this.errorLogger("cancelAuthorization -> ", err) }); }; getIndependentSignIn = () => { HMSAccountAuthService.getIndependentSignInIntent("CwHLQFU9k3D4f...") .then((response) => { this.logger("getIndependentSignIn -> ", response) }) .catch((err) => { this.errorLogger("getIndependentSignIn -> ", err) }); }; getChannel = () => HMSAccountAuthService.getChannel() .then((response) => { this.logger("getChannel -> ", response) this.setState({ icon: response.icon }) }) .catch((err) => { this.errorLogger("getChannel -> ", err) }); getAuthResult = () => { HMSAccountAuthManager.getAuthResult() .then((response) => { this.logger("getAuthResult -> ", response) }) .catch((err) => { this.errorLogger("getAuthResult -> ", err) }); }; containScopes = () => { let containScopesData = { authAccount: { openId: "myopenid", uid: "myuid", displayName: "mydisplayname", photoUrl: "myphotourl", accessToken: "myaccesstoken", serviceCountryCode: "myservicecountrycode", status: 0, gender: 0, authScopeList: [HMSAuthScopeListConstants.OPENID, HMSAuthScopeListConstants.PROFILE, HMSAuthScopeListConstants.EMAIL], serverAuthCode: "myserverAuthCode", unionId: "myunionId", countryCode: "myCountryCode", }, authScopeList: [HMSAuthScopeListConstants.OPENID, HMSAuthScopeListConstants.PROFILE], }; HMSAccountAuthManager.containScopes(containScopesData) .then((response) => { this.logger("containScopes -> ", response) }) .catch((err) => { this.errorLogger("containScopes -> ", err) }); }; addAuthScopes = () => { let authScopeData = { authScopeList: [HMSAuthScopeListConstants.EMAIL], }; HMSAccountAuthManager.addAuthScopes(authScopeData) .then((response) => { this.logger("addAuthScopes ->", response) }) .catch((err) => { this.errorLogger("addAuthScopes -> ", err) }); }; getAuthResultWithScopes = () => { let authScopeData = { authScopeList: [HMSAuthScopeListConstants.OPENID, HMSAuthScopeListConstants.PROFILE], }; HMSAccountAuthManager.getAuthResultWithScopes(authScopeData) .then((response) => { this.logger("getAuthResultWithScopes -> ", response) }) .catch((err) => { this.errorLogger("getAuthResultWithScopes -> ", err) }); }; deleteAuthInfo = () => { let accesTokenData = { accessToken: "myAccessToken", }; HMSHuaweiIdAuthTool.deleteAuthInfo(accesTokenData) .then((response) => { this.logger("deleteAuthInfo -> ", response) }) .catch((err) => { this.errorLogger("deleteAuthInfo -> ", err) }); }; requestUnionId = () => { let accountData = { huaweiAccountName: "test@test.com", }; HMSHuaweiIdAuthTool.requestUnionId(accountData) .then((response) => { this.logger("requestUnionId -> ", response) }) .catch((err) => { this.errorLogger("requestUnionId -> ", err) }); }; requestAccessToken = () => { let requestAccessTokenData = { authScopeList: [HMSAuthScopeListConstants.OPENID, HMSAuthScopeListConstants.PROFILE], huaweiAccount: { name: "test@test.com", type: "com.huawei.hwid", }, }; HMSHuaweiIdAuthTool.requestAccessToken(requestAccessTokenData) .then((response) => { console.log("requestAccessToken -> ", JSON.stringify(response)) }) .catch((err) => { this.errorLogger("requestAccessToken -> ", err) }); }; buildNetworkCookie = () => { let cookieData = { cookieName: "mycookiename", cookieValue: "mycookievalue", domain: "mydomain", path: "mypath", isHttpOnly: true, isSecure: true, maxAge: 130, }; HMSNetworkTool.buildNetworkCookie(cookieData) .then((response) => { this.logger("buildNetworkCookie -> ", response) }) .catch((err) => { this.errorLogger("buildNetworkCookie -> ", err) }); }; buildNetworkUrl = () => { let urlData = { isUseHttps: true, domain: "mydomain", }; HMSNetworkTool.buildNetworkUrl(urlData) .then((response) => { this.logger("buildNetworkUrl -> ", response) }) .catch((err) => { this.errorLogger("buildNetworkUrl -> ", err) }); }; enableLogger = () => { HMSAccount.enableLogger() }; disableLogger = () => { HMSAccount.disableLogger() }; getButtonInfo = () => { if (buttonView) { buttonView.getInfo().then((response) => this.logger("getButtonInfo -> ", response)); } }; render() { return ( HMS Account Plugin HMSAccountAuthService