├── .gitignore
├── .idea
├── .gitignore
├── AndroidProjectSystem.xml
├── compiler.xml
├── deploymentTargetDropDown.xml
├── deploymentTargetSelector.xml
├── gradle.xml
├── kotlinc.xml
├── migrations.xml
├── misc.xml
├── runConfigurations.xml
└── vcs.xml
├── README.md
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── woncan
│ │ └── devicegithubsdk
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── woncan
│ │ │ └── devicegithubsdk
│ │ │ ├── DeviceAdapter.java
│ │ │ └── MainActivity.java
│ └── res
│ │ ├── drawable-v24
│ │ └── ic_launcher_foreground.xml
│ │ ├── drawable
│ │ └── ic_launcher_background.xml
│ │ ├── layout
│ │ ├── activity_main.xml
│ │ └── item_device.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-anydpi-v33
│ │ └── ic_launcher.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.webp
│ │ └── ic_launcher_round.webp
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.webp
│ │ └── ic_launcher_round.webp
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.webp
│ │ └── ic_launcher_round.webp
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.webp
│ │ └── ic_launcher_round.webp
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.webp
│ │ └── ic_launcher_round.webp
│ │ ├── values-night
│ │ └── themes.xml
│ │ ├── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── themes.xml
│ │ └── xml
│ │ ├── backup_rules.xml
│ │ └── data_extraction_rules.xml
│ └── test
│ └── java
│ └── com
│ └── woncan
│ └── devicegithubsdk
│ └── ExampleUnitTest.java
├── build.gradle
├── devicelib
├── .gitignore
├── build.gradle
├── consumer-rules.pro
├── libs
│ ├── arm64-v8a
│ │ ├── libcmcc_sdk.so
│ │ ├── libdevice.so
│ │ ├── libqxinertial.so
│ │ ├── libqxrtk_hal.so
│ │ ├── libqxwz_sdk_core.so
│ │ ├── libsdk_core_jni.so
│ │ └── libsixents-core-sdk.so
│ ├── armeabi-v7a
│ │ ├── libcmcc_sdk.so
│ │ ├── libdevice.so
│ │ ├── libqxinertial.so
│ │ ├── libqxrtk_hal.so
│ │ ├── libqxwz_sdk_core.so
│ │ ├── libsdk_core_jni.so
│ │ └── libsixents-core-sdk.so
│ ├── cmcc.jar
│ ├── device.jar
│ ├── qx.jar
│ └── sixents.jar
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── woncan
│ │ └── devicelib
│ │ └── ExampleInstrumentedTest.java
│ └── main
│ └── AndroidManifest.xml
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── jitpack.yml
├── readme
├── README_CN.md
├── bean.md
└── errCode.md
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 | .cxx
15 | local.properties
16 |
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/.idea/AndroidProjectSystem.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/deploymentTargetDropDown.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.idea/deploymentTargetSelector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
20 |
21 |
--------------------------------------------------------------------------------
/.idea/kotlinc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/migrations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Device
2 |
3 | Device SDK说明
4 |
5 | ##### Gradle集成SDK
6 |
7 | ###### 1.1在Project的build.gradle文件中配置repositories,添加maven仓库地址(新版本Android studio需要在settings.gradle里面配置)
8 | ```
9 | repositories {
10 | maven { url "https://jitpack.io" }
11 | }
12 | ```
13 |
14 | ###### 在主工程的build.gradle文件配置dependencies
15 |
16 | [](https://jitpack.io/#woncan/device)
17 | ```
18 | dependencies {
19 | implementation 'com.github.woncan:device:latest.release'
20 | }
21 | ```
22 |
23 | ##### 添加混淆配置
24 | ```
25 | -keep class com.woncan.device.**{*;}
26 | -keep class com.cmcc.sy.hap.** { *;}
27 | -keep class com.qxwz.sdk.** { *;}
28 | -keep class com.sixents.sdk.** { *;}
29 | ```
30 | ### 使用
31 |
32 |
33 |
34 | #### 搜索设备
35 | **以下方式选择其一**
36 | - 搜索所有设备
37 | ```
38 | ScanManager.scanDevice(this, device -> {
39 | });
40 | ```
41 | - 搜索蓝牙设备
42 | ```
43 | ScanManager.scanBluetoothDevice(this, device -> {
44 | });
45 | ```
46 | - 搜索串口设备
47 | ```
48 | ScanManager.scanSerialDevice(this, device -> {
49 | });
50 | ```
51 | #### 关闭搜索
52 | ```
53 | ScanManager.stopScan(context);
54 | ```
55 |
56 | #### 连接并配置设备
57 | ```
58 | //连接设备
59 | device.connect(context);
60 |
61 | //设置数据频率
62 | device.setInterval(DeviceInterval.HZ_5);
63 |
64 | //配置Ntrip账号
65 | device.setAccount("ip",port,"account","password","mountPoint");
66 |
67 | //配置激光开关
68 | device.setLaserState(true);
69 |
70 | ```
71 |
72 | #### 注册回调
73 | ```
74 | //设备状态
75 | device.registerSatesListener(new DeviceStatesListener() {
76 | @Override
77 | public void onConnectionStateChange(boolean isConnect) {
78 | //连接状态
79 | }
80 |
81 | @Override
82 | public void onDeviceAccountChange(@NonNull DeviceNtripAccount account) {
83 | //写入设备的Ntrip账号
84 | }
85 |
86 | @Override
87 | public void onDeviceInfoChange(@NonNull DeviceInfo deviceInfo) {
88 | //设备信息
89 | }
90 |
91 | @Override
92 | public void onLaserStateChange(boolean isOpen) {
93 | //激光开关
94 | }
95 | });
96 |
97 | //设备定位
98 | device.registerLocationListener(new WLocationListener() {
99 | @Override
100 | public void onReceiveLocation(@NonNull WLocation wLocation) {
101 | //定位信息
102 | }
103 |
104 | @Override
105 | public void onError(int i, @NonNull String s) {
106 | //错误信息
107 | }
108 | });
109 |
110 | //卫星数据
111 | device.registerSatelliteListener(new SatelliteListener() {
112 | @Override
113 | public void onReceiveSatellite(List list) {
114 | //卫星数据
115 | }
116 | });
117 | //NMEA数据
118 | device.setNMEAEnable(NMEA.GSV , true);
119 | device.setNMEAEnable(NMEA.GSA , true);
120 | device.setNMEAEnable(NMEA.GLL , true);
121 | device.setNMEAEnable(NMEA.GMC , true);
122 | device.setNMEAEnable(NMEA.VTG , true);
123 |
124 | device.setNMEAListener(new NMEAListener() {
125 | @Override
126 | public void onReceiveNMEA(String s) {
127 | //NMEA数据
128 | }
129 | });
130 | ```
131 | - [WLocation](https://github.com/woncan/device/blob/master/readme/bean.md#WLocation)
132 | - [SatelliteInfo](https://github.com/woncan/device/blob/master/readme/bean.md#SatelliteInfo)
133 | - [errCode](https://github.com/woncan/device/blob/master/readme/errCode.md)
134 | #### 静态记录
135 | ```
136 | //开启RTCM
137 | device.openRTCM(new RTCM[]{RTCM.RTCM1074}, RTCMInterval.SECOND_3);
138 | //注册监听
139 | device.registerRTCMAListener(new RTCMListener() {
140 | @Override
141 | public void onReceiveRTCM(int[] type, byte[] bytes) {
142 | //type:RTCM类型 bytes:RTCM数据
143 | }
144 |
145 | @Override
146 | public void onReceiveSFR(byte[] bytes) {
147 | //SFR数据
148 | }
149 | });
150 | //记录完毕后关闭RTCM 或者 重启设备
151 | device.closeRTCM();
152 | ```
153 | #### 断开连接
154 | ```
155 | device.disconnect();
156 |
157 | ```
158 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.application'
3 | id 'org.jetbrains.kotlin.android'
4 | }
5 |
6 | android {
7 | namespace 'com.woncan.devicegithubsdk'
8 | compileSdk 34
9 |
10 | defaultConfig {
11 | applicationId "com.woncan.devicegithubsdk"
12 | minSdk 21
13 | targetSdk 34
14 | versionCode 1
15 | versionName "1.0"
16 |
17 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
18 | }
19 |
20 | buildTypes {
21 | release {
22 | minifyEnabled false
23 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
24 | }
25 | }
26 | compileOptions {
27 | sourceCompatibility JavaVersion.VERSION_1_8
28 | targetCompatibility JavaVersion.VERSION_1_8
29 | }
30 | viewBinding{
31 | enabled = true
32 | }
33 |
34 | }
35 |
36 | dependencies {
37 |
38 | implementation 'androidx.appcompat:appcompat:1.6.1'
39 | implementation 'com.google.android.material:material:1.9.0'
40 | implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
41 | implementation 'androidx.activity:activity:1.8.0'
42 | testImplementation 'junit:junit:4.13.2'
43 | androidTestImplementation 'androidx.test.ext:junit:1.1.5'
44 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
45 | implementation 'io.github.cymchad:BaseRecyclerViewAdapterHelper:3.0.14'
46 | implementation project(path: ':devicelib')
47 | // implementation 'com.github.woncan:device:1.0.0'
48 | }
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/woncan/devicegithubsdk/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.woncan.devicegithubsdk;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 | assertEquals("com.woncan.devicegithubsdk", appContext.getPackageName());
25 | }
26 | }
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
14 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/app/src/main/java/com/woncan/devicegithubsdk/DeviceAdapter.java:
--------------------------------------------------------------------------------
1 | package com.woncan.devicegithubsdk;
2 |
3 | import com.chad.library.adapter.base.BaseQuickAdapter;
4 | import com.chad.library.adapter.base.viewholder.BaseViewHolder;
5 | import com.woncan.device.Device;
6 |
7 | public class DeviceAdapter extends BaseQuickAdapter {
8 |
9 | private DeviceAdapter(int layoutResId) {
10 | super(layoutResId);
11 | }
12 |
13 | public DeviceAdapter() {
14 | this(R.layout.item_device);
15 | }
16 |
17 | @Override
18 | protected void convert(BaseViewHolder helper, Device item) {
19 | helper.setText(R.id.item_bluetooth_name, item.getName());
20 |
21 | }
22 |
23 |
24 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/woncan/devicegithubsdk/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.woncan.devicegithubsdk;
2 |
3 | import static java.lang.Thread.sleep;
4 |
5 | import android.Manifest;
6 | import android.annotation.SuppressLint;
7 | import android.content.pm.PackageManager;
8 | import android.os.Build;
9 | import android.os.Bundle;
10 | import android.text.method.ScrollingMovementMethod;
11 | import android.util.Log;
12 | import android.widget.Toast;
13 |
14 | import androidx.activity.result.ActivityResultLauncher;
15 | import androidx.activity.result.contract.ActivityResultContracts;
16 | import androidx.annotation.NonNull;
17 | import androidx.appcompat.app.AppCompatActivity;
18 | import androidx.recyclerview.widget.LinearLayoutManager;
19 |
20 | import com.woncan.device.Device;
21 | import com.woncan.device.NMEA;
22 | import com.woncan.device.ScanManager;
23 | import com.woncan.device.bean.DeviceInfo;
24 | import com.woncan.device.bean.DeviceNtripAccount;
25 | import com.woncan.device.bean.WLocation;
26 | import com.woncan.device.device.DeviceInterval;
27 | import com.woncan.device.listener.DeviceStatesListener;
28 | import com.woncan.device.listener.WLocationListener;
29 | import com.woncan.device.util.LogUtil;
30 | import com.woncan.devicegithubsdk.databinding.ActivityMainBinding;
31 |
32 | import java.util.ArrayList;
33 | import java.util.List;
34 | import java.util.Locale;
35 |
36 | public class MainActivity extends AppCompatActivity {
37 | public static final String TAG = "WONCAN_DEVICE_MAIN";
38 |
39 | private ActivityMainBinding binding;
40 |
41 | @SuppressLint("MissingPermission")
42 | @Override
43 | protected void onCreate(Bundle savedInstanceState) {
44 | super.onCreate(savedInstanceState);
45 | DeviceAdapter adapter = new DeviceAdapter();
46 |
47 | binding = ActivityMainBinding.inflate(getLayoutInflater());
48 | setContentView(binding.getRoot());
49 |
50 | binding.tvLog.setMovementMethod(ScrollingMovementMethod.getInstance());
51 | binding.btnSearch.setOnClickListener(v -> {
52 | //搜索所有设备
53 | if (!requestPermission()) {
54 | Toast.makeText(this, "需要蓝牙和定位权限", Toast.LENGTH_SHORT).show();
55 | return;
56 | }
57 | adapter.setNewInstance(null);
58 | adapter.addData(ScanManager.getPhoneDevice());
59 | ScanManager.scanDevice(this, device -> {
60 | Log.i(TAG, "onCreate: " + device.getName());
61 | if (!adapter.getData().contains(device)) {
62 | adapter.addData(device);
63 | }
64 | });
65 | });
66 |
67 | binding.recyclerView.setLayoutManager(new LinearLayoutManager(this));
68 | binding.recyclerView.setAdapter(adapter);
69 | adapter.setOnItemClickListener((adapter1, view, position) -> {
70 | ScanManager.stopScan(MainActivity.this);
71 | connect(adapter.getItem(position));
72 | });
73 | }
74 |
75 |
76 | private void connect(Device device) {
77 | LogUtil.INSTANCE.setShowLog(true);
78 | device.registerSatesListener(new DeviceStatesListener() {
79 | @Override
80 | public void onConnectionStateChange(boolean isConnect) {
81 | binding.tvLog.append(isConnect ? "设备已连接\n" : "断开连接\n");
82 | }
83 |
84 | @Override
85 | public void onDeviceAccountChange(@NonNull DeviceNtripAccount account) {
86 | super.onDeviceAccountChange(account);
87 |
88 | }
89 |
90 | @Override
91 | public void onDeviceInfoChange(@NonNull DeviceInfo deviceInfo) {
92 | binding.tvDeviceInfo.setText(String.format(Locale.CHINA, "型号:%s\n设备ID:%s\n产品名:%s", deviceInfo.getModel(), deviceInfo.getDeviceID(), deviceInfo.getProductNameZH()));
93 | }
94 |
95 | @Override
96 | public void onLaserStateChange(boolean isOpen) {
97 |
98 | }
99 | });
100 |
101 | device.registerLocationListener(new WLocationListener() {
102 | @Override
103 | public void onReceiveLocation(@NonNull WLocation wLocation) {
104 | Log.i(TAG, "onReceiveLocation: wLocation");
105 | binding.tvLocation.setText(String.format(Locale.CHINA, "纬度:%.8f\n经度:%.8f\n海拔:%.3f\n解状态:%d", wLocation.getLatitude(), wLocation.getLongitude(), wLocation.getAltitude(), wLocation.getFixStatus()));
106 | }
107 |
108 | @Override
109 | public void onError(int i, @NonNull String s) {
110 | binding.tvLog.append(String.format(Locale.CHINA, "onError:%d %s\n", i, s));
111 | }
112 | });
113 | // device.setNMEAListener(s -> Log.i(TAG, "onReceiveNMEA: "+s));
114 | // device.openRTCM(new RTCM[]{RTCM.RTCM1074}, RTCMInterval.SECOND_3);
115 | // device.registerRTCMAListener(new RTCMListener() {
116 | // @Override
117 | // public void onReceiveRTCM(int[] ints, byte[] bytes) {
118 | //
119 | // }
120 | //
121 | // @Override
122 | // public void onReceiveSFR(byte[] bytes) {
123 | //
124 | // }
125 | // });
126 | // device.registerSatelliteListener(new SatelliteListener() {
127 | // @Override
128 | // public void onReceiveSatellite(List list) {
129 | //
130 | // }
131 | // });
132 |
133 | // device.closeRTCM();
134 | // device.setLaserState(true);
135 | // int port=1;
136 | device.setNMEAEnable(NMEA.GGA , true);
137 | device.setNMEAEnable(NMEA.GSV , true);
138 | device.setNMEAEnable(NMEA.GSA , true);
139 | device.setNMEAEnable(NMEA.GLL , true);
140 | device.setNMEAEnable(NMEA.GMC , true);
141 | device.setNMEAEnable(NMEA.VTG , true);
142 |
143 | device.setNMEAListener(s -> {
144 |
145 | });
146 | device.connect(this);
147 | new Thread(() -> {
148 | try {
149 | sleep(2000);
150 | } catch (InterruptedException e) {
151 | throw new RuntimeException(e);
152 | }
153 | device.setInterval(DeviceInterval.HZ_5);
154 | }).start();
155 |
156 | // device.setAccount("",0,"","","");
157 | }
158 |
159 |
160 | private final ActivityResultLauncher resultLauncher =
161 | registerForActivityResult(new ActivityResultContracts.RequestMultiplePermissions(), isGranted -> {
162 | });
163 |
164 |
165 | private boolean requestPermission() {
166 |
167 | if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
168 | return true;
169 | }
170 | List list = new ArrayList<>();
171 | if (checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
172 | list.add(Manifest.permission.ACCESS_COARSE_LOCATION);
173 | }
174 | if (checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
175 | list.add(Manifest.permission.ACCESS_FINE_LOCATION);
176 | }
177 | if (checkSelfPermission(Manifest.permission.BLUETOOTH) != PackageManager.PERMISSION_GRANTED) {
178 | list.add(Manifest.permission.BLUETOOTH);
179 | }
180 | if (checkSelfPermission(Manifest.permission.BLUETOOTH_ADMIN) != PackageManager.PERMISSION_GRANTED) {
181 | list.add(Manifest.permission.BLUETOOTH_ADMIN);
182 | }
183 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
184 | if (checkSelfPermission(Manifest.permission.BLUETOOTH_SCAN) != PackageManager.PERMISSION_GRANTED) {
185 | list.add(Manifest.permission.BLUETOOTH_SCAN);
186 | }
187 | }
188 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
189 | if (checkSelfPermission(Manifest.permission.BLUETOOTH_CONNECT) != PackageManager.PERMISSION_GRANTED) {
190 | list.add(Manifest.permission.BLUETOOTH_CONNECT);
191 | }
192 | }
193 |
194 | resultLauncher.launch(list.toArray(new String[0]));
195 | return list.size() == 0;
196 | }
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
17 |
27 |
28 |
29 |
30 |
39 |
40 |
41 |
49 |
50 |
61 |
62 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_device.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v33/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/woncan/device/f6177c155f009af6573a50ea462a52d87beee928/app/src/main/res/mipmap-hdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/woncan/device/f6177c155f009af6573a50ea462a52d87beee928/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/woncan/device/f6177c155f009af6573a50ea462a52d87beee928/app/src/main/res/mipmap-mdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/woncan/device/f6177c155f009af6573a50ea462a52d87beee928/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/woncan/device/f6177c155f009af6573a50ea462a52d87beee928/app/src/main/res/mipmap-xhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/woncan/device/f6177c155f009af6573a50ea462a52d87beee928/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/woncan/device/f6177c155f009af6573a50ea462a52d87beee928/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/woncan/device/f6177c155f009af6573a50ea462a52d87beee928/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/woncan/device/f6177c155f009af6573a50ea462a52d87beee928/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/woncan/device/f6177c155f009af6573a50ea462a52d87beee928/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/values-night/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFBB86FC
4 | #FF6200EE
5 | #FF3700B3
6 | #FF03DAC5
7 | #FF018786
8 | #FF000000
9 | #FFFFFFFF
10 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | DeviceGithubSDK
3 |
--------------------------------------------------------------------------------
/app/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/backup_rules.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/data_extraction_rules.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
16 |
--------------------------------------------------------------------------------
/app/src/test/java/com/woncan/devicegithubsdk/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.woncan.devicegithubsdk;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | plugins {
3 | id 'com.android.application' version '8.4.1' apply false
4 | id 'com.android.library' version '8.4.1' apply false
5 | id 'org.jetbrains.kotlin.android' version '1.7.10' apply false
6 | }
--------------------------------------------------------------------------------
/devicelib/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/devicelib/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.library'
3 | id 'maven-publish'
4 | }
5 | group = 'com.github.woncan'
6 | android {
7 | namespace 'com.woncan.devicelib'
8 | compileSdk 34
9 |
10 | defaultConfig {
11 | minSdk 21
12 | targetSdk 34
13 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
14 | consumerProguardFiles "consumer-rules.pro"
15 | }
16 |
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | compileOptions {
24 | sourceCompatibility JavaVersion.VERSION_1_8
25 | targetCompatibility JavaVersion.VERSION_1_8
26 | }
27 | sourceSets {
28 | main {
29 | jniLibs.srcDirs = ['libs']
30 | }
31 | }
32 |
33 |
34 | publishing {
35 | singleVariant("release") {
36 | withSourcesJar()
37 | withJavadocJar()
38 | }
39 | }
40 |
41 | }
42 |
43 |
44 | dependencies {
45 | api files('libs/device.jar')
46 |
47 | implementation files('libs/cmcc.jar')
48 | implementation files('libs/qx.jar')
49 | implementation files('libs/sixents.jar')
50 | implementation 'com.squareup.okio:okio:2.8.0'
51 | implementation "com.squareup.okhttp3:okhttp:4.9.0"
52 | implementation 'com.github.mik3y:usb-serial-for-android:3.8.0'
53 | implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4'
54 | }
55 |
56 | afterEvaluate {
57 | publishing {
58 | publications {
59 | release(MavenPublication) {
60 | from components.release
61 | groupId = 'com.github.woncan'
62 | }
63 | }
64 | }
65 | }
--------------------------------------------------------------------------------
/devicelib/consumer-rules.pro:
--------------------------------------------------------------------------------
1 | -keep class com.woncan.device.**{*;}
2 | -keep class com.cmcc.sy.hap.** { *;}
3 | -keep class com.qxwz.sdk.** { *;}
4 | -keep class com.sixents.sdk.** { *;}
--------------------------------------------------------------------------------
/devicelib/libs/arm64-v8a/libcmcc_sdk.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/woncan/device/f6177c155f009af6573a50ea462a52d87beee928/devicelib/libs/arm64-v8a/libcmcc_sdk.so
--------------------------------------------------------------------------------
/devicelib/libs/arm64-v8a/libdevice.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/woncan/device/f6177c155f009af6573a50ea462a52d87beee928/devicelib/libs/arm64-v8a/libdevice.so
--------------------------------------------------------------------------------
/devicelib/libs/arm64-v8a/libqxinertial.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/woncan/device/f6177c155f009af6573a50ea462a52d87beee928/devicelib/libs/arm64-v8a/libqxinertial.so
--------------------------------------------------------------------------------
/devicelib/libs/arm64-v8a/libqxrtk_hal.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/woncan/device/f6177c155f009af6573a50ea462a52d87beee928/devicelib/libs/arm64-v8a/libqxrtk_hal.so
--------------------------------------------------------------------------------
/devicelib/libs/arm64-v8a/libqxwz_sdk_core.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/woncan/device/f6177c155f009af6573a50ea462a52d87beee928/devicelib/libs/arm64-v8a/libqxwz_sdk_core.so
--------------------------------------------------------------------------------
/devicelib/libs/arm64-v8a/libsdk_core_jni.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/woncan/device/f6177c155f009af6573a50ea462a52d87beee928/devicelib/libs/arm64-v8a/libsdk_core_jni.so
--------------------------------------------------------------------------------
/devicelib/libs/arm64-v8a/libsixents-core-sdk.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/woncan/device/f6177c155f009af6573a50ea462a52d87beee928/devicelib/libs/arm64-v8a/libsixents-core-sdk.so
--------------------------------------------------------------------------------
/devicelib/libs/armeabi-v7a/libcmcc_sdk.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/woncan/device/f6177c155f009af6573a50ea462a52d87beee928/devicelib/libs/armeabi-v7a/libcmcc_sdk.so
--------------------------------------------------------------------------------
/devicelib/libs/armeabi-v7a/libdevice.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/woncan/device/f6177c155f009af6573a50ea462a52d87beee928/devicelib/libs/armeabi-v7a/libdevice.so
--------------------------------------------------------------------------------
/devicelib/libs/armeabi-v7a/libqxinertial.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/woncan/device/f6177c155f009af6573a50ea462a52d87beee928/devicelib/libs/armeabi-v7a/libqxinertial.so
--------------------------------------------------------------------------------
/devicelib/libs/armeabi-v7a/libqxrtk_hal.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/woncan/device/f6177c155f009af6573a50ea462a52d87beee928/devicelib/libs/armeabi-v7a/libqxrtk_hal.so
--------------------------------------------------------------------------------
/devicelib/libs/armeabi-v7a/libqxwz_sdk_core.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/woncan/device/f6177c155f009af6573a50ea462a52d87beee928/devicelib/libs/armeabi-v7a/libqxwz_sdk_core.so
--------------------------------------------------------------------------------
/devicelib/libs/armeabi-v7a/libsdk_core_jni.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/woncan/device/f6177c155f009af6573a50ea462a52d87beee928/devicelib/libs/armeabi-v7a/libsdk_core_jni.so
--------------------------------------------------------------------------------
/devicelib/libs/armeabi-v7a/libsixents-core-sdk.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/woncan/device/f6177c155f009af6573a50ea462a52d87beee928/devicelib/libs/armeabi-v7a/libsixents-core-sdk.so
--------------------------------------------------------------------------------
/devicelib/libs/cmcc.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/woncan/device/f6177c155f009af6573a50ea462a52d87beee928/devicelib/libs/cmcc.jar
--------------------------------------------------------------------------------
/devicelib/libs/device.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/woncan/device/f6177c155f009af6573a50ea462a52d87beee928/devicelib/libs/device.jar
--------------------------------------------------------------------------------
/devicelib/libs/qx.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/woncan/device/f6177c155f009af6573a50ea462a52d87beee928/devicelib/libs/qx.jar
--------------------------------------------------------------------------------
/devicelib/libs/sixents.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/woncan/device/f6177c155f009af6573a50ea462a52d87beee928/devicelib/libs/sixents.jar
--------------------------------------------------------------------------------
/devicelib/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 | -keep class com.woncan.device.**{*;}
23 | -keep class com.cmcc.sy.hap.** { *;}
24 | -keep class com.qxwz.sdk.** { *;}
25 | -keep class com.sixents.sdk.** { *;}
--------------------------------------------------------------------------------
/devicelib/src/androidTest/java/com/woncan/devicelib/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.woncan.devicelib;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 | assertEquals("com.woncan.devicelib.test", appContext.getPackageName());
25 | }
26 | }
--------------------------------------------------------------------------------
/devicelib/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
17 |
18 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app's APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Enables namespacing of each library's R class so that its R class includes only the
19 | # resources declared in the library itself and none from the library's dependencies,
20 | # thereby reducing the size of the R class for that library
21 | android.nonTransitiveRClass=true
22 | android.enableJetifier=true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/woncan/device/f6177c155f009af6573a50ea462a52d87beee928/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Mar 31 17:30:47 CST 2023
2 | distributionBase=GRADLE_USER_HOME
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
4 | distributionPath=wrapper/dists
5 | zipStorePath=wrapper/dists
6 | zipStoreBase=GRADLE_USER_HOME
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | #
4 | # Copyright 2015 the original author or authors.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # https://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | ##############################################################################
20 | ##
21 | ## Gradle start up script for UN*X
22 | ##
23 | ##############################################################################
24 |
25 | # Attempt to set APP_HOME
26 | # Resolve links: $0 may be a link
27 | PRG="$0"
28 | # Need this for relative symlinks.
29 | while [ -h "$PRG" ] ; do
30 | ls=`ls -ld "$PRG"`
31 | link=`expr "$ls" : '.*-> \(.*\)$'`
32 | if expr "$link" : '/.*' > /dev/null; then
33 | PRG="$link"
34 | else
35 | PRG=`dirname "$PRG"`"/$link"
36 | fi
37 | done
38 | SAVED="`pwd`"
39 | cd "`dirname \"$PRG\"`/" >/dev/null
40 | APP_HOME="`pwd -P`"
41 | cd "$SAVED" >/dev/null
42 |
43 | APP_NAME="Gradle"
44 | APP_BASE_NAME=`basename "$0"`
45 |
46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48 |
49 | # Use the maximum available, or set MAX_FD != -1 to use that value.
50 | MAX_FD="maximum"
51 |
52 | warn () {
53 | echo "$*"
54 | }
55 |
56 | die () {
57 | echo
58 | echo "$*"
59 | echo
60 | exit 1
61 | }
62 |
63 | # OS specific support (must be 'true' or 'false').
64 | cygwin=false
65 | msys=false
66 | darwin=false
67 | nonstop=false
68 | case "`uname`" in
69 | CYGWIN* )
70 | cygwin=true
71 | ;;
72 | Darwin* )
73 | darwin=true
74 | ;;
75 | MINGW* )
76 | msys=true
77 | ;;
78 | NONSTOP* )
79 | nonstop=true
80 | ;;
81 | esac
82 |
83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
84 |
85 |
86 | # Determine the Java command to use to start the JVM.
87 | if [ -n "$JAVA_HOME" ] ; then
88 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
89 | # IBM's JDK on AIX uses strange locations for the executables
90 | JAVACMD="$JAVA_HOME/jre/sh/java"
91 | else
92 | JAVACMD="$JAVA_HOME/bin/java"
93 | fi
94 | if [ ! -x "$JAVACMD" ] ; then
95 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
96 |
97 | Please set the JAVA_HOME variable in your environment to match the
98 | location of your Java installation."
99 | fi
100 | else
101 | JAVACMD="java"
102 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
103 |
104 | Please set the JAVA_HOME variable in your environment to match the
105 | location of your Java installation."
106 | fi
107 |
108 | # Increase the maximum file descriptors if we can.
109 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
110 | MAX_FD_LIMIT=`ulimit -H -n`
111 | if [ $? -eq 0 ] ; then
112 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
113 | MAX_FD="$MAX_FD_LIMIT"
114 | fi
115 | ulimit -n $MAX_FD
116 | if [ $? -ne 0 ] ; then
117 | warn "Could not set maximum file descriptor limit: $MAX_FD"
118 | fi
119 | else
120 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
121 | fi
122 | fi
123 |
124 | # For Darwin, add options to specify how the application appears in the dock
125 | if $darwin; then
126 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
127 | fi
128 |
129 | # For Cygwin or MSYS, switch paths to Windows format before running java
130 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
131 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
132 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133 |
134 | JAVACMD=`cygpath --unix "$JAVACMD"`
135 |
136 | # We build the pattern for arguments to be converted via cygpath
137 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
138 | SEP=""
139 | for dir in $ROOTDIRSRAW ; do
140 | ROOTDIRS="$ROOTDIRS$SEP$dir"
141 | SEP="|"
142 | done
143 | OURCYGPATTERN="(^($ROOTDIRS))"
144 | # Add a user-defined pattern to the cygpath arguments
145 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
146 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
147 | fi
148 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
149 | i=0
150 | for arg in "$@" ; do
151 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
152 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
153 |
154 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
155 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
156 | else
157 | eval `echo args$i`="\"$arg\""
158 | fi
159 | i=`expr $i + 1`
160 | done
161 | case $i in
162 | 0) set -- ;;
163 | 1) set -- "$args0" ;;
164 | 2) set -- "$args0" "$args1" ;;
165 | 3) set -- "$args0" "$args1" "$args2" ;;
166 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
167 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
168 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
169 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
170 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
171 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
172 | esac
173 | fi
174 |
175 | # Escape application args
176 | save () {
177 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
178 | echo " "
179 | }
180 | APP_ARGS=`save "$@"`
181 |
182 | # Collect all arguments for the java command, following the shell quoting and substitution rules
183 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
184 |
185 | exec "$JAVACMD" "$@"
186 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34 |
35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37 |
38 | @rem Find java.exe
39 | if defined JAVA_HOME goto findJavaFromJavaHome
40 |
41 | set JAVA_EXE=java.exe
42 | %JAVA_EXE% -version >NUL 2>&1
43 | if "%ERRORLEVEL%" == "0" goto execute
44 |
45 | echo.
46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47 | echo.
48 | echo Please set the JAVA_HOME variable in your environment to match the
49 | echo location of your Java installation.
50 |
51 | goto fail
52 |
53 | :findJavaFromJavaHome
54 | set JAVA_HOME=%JAVA_HOME:"=%
55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56 |
57 | if exist "%JAVA_EXE%" goto execute
58 |
59 | echo.
60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61 | echo.
62 | echo Please set the JAVA_HOME variable in your environment to match the
63 | echo location of your Java installation.
64 |
65 | goto fail
66 |
67 | :execute
68 | @rem Setup the command line
69 |
70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
71 |
72 |
73 | @rem Execute Gradle
74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
75 |
76 | :end
77 | @rem End local scope for the variables with windows NT shell
78 | if "%ERRORLEVEL%"=="0" goto mainEnd
79 |
80 | :fail
81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
82 | rem the _cmd.exe /c_ return code!
83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84 | exit /b 1
85 |
86 | :mainEnd
87 | if "%OS%"=="Windows_NT" endlocal
88 |
89 | :omega
90 |
--------------------------------------------------------------------------------
/jitpack.yml:
--------------------------------------------------------------------------------
1 | jdk:
2 | - openjdk17
--------------------------------------------------------------------------------
/readme/README_CN.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/woncan/device/f6177c155f009af6573a50ea462a52d87beee928/readme/README_CN.md
--------------------------------------------------------------------------------
/readme/bean.md:
--------------------------------------------------------------------------------
1 | ##### WLocation
2 |
3 | | 方法名 | 说明| 备注|
4 | | :--| :-- | :-- |
5 | | getPower| 电量 |电量百分比|
6 | | getFixStatus| 获取定位状态 |0=无法定位;1=单点定位;5=浮点定位;4=固定定位|
7 | |getLatitude| 纬度 |单位:度|
8 | | getLongitude|经度 |单位:度|
9 | | getAltitude|海拔高 |单位:米|
10 | | getAltitudeCorr|高程异常值 |正常高=大地高-高程异常值|
11 | | getnSatsInView| 卫星数 |
12 | | getnSatsInUse| 参与解算的卫星数 |
13 | | getTime| 时间戳 |
14 | | getSpeed| 速度 |单位:米/秒|
15 | | getBearing| 速度方向 |
16 | | getAccuracy| 定位水平精度|单位:米|
17 | | getmVerticalAccuracy| 定位垂直精度|
18 | | gethDOP| hdop|
19 | | getvDOP| vdop|
20 | | getpDOP| pdop|
21 |
22 | ##### SatelliteInfo
23 | | 方法名 | 说明| 备注|
24 | | :--| :-- | :-- |
25 | | getType| 卫星类型|
26 | | getNSigs| 编号|
27 | | isUsed| 是否参与解算|
28 | | getCn0| 信噪比|
29 | | getElev| elev|
30 | | getAzi| azi|
31 | | getPrn| prn|
32 |
--------------------------------------------------------------------------------
/readme/errCode.md:
--------------------------------------------------------------------------------
1 | ## onError
2 |
3 | | 错误码 | 错误信息 |
4 | | --- | --- |
5 | | 1042 |账号启动失败|
6 | | 3101 |账号或密码错误|
7 | | 3102 |连接断开|
8 | | 1341 |网络错误|
9 | | 1342 |GGA超出服务范围|
10 | | 1343 |GGA格式错误|
11 | | 1344 |账号重复登录|
12 | | 1345 |SDK内部错误|
13 | | 1346 |服务端错误|
14 | | 1347 |NOSR服务停⽌|
15 | | 1348 |未知异常|
16 | | 1351 |网络错误|
17 | | 1352 |账号尚未绑定|
18 | | 1311 |网络错误|
19 | | 1312 |获取能力信息失败|
20 | | 1313 |能力需要手动激活|
21 | | 1314 |能力需要设备端激活|
22 | | 1315 |能力系统错误|
23 | | 1316 |账号未包含该能力|
24 | | 1317 |鉴权失败|
25 | | 1318 |无可用账号|
26 | | 1319 |需要手动绑定账号|
27 | | 1320 |账号正在绑定中|
28 | | 1321 |账号尚未绑定|
29 | | 1322 |账号已过期|
30 | | 1323 |账号数不够|
31 | | 1324 |当前账号不允许此操作|
32 | | 1325 |账号或秘钥错误|
33 | | 1326 |调⽤OPENAPI失败|
34 | | 1327 |OPENAPI响应报⽂错误|
35 | | 1331 |能⼒启动失败|
36 | | 2101 |设备只支持内置差分|
37 | | 1201 |差分服务无响应|
38 | | 1211 |网络错误|
39 | | 1212 |密码错误|
40 | | 1213 |账号过期|
41 | | 1214 |账号待激活|
42 | | 1215 |账号无效|
43 | | 1216 |服务端认证失败|
44 | | 1217 |ID错误|
45 | | 1218 |账号已登录|
46 | | 1219 |账号被禁用|
47 | | 1220 |挂载点无效|
48 | | 1221 |失败次数超限|
49 | | 1222 |服务覆盖,但无差分|
50 | | 1223 |DNS解析异常|
51 | | 1224 |账号池鉴权入参为空|
52 | | 1225 |频繁登录|
53 | | 1226 |登录类型错误|
54 | | 1227 |账号过期|
55 | | 1228 |Cors鉴权失败|
56 | | 1229 |设备ID无效|
57 | | 1230 |账号类型错误|
58 | | 1231 |SDK启动失败|
59 | | 2001 |Json解析异常|
60 | | 1111 |连接失败|
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | repositories {
3 | google()
4 | mavenCentral()
5 | gradlePluginPortal()
6 | maven { url 'https://jitpack.io' }
7 | }
8 | }
9 | dependencyResolutionManagement {
10 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
11 | repositories {
12 | google()
13 | mavenCentral()
14 | maven { url 'https://jitpack.io' }
15 | }
16 | }
17 | rootProject.name = "DeviceGithubSDK"
18 | include ':app'
19 | include ':devicelib'
20 |
--------------------------------------------------------------------------------