diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..2929c4a --- /dev/null +++ b/.npmignore @@ -0,0 +1,2 @@ +example/ +cursor.md diff --git a/JCore.podspec b/JCoreRN.podspec similarity index 86% rename from JCore.podspec rename to JCoreRN.podspec index 68b63a3..0e60a48 100644 --- a/JCore.podspec +++ b/JCoreRN.podspec @@ -3,7 +3,7 @@ pjson = JSON.parse(File.read('package.json')) Pod::Spec.new do |s| - s.name = "JCore" + s.name = "JCoreRN" s.version = pjson["version"] s.homepage = pjson["homepage"] s.summary = pjson["description"] @@ -15,7 +15,7 @@ Pod::Spec.new do |s| s.source = { :git => "https://github.com/jpush/jcore-react-native.git", :tag => "#{s.version}" } s.source_files = 'ios/RCTJCoreModule/*.{h,m}' s.preserve_paths = "**/*.js" - s.vendored_libraries = "ios/RCTJCoreModule/*.a" + s.vendored_frameworks = "ios/RCTJCoreModule/*.xcframework" s.libraries = 'z','resolv', 'sqlite3', 'c++.1' s.dependency 'React' end diff --git a/android/build.gradle b/android/build.gradle index 2feda1b..9202810 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -5,10 +5,11 @@ def safeExtGet(prop, fallback) { } android { - compileSdkVersion safeExtGet('compileSdkVersion', 27) + compileSdkVersion safeExtGet('compileSdkVersion', 34) + namespace 'cn.jiguang.plugins.core' defaultConfig { - minSdkVersion safeExtGet('minSdkVersion', 16) - targetSdkVersion safeExtGet('targetSdkVersion', 27) + minSdkVersion safeExtGet('minSdkVersion', 23) + targetSdkVersion safeExtGet('targetSdkVersion', 34) versionCode 1 versionName "1.0" } diff --git a/android/libs/arm64-v8a/libjcore330.so b/android/libs/arm64-v8a/libjcore330.so deleted file mode 100644 index db9c237..0000000 Binary files a/android/libs/arm64-v8a/libjcore330.so and /dev/null differ diff --git a/android/libs/armeabi-v7a/libjcore330.so b/android/libs/armeabi-v7a/libjcore330.so deleted file mode 100644 index a400249..0000000 Binary files a/android/libs/armeabi-v7a/libjcore330.so and /dev/null differ diff --git a/android/libs/armeabi/libjcore330.so b/android/libs/armeabi/libjcore330.so deleted file mode 100644 index 1b60d64..0000000 Binary files a/android/libs/armeabi/libjcore330.so and /dev/null differ diff --git a/android/libs/jcore-android-3.3.0.jar b/android/libs/jcore-android-3.3.0.jar deleted file mode 100644 index 2ac3f69..0000000 Binary files a/android/libs/jcore-android-3.3.0.jar and /dev/null differ diff --git a/android/libs/jcore-android-5.2.0.jar b/android/libs/jcore-android-5.2.0.jar new file mode 100644 index 0000000..ed7e760 Binary files /dev/null and b/android/libs/jcore-android-5.2.0.jar differ diff --git a/android/libs/mips/libjcore330.so b/android/libs/mips/libjcore330.so deleted file mode 100644 index 0fff441..0000000 Binary files a/android/libs/mips/libjcore330.so and /dev/null differ diff --git a/android/libs/mips64/libjcore330.so b/android/libs/mips64/libjcore330.so deleted file mode 100644 index 98bd3d3..0000000 Binary files a/android/libs/mips64/libjcore330.so and /dev/null differ diff --git a/android/libs/x86/libjcore330.so b/android/libs/x86/libjcore330.so deleted file mode 100644 index 20aa2ea..0000000 Binary files a/android/libs/x86/libjcore330.so and /dev/null differ diff --git a/android/libs/x86_64/libjcore330.so b/android/libs/x86_64/libjcore330.so deleted file mode 100644 index 2a8509e..0000000 Binary files a/android/libs/x86_64/libjcore330.so and /dev/null differ diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index 9217845..7b4a69e 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -1,5 +1,5 @@ + > @@ -15,15 +15,6 @@ - - - - - - - - - {"logs":String} + */ + static readNewLogs(callback: Callback<{ logs: string }>): void; +} diff --git a/index.js b/index.js index e9c7454..5777295 100644 --- a/index.js +++ b/index.js @@ -12,5 +12,27 @@ export default class JCore { static setAuth(auth) { JCoreModule.setAuth(auth) } + static setCountryCode(params) { + if (Platform.OS == "android") { + JCoreModule.setCountryCode(params) + } + } + static enableAutoWakeup(enable) { + if (Platform.OS == "android") { + JCoreModule.enableAutoWakeup(enable) + } + } + + static enableSDKLocalLog(params) { + if (Platform.OS == "android") { + JCoreModule.enableSDKLocalLog(params) + } + } + + static readNewLogs(callback) { + if (Platform.OS == "android") { + JCoreModule.readNewLogs(callback) + } + } } diff --git a/ios/RCTJCoreModule.xcodeproj/project.pbxproj b/ios/RCTJCoreModule.xcodeproj/project.pbxproj index 346a535..f4b1f5c 100644 --- a/ios/RCTJCoreModule.xcodeproj/project.pbxproj +++ b/ios/RCTJCoreModule.xcodeproj/project.pbxproj @@ -3,13 +3,13 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ 08166A7B27EC622A00C7233B /* RCTJCoreModule.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 6212E9EF1F3991D500BDF51A /* RCTJCoreModule.h */; }; - 08166A7E27EC62A900C7233B /* jcore-ios-3.2.1.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 08166A7D27EC62A900C7233B /* jcore-ios-3.2.1.a */; }; 6212E9F11F3991D500BDF51A /* RCTJCoreModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 6212E9F01F3991D500BDF51A /* RCTJCoreModule.m */; }; + 62A780B02EA728CB0065922E /* jcore-ios-5.2.1.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 62A780AF2EA728CB0065922E /* jcore-ios-5.2.1.xcframework */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -26,11 +26,10 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 08166A7C27EC628200C7233B /* Lib */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Lib; sourceTree = ""; }; - 08166A7D27EC62A900C7233B /* jcore-ios-3.2.1.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "jcore-ios-3.2.1.a"; path = "RCTJCoreModule/Lib/jcore-ios-3.2.1.a"; sourceTree = ""; }; 6212E9B41F3990DC00BDF51A /* libRCTJCoreModule.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTJCoreModule.a; sourceTree = BUILT_PRODUCTS_DIR; }; 6212E9EF1F3991D500BDF51A /* RCTJCoreModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTJCoreModule.h; sourceTree = ""; }; 6212E9F01F3991D500BDF51A /* RCTJCoreModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTJCoreModule.m; sourceTree = ""; }; + 62A780AF2EA728CB0065922E /* jcore-ios-5.2.1.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = "jcore-ios-5.2.1.xcframework"; path = "RCTJCoreModule/jcore-ios-5.2.1.xcframework"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -38,7 +37,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 08166A7E27EC62A900C7233B /* jcore-ios-3.2.1.a in Frameworks */, + 62A780B02EA728CB0065922E /* jcore-ios-5.2.1.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -48,7 +47,7 @@ 5CE8168A22FC0295007D710C /* Frameworks */ = { isa = PBXGroup; children = ( - 08166A7D27EC62A900C7233B /* jcore-ios-3.2.1.a */, + 62A780AF2EA728CB0065922E /* jcore-ios-5.2.1.xcframework */, ); name = Frameworks; sourceTree = ""; @@ -73,7 +72,6 @@ 6212E9B61F3990DC00BDF51A /* RCTJCoreModule */ = { isa = PBXGroup; children = ( - 08166A7C27EC628200C7233B /* Lib */, 6212E9EF1F3991D500BDF51A /* RCTJCoreModule.h */, 6212E9F01F3991D500BDF51A /* RCTJCoreModule.m */, ); diff --git a/ios/RCTJCoreModule/jcore-ios-5.2.1.xcframework/Info.plist b/ios/RCTJCoreModule/jcore-ios-5.2.1.xcframework/Info.plist new file mode 100644 index 0000000..2c539fa --- /dev/null +++ b/ios/RCTJCoreModule/jcore-ios-5.2.1.xcframework/Info.plist @@ -0,0 +1,44 @@ + + + + + AvailableLibraries + + + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libJCore.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libJCore.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/ios/RCTJCoreModule/jcore-ios-5.2.1.xcframework/ios-arm64/Headers/JGCOREAPI.h b/ios/RCTJCoreModule/jcore-ios-5.2.1.xcframework/ios-arm64/Headers/JGCOREAPI.h new file mode 100644 index 0000000..80cc87a --- /dev/null +++ b/ios/RCTJCoreModule/jcore-ios-5.2.1.xcframework/ios-arm64/Headers/JGCOREAPI.h @@ -0,0 +1,19 @@ +// +// JGCOREService.h +// JCore +// +// Created by Shuni Huang on 2024/3/19. +// Copyright © 2024 jiguang. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface JGCOREAPI : NSObject + ++ (void)ci:(BOOL)enable; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ios/RCTJCoreModule/JGInforCollectionAuth.h b/ios/RCTJCoreModule/jcore-ios-5.2.1.xcframework/ios-arm64/Headers/JGInforCollectionAuth.h similarity index 100% rename from ios/RCTJCoreModule/JGInforCollectionAuth.h rename to ios/RCTJCoreModule/jcore-ios-5.2.1.xcframework/ios-arm64/Headers/JGInforCollectionAuth.h diff --git a/ios/RCTJCoreModule/jcore-ios-5.2.1.xcframework/ios-arm64/PrivacyInfo.xcprivacy b/ios/RCTJCoreModule/jcore-ios-5.2.1.xcframework/ios-arm64/PrivacyInfo.xcprivacy new file mode 100644 index 0000000..ab4651f --- /dev/null +++ b/ios/RCTJCoreModule/jcore-ios-5.2.1.xcframework/ios-arm64/PrivacyInfo.xcprivacy @@ -0,0 +1,76 @@ + + + + + NSPrivacyTrackingDomains + + NSPrivacyCollectedDataTypes + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypeCrashData + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + NSPrivacyCollectedDataTypePurposeAppFunctionality + + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypeDeviceID + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + NSPrivacyCollectedDataTypePurposeAppFunctionality + + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypePreciseLocation + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + NSPrivacyCollectedDataTypePurposeAppFunctionality + + + + NSPrivacyTracking + + NSPrivacyAccessedAPITypes + + + NSPrivacyAccessedAPITypeReasons + + E174.1 + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryDiskSpace + + + NSPrivacyAccessedAPITypeReasons + + CA92.1 + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryUserDefaults + + + NSPrivacyAccessedAPITypeReasons + + C617.1 + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryFileTimestamp + + + + diff --git a/ios/RCTJCoreModule/jcore-ios-5.2.1.xcframework/ios-arm64/libJCore.a b/ios/RCTJCoreModule/jcore-ios-5.2.1.xcframework/ios-arm64/libJCore.a new file mode 100644 index 0000000..f3b2db7 Binary files /dev/null and b/ios/RCTJCoreModule/jcore-ios-5.2.1.xcframework/ios-arm64/libJCore.a differ diff --git a/ios/RCTJCoreModule/jcore-ios-5.2.1.xcframework/ios-arm64_x86_64-simulator/Headers/JGCOREAPI.h b/ios/RCTJCoreModule/jcore-ios-5.2.1.xcframework/ios-arm64_x86_64-simulator/Headers/JGCOREAPI.h new file mode 100644 index 0000000..80cc87a --- /dev/null +++ b/ios/RCTJCoreModule/jcore-ios-5.2.1.xcframework/ios-arm64_x86_64-simulator/Headers/JGCOREAPI.h @@ -0,0 +1,19 @@ +// +// JGCOREService.h +// JCore +// +// Created by Shuni Huang on 2024/3/19. +// Copyright © 2024 jiguang. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface JGCOREAPI : NSObject + ++ (void)ci:(BOOL)enable; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ios/RCTJCoreModule/jcore-ios-5.2.1.xcframework/ios-arm64_x86_64-simulator/Headers/JGInforCollectionAuth.h b/ios/RCTJCoreModule/jcore-ios-5.2.1.xcframework/ios-arm64_x86_64-simulator/Headers/JGInforCollectionAuth.h new file mode 100644 index 0000000..1a378b8 --- /dev/null +++ b/ios/RCTJCoreModule/jcore-ios-5.2.1.xcframework/ios-arm64_x86_64-simulator/Headers/JGInforCollectionAuth.h @@ -0,0 +1,27 @@ +// +// JGInforCollectionAuth.h +// JCore +// +// Created by 豆瓣 on 2021/10/27. +// Copyright © 2021 jiguang. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +/// 合规接口,是否授权极光采集一定的设备信息 +@interface JGInforCollectionAuthItems : NSObject +/// 是否授权,默认YES +@property(nonatomic,assign)BOOL isAuth; +@end + +@interface JGInforCollectionAuth : NSObject + +/// 设备信息采集授权接口(合规接口) +/// 请务必在调用初始化、功能性接口前调用此接口进行合规授权 +/// @param authBlock auth:YES 则极光认为您同意极光采集一定的设备信息 ++(void)JCollectionAuth:(void(^_Nullable)(JGInforCollectionAuthItems *authInfo))authBlock; +@end + +NS_ASSUME_NONNULL_END diff --git a/ios/RCTJCoreModule/jcore-ios-5.2.1.xcframework/ios-arm64_x86_64-simulator/PrivacyInfo.xcprivacy b/ios/RCTJCoreModule/jcore-ios-5.2.1.xcframework/ios-arm64_x86_64-simulator/PrivacyInfo.xcprivacy new file mode 100644 index 0000000..ab4651f --- /dev/null +++ b/ios/RCTJCoreModule/jcore-ios-5.2.1.xcframework/ios-arm64_x86_64-simulator/PrivacyInfo.xcprivacy @@ -0,0 +1,76 @@ + + + + + NSPrivacyTrackingDomains + + NSPrivacyCollectedDataTypes + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypeCrashData + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + NSPrivacyCollectedDataTypePurposeAppFunctionality + + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypeDeviceID + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + NSPrivacyCollectedDataTypePurposeAppFunctionality + + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypePreciseLocation + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + NSPrivacyCollectedDataTypePurposeAppFunctionality + + + + NSPrivacyTracking + + NSPrivacyAccessedAPITypes + + + NSPrivacyAccessedAPITypeReasons + + E174.1 + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryDiskSpace + + + NSPrivacyAccessedAPITypeReasons + + CA92.1 + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryUserDefaults + + + NSPrivacyAccessedAPITypeReasons + + C617.1 + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryFileTimestamp + + + + diff --git a/ios/RCTJCoreModule/jcore-ios-5.2.1.xcframework/ios-arm64_x86_64-simulator/libJCore.a b/ios/RCTJCoreModule/jcore-ios-5.2.1.xcframework/ios-arm64_x86_64-simulator/libJCore.a new file mode 100644 index 0000000..bca40c1 Binary files /dev/null and b/ios/RCTJCoreModule/jcore-ios-5.2.1.xcframework/ios-arm64_x86_64-simulator/libJCore.a differ diff --git a/ios/RCTJCoreModule/libjcore-ios-3.2.1.a b/ios/RCTJCoreModule/libjcore-ios-3.2.1.a deleted file mode 100644 index aeec54f..0000000 Binary files a/ios/RCTJCoreModule/libjcore-ios-3.2.1.a and /dev/null differ diff --git a/package.json b/package.json index 12a3dce..0d50434 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "author" : "wicked.tc130", "license" : "ISC", "main" : "index.js", - "version" : "2.0.3", + "version" : "2.3.2", "repository" : { "type": "git", "url": "https://github.com/jpush/jcore-react-native"