Browse Source

跳转

master
lujin 5 months ago
parent
commit
cc519edd7c

+ 3
- 1
app/build.gradle View File

@@ -172,12 +172,14 @@ dependencies {
implementation project(':library:obublelib')
//车牌键盘
implementation project(':library:keyboard')
implementation "androidx.work:work-runtime-ktx:2.6.0"
// implementation files('libs/artc_guizhou-release_v1.0.aar')
implementation files('libs\\GvBleObuSDK.jar')
implementation files('libs/WXGuiZhou_v2.2.jar')
implementation files('libs/WXGuiZhou_v4.0.jar')
implementation files('libs/KCHTBleSDK-release-V20250107.jar')
implementation files('libs\\artc-gbapi_v1.1.1.jar')
implementation files('libs\\JLBleSDK-2024_03_20--15:14.jar')
implementation files('libs/WJ_BLESDK_ANDROID_GZ_QZ_V1.0.1_20240509.jar')
// implementation files('libs\\JLBleSDK-byd - 1.0.4-2024_03_20--15:14.jar')

// 权限请求框架:https://github.com/getActivity/XXPermissions

+ 0
- 18
app/debug/output-metadata.json View File

@@ -1,18 +0,0 @@
{
"version": 2,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.huntersun.vkyes.etcopencard",
"variantName": "processDebugResources",
"elements": [
{
"type": "SINGLE",
"filters": [],
"versionCode": 34,
"versionName": "1.3.4",
"outputFile": "jz_app_v1.3.4_debug.apk"
}
]
}

BIN
app/libs/GvBleObuSDK.jar View File


BIN
app/libs/WJ_BLESDK_ANDROID_GZ_QZ_V1.0.1_20240509.jar View File


BIN
app/libs/WXGuiZhou_v2.2.jar View File


BIN
app/libs/WXGuiZhou_v4.0.jar View File


+ 3
- 3
app/release/output-metadata.json View File

@@ -10,9 +10,9 @@
{
"type": "SINGLE",
"filters": [],
"versionCode": 1,
"versionName": "1.3.3",
"outputFile": "jz_app_v1.3.3_release_0110.apk"
"versionCode": 6,
"versionName": "1.0.4",
"outputFile": "jz_app_v1.0.4_release_0314.apk"
}
]
}

+ 1113
- 1110
app/src/main/AndroidManifest.xml
File diff suppressed because it is too large
View File


+ 133
- 51
app/src/main/java/com/huntersun/vkyes/etcopencard/project/bluetooth/BluetoothDialog.java View File

