react-native-beidou 1.1.4 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Compass.android.tsx +4 -12
- package/Compass.ios.tsx +2 -3
- package/android/build.gradle +15 -2
- package/android/src/main/AndroidManifest.xml +1 -0
- package/android/src/main/java/com/fxzs.rnbeidou/BeiDouBluetoothModule.java +425 -185
- package/android/src/main/java/com/fxzs.rnbeidou/BeiDouBluetoothPackage.java +10 -13
- package/android/src/main/java/com/fxzs.rnbeidou/BeidouAidlHelper.java +45 -13
- package/android/src/main/java/com/fxzs.rnbeidou/SuperSimModule.java +301 -0
- package/android/src/main/java/com/fxzs.rnbeidou/view/CompassManager.java +15 -15
- package/android/src/main/java/com/fxzs.rnbeidou/view/CompassView.java +10 -4
- package/index.ts +100 -35
- package/ios/BeiDouBluetoothModule.m +147 -20
- package/ios/BeidouBluetooth.framework/BeidouBluetooth +0 -0
- package/ios/BeidouBluetooth.framework/FMDB.bundle/Info.plist +0 -0
- package/ios/BeidouBluetooth.framework/FMDB.bundle/PrivacyInfo.xcprivacy +14 -0
- package/ios/BeidouBluetooth.framework/Info.plist +0 -0
- package/ios/BeidouBluetooth.framework/_CodeSignature/CodeDirectory +0 -0
- package/ios/BeidouBluetooth.framework/_CodeSignature/CodeRequirements +0 -0
- package/ios/BeidouBluetooth.framework/_CodeSignature/CodeResources +11 -39
- package/ios/BeidouBluetooth.framework/_CodeSignature/CodeSignature +0 -0
- package/ios/CompassView.h +1 -0
- package/ios/CompassView.m +3 -0
- package/ios/CompassViewComponentView.h +11 -0
- package/ios/CompassViewComponentView.mm +64 -0
- package/package.json +3 -5
- package/react-native-beidou.podspec +2 -2
- package/src/CompassViewNativeComponent.ts +13 -0
- package/src/NativeBeiDouBluetooth.ts +57 -0
- package/src/NativeSuperSim.ts +21 -0
- package/BeiDouAIDLTestPage.tsx +0 -710
- package/LogManager.ts +0 -284
- package/TestPage.ts +0 -6
- package/android/.gradle/8.10/checksums/checksums.lock +0 -0
- package/android/.gradle/8.10/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.10/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.10/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.10/gc.properties +0 -0
- package/android/.gradle/8.9/checksums/checksums.lock +0 -0
- package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.9/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/config.properties +0 -2
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/AndroidProjectSystem.xml +0 -6
- package/android/.idea/caches/deviceStreaming.xml +0 -1306
- package/android/.idea/gradle.xml +0 -13
- package/android/.idea/migrations.xml +0 -10
- package/android/.idea/misc.xml +0 -9
- package/android/.idea/runConfigurations.xml +0 -17
- package/android/.idea/vcs.xml +0 -6
- package/android/local.properties +0 -8
- package/android/src/main/java/com/fxzs.rnbeidou/LogManager.java +0 -488
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
2
|
+
|
|
3
|
+
#import "CompassViewComponentView.h"
|
|
4
|
+
#import "CompassView.h"
|
|
5
|
+
|
|
6
|
+
#import <react/renderer/components/BeiDouBluetoothModuleSpec/ComponentDescriptors.h>
|
|
7
|
+
#import <react/renderer/components/BeiDouBluetoothModuleSpec/EventEmitters.h>
|
|
8
|
+
#import <react/renderer/components/BeiDouBluetoothModuleSpec/Props.h>
|
|
9
|
+
#import <react/renderer/components/BeiDouBluetoothModuleSpec/RCTComponentViewHelpers.h>
|
|
10
|
+
|
|
11
|
+
using namespace facebook::react;
|
|
12
|
+
|
|
13
|
+
@interface CompassViewComponentView () <RCTCompassViewViewProtocol>
|
|
14
|
+
@end
|
|
15
|
+
|
|
16
|
+
@implementation CompassViewComponentView {
|
|
17
|
+
CompassView *_contentView;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
+ (ComponentDescriptorProvider)componentDescriptorProvider
|
|
21
|
+
{
|
|
22
|
+
return concreteComponentDescriptorProvider<CompassViewComponentDescriptor>();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
- (instancetype)initWithFrame:(CGRect)frame
|
|
26
|
+
{
|
|
27
|
+
if (self = [super initWithFrame:frame]) {
|
|
28
|
+
_contentView = [[CompassView alloc] init];
|
|
29
|
+
self.contentView = _contentView;
|
|
30
|
+
|
|
31
|
+
__weak __typeof(self) weakSelf = self;
|
|
32
|
+
_contentView.headingChangeHandler = ^(CGFloat radians, CGFloat degrees) {
|
|
33
|
+
__strong __typeof(self) strongSelf = weakSelf;
|
|
34
|
+
if (!strongSelf || strongSelf->_eventEmitter == nullptr) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
CompassViewEventEmitter::OnHeadingChange event = {
|
|
38
|
+
.radians = (double)radians,
|
|
39
|
+
.degrees = (double)degrees,
|
|
40
|
+
};
|
|
41
|
+
[strongSelf eventEmitter].onHeadingChange(event);
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
return self;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
- (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps
|
|
48
|
+
{
|
|
49
|
+
[super updateProps:props oldProps:oldProps];
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
- (const CompassViewEventEmitter &)eventEmitter
|
|
53
|
+
{
|
|
54
|
+
return static_cast<const CompassViewEventEmitter &>(*_eventEmitter);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
Class<RCTComponentViewProtocol> CompassViewCls(void)
|
|
58
|
+
{
|
|
59
|
+
return CompassViewComponentView.class;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@end
|
|
63
|
+
|
|
64
|
+
#endif
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-beidou",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"description": "A React Native module for BeiDou Bluetooth communication.",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"types": "index.ts",
|
|
@@ -13,10 +13,8 @@
|
|
|
13
13
|
"Compass.ios.tsx",
|
|
14
14
|
"Compass.tsx",
|
|
15
15
|
"react-native.config.js",
|
|
16
|
-
"BeiDouAIDLTestPage.tsx",
|
|
17
|
-
"TestPage.ts",
|
|
18
16
|
"react-native-beidou.podspec",
|
|
19
|
-
"
|
|
17
|
+
"src"
|
|
20
18
|
],
|
|
21
19
|
"keywords": [
|
|
22
20
|
"react-native",
|
|
@@ -27,7 +25,7 @@
|
|
|
27
25
|
"license": "MIT",
|
|
28
26
|
"peerDependencies": {
|
|
29
27
|
"react": "*",
|
|
30
|
-
"react-native": "
|
|
28
|
+
"react-native": "0.68.7"
|
|
31
29
|
},
|
|
32
30
|
"dependencies": {}
|
|
33
31
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Pod::Spec.new do |s|
|
|
2
2
|
s.name = "react-native-beidou"
|
|
3
|
-
s.version = "1.1.
|
|
3
|
+
s.version = "1.1.6" # 与 package.json 中的版本保持一致
|
|
4
4
|
s.summary = "React Native Beidou Module"
|
|
5
5
|
s.description = <<-DESC
|
|
6
6
|
A React Native module for Beidou functionality.
|
|
@@ -8,7 +8,7 @@ Pod::Spec.new do |s|
|
|
|
8
8
|
s.homepage = "https://www.npmjs.com/package/react-native-beidou" # 替换为实际地址
|
|
9
9
|
s.license = { :type => "MIT", :file => "LICENSE" }
|
|
10
10
|
s.author = { "David" => "mr_jianwei@163.com" } # 替换为你的信息
|
|
11
|
-
s.platform = :ios, "
|
|
11
|
+
s.platform = :ios, "12.4"
|
|
12
12
|
s.source = {
|
|
13
13
|
:git => "https://www.npmjs.com/package/react-native-beidou.git",
|
|
14
14
|
:branch => "main"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { NativeSyntheticEvent, ViewProps } from 'react-native';
|
|
2
|
+
import { requireNativeComponent } from 'react-native';
|
|
3
|
+
|
|
4
|
+
export type CompassHeadingChangeEvent = {
|
|
5
|
+
radians: number;
|
|
6
|
+
degrees: number;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export interface NativeProps extends ViewProps {
|
|
10
|
+
onHeadingChange?: (event: NativeSyntheticEvent<CompassHeadingChangeEvent>) => void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default requireNativeComponent<NativeProps>('CompassView');
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { NativeModules } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export interface Spec {
|
|
4
|
+
insertMsg(phone: string, content: string, timestamp: number, isSend: boolean): void;
|
|
5
|
+
getAllConversations(): Promise<string>;
|
|
6
|
+
getMessagesForPhone(phone: string, page: number, pageSize: number, callback: (json: string) => void): void;
|
|
7
|
+
startScanForService(callback: () => void): void;
|
|
8
|
+
stopScanning(): void;
|
|
9
|
+
getDiscoveredDevices(): Promise<string>;
|
|
10
|
+
connectToDeviceFromCloudDeviceNO(deviceNO: string, a: number): Promise<string>;
|
|
11
|
+
getAndroidNetWorkInfo(callback: (net: number) => void): void;
|
|
12
|
+
checkBlueToothPermission(callback: (ret: string) => void): void;
|
|
13
|
+
shouldShowBlueToothPermissionRationale(params: string, callback: (ret: string) => void): void;
|
|
14
|
+
initializeBluetooth(callback: (ret: string) => void): void;
|
|
15
|
+
generateRandom16BytesString(): string;
|
|
16
|
+
writeData(randomString: string, deviceNo: string, command: number, attrType: number, writeCallback: (result: number) => void): void;
|
|
17
|
+
writeInfo(base64Payload: string | null, deviceNO: string, command: number, opCode: number, attrType: number, encrypted: boolean): Promise<Object>;
|
|
18
|
+
writeValueInfo(randomString: string, deviceNo: string, command: number, attrType: number, value: number, writeCallback: (result: number) => void): void;
|
|
19
|
+
disConnectWithDeviceUUID(deviceNo: string): Promise<number>;
|
|
20
|
+
fetchCurrentWifiName(callback: (wifiName: string) => void): void;
|
|
21
|
+
getSimCardList(): Promise<Object>;
|
|
22
|
+
getContacts(): Promise<Object>;
|
|
23
|
+
|
|
24
|
+
// AIDL Service methods
|
|
25
|
+
bindBeidouServiceMethod(packageName: string, actionName: string): Promise<boolean>;
|
|
26
|
+
unbindBeidouServiceMethod(): Promise<boolean>;
|
|
27
|
+
BDAuthenticate(slotId: number): Promise<boolean>;
|
|
28
|
+
getBDMsgStatus(slotId: number): Promise<Object>;
|
|
29
|
+
checkValidatedKey(slotId: number): Promise<number>;
|
|
30
|
+
|
|
31
|
+
commonBDMsgEncrypt(slotId: number, speedType: string, receiveList: string[] | null, inputMsg: string): Promise<Object>;
|
|
32
|
+
positionBDMsgEncrypt(slotId: number, speedType: string, receiveList: string[] | null, inputMsg: string, longitude: number, latitude: number): Promise<Object>;
|
|
33
|
+
|
|
34
|
+
commonEmergencyBDMsgEncrypt(slotId: number, speedType: string, receiveList: string[] | null, inputMsg: string): Promise<Object>;
|
|
35
|
+
positionEmergencyBDMsgEncrypt(slotId: number, speedType: string, receiveList: string[] | null, inputMsg: string, longitude: number, latitude: number): Promise<Object>;
|
|
36
|
+
|
|
37
|
+
commonRichMediaBDMsgEncrypt(slotId: number, speedType: string, receiveList: string[] | null, msgType: string, inputRichMediaData: number[] | null): Promise<Object>;
|
|
38
|
+
positionRichMediaBDMsgEncrypt(slotId: number, speedType: string, receiveList: string[] | null, msgType: string, inputRichMediaData: number[] | null, longitude: number, latitude: number): Promise<Object>;
|
|
39
|
+
|
|
40
|
+
commonRichMediaAndTextBDMsgEncrypt(slotId: number, speedType: string, receiveList: string[] | null, text: string, msgType: string, inputRichMediaData: number[] | null): Promise<Object>;
|
|
41
|
+
positionRichMediaAndTextBDMsgEncrypt(slotId: number, speedType: string, receiveList: string[] | null, text: string, msgType: string, inputRichMediaData: number[] | null, longitude: number, latitude: number): Promise<Object>;
|
|
42
|
+
|
|
43
|
+
BDMailboxQueryEncrypt(slotId: number): Promise<Object>;
|
|
44
|
+
EmergencyBDMailboxQueryEncrypt(slotId: number, replyMobile: string): Promise<Object>;
|
|
45
|
+
|
|
46
|
+
BDMsgDecrypt(slotId: number, msg: number[] | null, len: number): Promise<Object>;
|
|
47
|
+
DLEphemerisFile(slotId: number, type: string, version: string): Promise<Object>;
|
|
48
|
+
|
|
49
|
+
setBLEKey(bleKey: string): Promise<number>;
|
|
50
|
+
getGpsLocation(): Promise<Object>;
|
|
51
|
+
|
|
52
|
+
// Logger methods
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const { BeiDouBluetoothModule } = NativeModules;
|
|
56
|
+
|
|
57
|
+
export default BeiDouBluetoothModule as Spec;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { NativeModules } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export interface SuperSimSpec {
|
|
4
|
+
getSimType(slotId: number): Promise<number>;
|
|
5
|
+
getKsKeyAndAuthResult(slotId: number): Promise<object | null>;
|
|
6
|
+
checkKeyIsExistAndValidate(slotId: number): Promise<number>;
|
|
7
|
+
commonMessageEncryptBDMsg(slotId: number, recipients: string[] | null, message: string): Promise<object | null>;
|
|
8
|
+
positionReportEncryptBDMsg(
|
|
9
|
+
slotId: number,
|
|
10
|
+
recipients: string[] | null,
|
|
11
|
+
message: string,
|
|
12
|
+
longitude: number,
|
|
13
|
+
latitude: number
|
|
14
|
+
): Promise<object | null>;
|
|
15
|
+
mailboxQueryEncryptBDMsg(slotId: number): Promise<object | null>;
|
|
16
|
+
mailboxReplyDecryptBDMsg(slotId: number, data: number[] | null, dataLength: number): Promise<object | null>;
|
|
17
|
+
getCurrentUserInfo(slotId: number): Promise<object | null>;
|
|
18
|
+
mailboxSynchronizeDecryptBDMsg(slotId: number): Promise<object | null>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default NativeModules.SuperSimModule as SuperSimSpec | undefined;
|