@@ -20,8 +20,13 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.artc.gbapi.ArtcCallBack.ArtcInterface;
import com.artc.gbapi.invoke.ArtcObuManger;
import com.genvict.ble.sdk.callback.OnConnectCallback;
import com.genvict.ble.sdk.manager.entity.GvApiResult;
import com.genvict.ble.sdk.manager.impl.ObuInterface;
import com.hjq.base.BaseDialog;
import com.huntersun.vky.obublelib.box.BoxManagers;
import com.huntersun.vky.obublelib.util.UtilTool;
@@ -40,6 +45,11 @@ import com.kcht.obublesdk.bleChannelLib.doneBleLib.exception.BleException;
import com.kcht.obublesdk.region.guizhou.EnableState;
import com.kcht.obublesdk.region.guizhou.KcBleSDK;
import com.kcht.obublesdk.region.guizhou.ScanDeviceResultCallBack;
import com.wanji.lw.etc.bean.DataResult;
import com.wanji.lw.etc.bean.callBack;
import com.wanji.lw.etc.bean.listenStatus;
import com.wanji.lw.etc.bean.success;
import com.wanji.lw.etc.service.WJBleAPI;
import com.wuxian.wxsdk.BleManager;
import com.wuxian.wxsdk.bean.Result;
import com.wuxian.wxsdk.callback.ConnectionCallBack;
@@ -64,8 +74,7 @@ import jl.obu.com.obu.area.biyadi.ResultStatus;
*/
public class BluetoothDialog {

public static final class Builder
extends CommonDialog.Builder<Builder> implements ToastAction {
public static final class Builder extends CommonDialog.Builder<Builder> implements ToastAction {
private final Activity Context;
private final LinearLayout loadingLay;//加载布局
private final RecyclerView rv;//蓝牙设备展示列表
@@ -78,6 +87,8 @@ public class BluetoothDialog {
private static ArtcObuManger artcObuManger;
private static BleManager wxBleManager;
private static KcBleSDK kcBleSDK;
private static WJBleAPI wJBleAPI;
private static ObuInterface obuInterface;
private BluetoothReceiver bluetoothReceiver;
private static int isPlk;
public static int HS_JL = 0;//恒生聚力
@@ -85,6 +96,8 @@ public class BluetoothDialog {
public static int JL = 2;//聚力
public static int WX = 3;//无线感测
public static int KC = 4;//科场
public static int WJ = 5;//万集
public static int JY = 6;//金溢
// private HandlerThread thread;
// private Handler mBackgroundHandler;
private final TextView mHintTextView;
@@ -116,6 +129,8 @@ public class BluetoothDialog {
artcObuManger = ArtcObuManger.getInstance(context);
wxBleManager = BleManager.getInstance(context);
kcBleSDK = new KcBleSDK(context);
wJBleAPI = WJBleAPI.getInstance(context);
obuInterface = ObuInterface.getInstance(context);
// artcBleAPI = ArtcBleAPI.getInstance(context);
//加载动画
loadingLay = findViewById(R.id.loading_lay);
@@ -129,10 +144,7 @@ public class BluetoothDialog {
// thread.start();
// mBackgroundHandler = new Handler(thread.getLooper());
rv = findViewById(R.id.rv);
mDialog = new WaitDialog.Builder(context)
.setCancelable(false)
.setMessage("蓝牙设备连接中...")
.create();
mDialog = new WaitDialog.Builder(context).setCancelable(false).setMessage("蓝牙设备连接中...").create();
//隐藏确认关闭框
mShuView.setVisibility(View.GONE);
mSelect.setVisibility(View.GONE);
@@ -227,17 +239,17 @@ public class BluetoothDialog {
mDialog.dismiss();
}

public void showDialog(){
if (null!=mDialog&&!mDialog.isShowing()){
public void showDialog() {
if (null != mDialog && !mDialog.isShowing()) {
mDialog.show();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
if (null!=mDialog&&mDialog.isShowing()){
if (null != mDialog && mDialog.isShowing()) {
mDialog.dismiss();
}
}
},30000);
}, 30000);
}
}

@@ -288,8 +300,7 @@ public class BluetoothDialog {
if ("0".equals(s2 + "")) {
String strStatus = MethodManager.ReadCard();//获取卡信息

Log.e("okhttp", "卡对象信息:" + BoxManagers.mCardInfoBean.getCard_No() +
"OBU号:" + status + "车辆信息:" + BoxManagers.mDecryptVehicleBean);
Log.e("okhttp", "卡对象信息:" + BoxManagers.mCardInfoBean.getCard_No() + "OBU号:" + status + "车辆信息:" + BoxManagers.mDecryptVehicleBean);
mResult.BluetoothLinkIsSuccessful(BoxManagers.gerBoxManager()); //回调成功
autoDismiss();
}
@@ -345,7 +356,7 @@ public class BluetoothDialog {
BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
if (!list.contains(device)) {//防止重复添加
if (device.getName() != null) {//过滤掉设备名称为null的设备
Log.e("设备名称",device.getName());
Log.e("设备名称", device.getName());
for (String item : deviceWith) { //过滤掉不是指定名称的设备
if (device.getName().startsWith(item)) {
list.add(device);
@@ -368,7 +379,7 @@ public class BluetoothDialog {
// @Override
// public void run() {
if (list.size() > 0) {
if (list.get(position).getName().startsWith("ETC")) {
if (list.get(position).getName().startsWith("ETC") || list.get(position).getName().startsWith("JY")) {
new ConnectDeviceThread(list.get(position)).start();
} else {
connectDevice(plkCallBack, list.get(position));
@@ -448,57 +459,97 @@ public class BluetoothDialog {
mResult.BluetoothLinkIsSuccessful9901(0, isPlk);
}
});
}else if (d.getName().contains("WX")){
} else if (d.getName().contains("WX")) {
autoDismiss();
Log.e("WX开始链接","~~~~~~"+d.getAddress()+"~~~~~~~");
Log.e("WX开始链接", "~~~~~~" + d.getAddress() + "~~~~~~~");
wxBleManager.connectWXDevice(d, new ConnectionCallBack() {
@Override
public void call(Result result) {
Log.e("WX链接结果","~~~~~~"+JSON.toJSONString(result)+"~~~~~~~");
Log.e("WX链接结果", "~~~~~~" + JSON.toJSONString(result) + "~~~~~~~");
isPlk = WX;
mDialog.dismiss();
mResult.BluetoothLinkIsSuccessful9901(result.getCode(),isPlk);
mResult.BluetoothLinkIsSuccessful9901(result.getCode(), isPlk);
}
});
// artcObuManger.connectBleDev(d, new ArtcInterface.BleConnectCallBack() {
// @Override
// public void onFail(String s) {
//
// }
//
// @Override
// public void onSuccess() {
// isPlk = WX;
// mDialog.dismiss();
// mResult.BluetoothLinkIsSuccessful9901(0, isPlk);
// }
// });
}else if (d.getName().contains("KC")){
} else if (d.getName().contains("KC")) {
autoDismiss();
Log.e("KC链接","~~~~~~开始连接~~~~~~~");
Log.e("KC链接", "~~~~~~开始连接~~~~~~~");
kcBleSDK.connectDevice(d, new com.kcht.obublesdk.region.guizhou.Callback() {
@Override
public void onResult(com.kcht.obublesdk.region.guizhou.ResultStatus resultStatus) {
if (resultStatus.getCode() == 0){
if (resultStatus.getCode() == 0) {
isPlk = KC;
mDialog.dismiss();
mResult.BluetoothLinkIsSuccessful9901(0,isPlk);
Log.e("KC链接", "连接成功");
mResult.BluetoothLinkIsSuccessful9901(0, isPlk);
}
}
}, new com.kcht.obublesdk.region.guizhou.Callback() {
@Override
public void onResult(com.kcht.obublesdk.region.guizhou.ResultStatus resultStatus) {
if (resultStatus.getCode() == 0){
if (resultStatus.getCode() == 0) {
isPlk = KC;
mDialog.dismiss();
mResult.BluetoothLinkIsSuccessful9901(0,isPlk);
mResult.BluetoothLinkIsSuccessful9901(0, isPlk);
}
}
});
} else if (d.getName().contains("WJ")) {
autoDismiss();
Log.e("WJ链接", "~~~~~~开始连接~~~~~~~");
wJBleAPI.connectDevice(d, new success() {
@Override
public void onSuccess(com.wanji.lw.etc.bean.Result result) {
if (result.getCode() == 0) {
isPlk = WJ;
mDialog.dismiss();
mResult.BluetoothLinkIsSuccessful9901(result.getCode(), isPlk);
}
}
}, new listenStatus() {
@Override
public void onListenStatus(com.wanji.lw.etc.bean.Result result) {
if (result.getCode() == 0) {
isPlk = WJ;
mDialog.dismiss();
mResult.BluetoothLinkIsSuccessful9901(result.getCode(), isPlk);
}
}
});
} else if (d.getName().contains("JY")) {
autoDismiss();
obuInterface.connectDevice(d + "", mOnConnectCallback);
}
}
}

/**
* 蓝牙连接状态回调 replace
*/
private final OnConnectCallback mOnConnectCallback = new OnConnectCallback() {
@Override
public void onConnected() {
// baseDialog.show();
// activationProcess();
Log.e("金溢", "连接成功");
isPlk = JY;
mDialog.dismiss();
mResult.BluetoothLinkIsSuccessful9901(0, isPlk);
}

@Override
public void onDisconnect() {
Log.e("金溢", "断开连接");
mDialog.dismiss();
}

@Override
public void onConnectFail(GvApiResult result) {
Log.e("金溢", "连接失败:" + result.getCode() + " " + result.getMsg());
mDialog.dismiss();
}
};

/**
* 广播接收器(蓝牙模块)
* https://blog.csdn.net/wq892373445/article/details/119748130
@@ -639,14 +690,15 @@ public class BluetoothDialog {
/**
* 获取随机数
*/
public static void getObuRandom(PerformCmdCallBack callBack){
transCmd(sendCos4,"20",callBack);
public static void getObuRandom(PerformCmdCallBack callBack) {
transCmd(sendCos4, "20", callBack);
}

/**
* 指令执行
*/
public static void transCmd(String[] cmdArray, String cmdType, PerformCmdCallBack callBack) {
Log.e("运行指令",JSONObject.toJSONString(cmdArray));
if (isPlk == ATS) {
artcObuManger.transCommand(cmdType.equals("10") ? 0 : 1, cmdArray, new ArtcInterface.SendDataCallBack() {
@Override
@@ -656,7 +708,7 @@ public class BluetoothDialog {

@Override
public void onSuccess(String[] data) {
Log.e("艾特斯执行指令",JSON.toJSONString(cmdArray)+"~~执行结果~~"+JSON.toJSONString(data));
Log.e("艾特斯执行指令", JSON.toJSONString(cmdArray) + "~~执行结果~~" + JSON.toJSONString(data));
callBack.performOnSuccess(data);
}
});
@@ -665,25 +717,56 @@ public class BluetoothDialog {
@Override
public void onResult(ResultStatus resultStatus) {
Log.e("聚力读OBU", "读取合同序列号成功:" + JSON.toJSONString(resultStatus.getData()));
Log.e("聚力执行指令",JSON.toJSONString(cmdArray)+"~~执行结果~~"+JSON.toJSONString(resultStatus.getData()));
Log.e("聚力执行指令", JSON.toJSONString(cmdArray) + "~~执行结果~~" + JSON.toJSONString(resultStatus.getData()));
callBack.performOnSuccess(resultStatus.getData());
}
});
}else if (isPlk == WX){
Result result = wxBleManager.sendApdu(TextUtils.join(",",cmdArray),"10".equals(cmdType) ? 1 : 2);
Log.e("无线感测执行结果",JSON.toJSONString(result));
if (result.getCode() == 0){
callBack.performOnSuccess(result.getData().split(","));
}
}else if (isPlk == KC){
} else if (isPlk == WX) {
Log.e("无线感测执行", "指令~" + TextUtils.join(",", cmdArray));
Log.e("无线感测执行", "单条指令~" +cmdArray[0] + "~~~"+("10".equals(cmdType) ? 1 : 2));
Result result = wxBleManager.sendApdu(cmdArray[0], "10".equals(cmdType) ? 1 : 2);
Log.e("无线感测执行结果", JSON.toJSONString(result));
if (true)return;
if (result.getCode() == 0) {
callBack.performOnSuccess(result.getData().split(","));
}
} else if (isPlk == KC) {
kcBleSDK.transCmd(cmdArray, cmdType, new com.kcht.obublesdk.region.guizhou.Callback() {
@Override
public void onResult(com.kcht.obublesdk.region.guizhou.ResultStatus resultStatus) {
if (resultStatus.getCode() == 0){
if (resultStatus.getCode() == 0) {
Log.e("指令执行成功", "指令~~" + JSONObject.toJSONString(cmdArray) + "执行结果" + JSONObject.toJSONString(resultStatus.getData()));
callBack.performOnSuccess(resultStatus.getData());
}
}
});
} else if (isPlk == WJ) {
wJBleAPI.transCmd(cmdArray, cmdType, new callBack() {
@Override
public void onCallBack(DataResult dataResult) {
if (dataResult.code == 0) {
Log.e("指令执行成功", "指令~~" + JSONObject.toJSONString(cmdArray) + "执行结果" + JSONObject.toJSONString(dataResult));
callBack.performOnSuccess(dataResult.data);
} else {
Log.e("指令执行失败", "指令~~" + JSONObject.toJSONString(cmdArray) + "执行结果" + JSONObject.toJSONString(dataResult));
}
}
});
} else if (isPlk == JY) {
String[] cmds = cmdArray.clone();
if (cmdType.equals("10")) {
com.genvict.ble.sdk.manager.entity.ServiceStatus s = obuInterface.cardCommand(cmds);
if (s.getCode() == 0) {
Log.e("执行结果", "指令" + JSONObject.toJSONString(cmdArray) + "结果::::" + JSONObject.toJSONString(s.getData()));
callBack.performOnSuccess(JSONObject.parseArray(JSONObject.toJSONString(s.getData())).toArray(new String[0]));
}
} else {
com.genvict.ble.sdk.manager.entity.ServiceStatus s = obuInterface.esamCommand(cmds);
if (s.getCode() == 0) {
Log.e("执行结果", "指令" + JSONObject.toJSONString(cmdArray) + "结果::::" + JSONObject.toJSONString(s.getData()));
callBack.performOnSuccess(JSONObject.parseArray(JSONObject.toJSONString(s.getData())).toArray(new String[0]));
}
}
}
}

@@ -742,8 +825,7 @@ public class BluetoothDialog {
obuReadInfoBean.startTime = data[1].substring(36, 44);
obuReadInfoBean.endTime = data[1].substring(44, 52);
obuReadInfoBean.version = Integer.parseInt(data[1].substring(18, 19)) >= 4 ? "4x" : "2x";
obuReadInfoBean.isJH = "1".equals(data[1].substring(53, 54)) ? "是" : "0".equals(data[1].substring(53, 54)) ?
"否" : "其他:" + data[1].substring(53, 54);
obuReadInfoBean.isJH = "1".equals(data[1].substring(53, 54)) ? "是" : "0".equals(data[1].substring(53, 54)) ? "否" : "其他:" + data[1].substring(53, 54);
obuReadInfoBean.rand = Integer.parseInt(data[1].substring(18, 20)) > 50 ? "40" : "00";
}
return obuReadInfoBean;

+ 9
- 3
app/src/main/java/com/huntersun/vkyes/etcopencard/project/ui/activity/IdentityInformationUploadActivity.java View File

@@ -943,7 +943,9 @@ public class IdentityInformationUploadActivity extends AppActivity {
} catch (ParseException e) {
e.printStackTrace();
}
} else {
} else if ("长期".equals(bizContent.getEnddate())){
setText(binding.text5, bizContent.getEnddate());
}else{
toast("未识别出证件有效时间");
return;
}
@@ -966,7 +968,9 @@ public class IdentityInformationUploadActivity extends AppActivity {
} catch (ParseException e) {
e.printStackTrace();
}
} else {
}else if ("长期".equals(bizContent.getEnddate())){
setText(binding.text8, bizContent.getEnddate());
}else{
toast("未识别出证件有效时间");
return;
}
@@ -999,7 +1003,9 @@ public class IdentityInformationUploadActivity extends AppActivity {
} catch (ParseException e) {
e.printStackTrace();
}
} else {
}else if ("长期".equals(bizContent.getEnddate())){
setText(binding.text15, bizContent.getEnddate());
}else{
toast("未识别出证件有效时间");
return;
}

+ 1
- 0
app/src/main/java/com/huntersun/vkyes/etcopencard/project/ui/activity/mail/InfoTabActivity.java View File

@@ -199,6 +199,7 @@ public class InfoTabActivity extends AppActivity {
}
});
}else{
Log.e("isPlk1111",isPlk+"");
InfoTabActivity.this.post(new Runnable() {
@Override
public void run() {

+ 2
- 0
app/src/main/java/com/huntersun/vkyes/etcopencard/src/ui/dialog/UpdateDialog.java View File

@@ -14,6 +14,7 @@ import android.view.View;
import android.widget.ProgressBar;
import android.widget.TextView;

import androidx.annotation.RequiresApi;
import androidx.core.app.NotificationCompat;
import androidx.core.content.FileProvider;

@@ -237,6 +238,7 @@ public final class UpdateDialog {
.setProgress(100, 100, false)
// 设置通知点击之后的意图
.setContentIntent(PendingIntent.getActivity(getContext(), 1, getInstallIntent(), Intent.FILL_IN_ACTION))
// .setContentIntent(PendingIntent.getActivity(getContext(), 1, getInstallIntent(), PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE))
// 设置点击通知后是否自动消失
.setAutoCancel(true)
// 是否正在交互中

+ 1
- 0
app/src/main/res/layout/activity_identity_information_upload.xml View File

@@ -726,6 +726,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:background="@color/white"
android:drawablePadding="@dimen/dp_15"
android:hint="请选择过期时间"

+ 0
- 2
app/src/main/res/layout/login_activity.xml View File

@@ -74,7 +74,6 @@
android:background="@null"
android:hint="@string/common_phone_input_hint"
android:inputType="phone"
android:text="15329905570"
tools:text="15764350434"
app:regexType="mobile" />

@@ -106,7 +105,6 @@
android:imeOptions="actionDone"
android:maxLength="20"
android:singleLine="true"
android:text="Ll11223344@"
tools:text="Huting123*"
android:visibility="visible" />


+ 2
- 2
common.gradle View File

@@ -9,8 +9,8 @@ android {
// 目标适配版本
//noinspection ExpiredTargetSdkVersion,OldTargetApi
targetSdkVersion 30
versionName '1.3.3'
versionCode 1
versionName '1.0.4'
versionCode 6
//当前线上版本 103 5
}


+ 2
- 0
library/obublelib/build.gradle View File

@@ -48,6 +48,8 @@ dependencies {
implementation files('libs/readerle_lib.jar')
implementation files('libs/transmissionlib.jar')
implementation files('libs/ObuSDK_GuiZhou_14f2d591_20180326.jar')
// implementation files('libs/GvBleObuSDK.jar')
// implementation "androidx.work:work-runtime-ktx:2.6.0"
implementation files('libs/wanjiobu_guizhou_V1.0.6.jar')



+ 2
- 0
library/obublelib/src/main/java/com/huntersun/vky/obublelib/box/BoxManagers.java View File

@@ -232,6 +232,7 @@ public class BoxManagers implements ResponseListener {
} catch (InterruptedException e) {
e.printStackTrace();
}

obuInterface.initialize(mContext);
}
}
@@ -811,6 +812,7 @@ public class BoxManagers implements ResponseListener {
} else if (isPlk == JY || isPlk == LC) {
//金益
com.genvict.obusdk.data.ServiceStatus _ss = obuInterface.cosCommand((byte) 0x2, cmd);
// com.genvict.ble.sdk.manager.entity.ServiceStatus _ss = obuInterface.esamCommand(new String[]{cmd});
result = getJYss(cmd, _ss);
} else if (isPlk == WJ || isPlk == ZZ) {
//万集

+ 2
- 1
library/umeng/src/main/AndroidManifest.xml View File

@@ -46,7 +46,8 @@
android:name="com.tencent.tauth.AuthActivity"
android:launchMode="singleTask"
android:noHistory="true"
tools:node="replace">
tools:node="replace"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />


Loading…
Cancel
Save