@@ -174,6 +174,7 @@ dependencies { | |||
implementation project(':library:keyboard') | |||
// implementation files('libs/artc_guizhou-release_v1.0.aar') | |||
implementation files('libs\\GvBleObuSDK.jar') | |||
implementation files('libs\\artc-gbapi_v1.1.1.jar') | |||
implementation files('libs\\JLBleSDK-2024_03_20--15:14.jar') | |||
// implementation files('libs\\JLBleSDK-byd - 1.0.4-2024_03_20--15:14.jar') | |||
@@ -10,9 +10,9 @@ | |||
{ | |||
"type": "SINGLE", | |||
"filters": [], | |||
"versionCode": 1, | |||
"versionName": "1.0.0", | |||
"outputFile": "jz_app_v1.0.0_release_1205.apk" | |||
"versionCode": 2, | |||
"versionName": "1.0.1", | |||
"outputFile": "jz_app_v1.0.1_release_1217.apk" | |||
} | |||
] | |||
} |
@@ -257,7 +257,7 @@ public class MyRetrofit implements ToastAction { | |||
//加密 | |||
// parameters.setBizContent(SM4Utils.encryptCBC(parameters.getBizContent(), SM4_KEY)); | |||
new MyRetrofit().getRetrofitGZ(code).create(Api.class) | |||
.message2GZ(linkedTreeMap) | |||
.message3GZ(linkedTreeMap) | |||
.enqueue(new ConverterGZ<Result>(context, start, false, loadHint) { | |||
@Override | |||
protected void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { |
@@ -20,6 +20,7 @@ import android.widget.TextView; | |||
import androidx.recyclerview.widget.LinearLayoutManager; | |||
import androidx.recyclerview.widget.RecyclerView; | |||
import com.alibaba.fastjson.JSON; | |||
import com.hjq.base.BaseDialog; | |||
import com.huntersun.vky.obublelib.bean.DecryptVehicleApduBean; | |||
import com.huntersun.vky.obublelib.box.BoxManagers; | |||
@@ -28,6 +29,8 @@ import com.huntersun.vkyes.etcopencard.R; | |||
import com.huntersun.vkyes.etcopencard.project.api.bean.ResultBean; | |||
import com.huntersun.vkyes.etcopencard.project.tool.Utils; | |||
import com.huntersun.vkyes.etcopencard.project.ui.activity.ydplatform.bluetooth9901.BluetoothDialog9901; | |||
import com.huntersun.vkyes.etcopencard.project.ui.activity.ydplatform.bluetooth9901.bean.ServiceObject; | |||
import com.huntersun.vkyes.etcopencard.project.ui.activity.ydplatform.manager.CardObuCommandManager; | |||
import com.huntersun.vkyes.etcopencard.project.ui.adapter.DeviceAdapter; | |||
import com.huntersun.vkyes.etcopencard.src.action.ToastAction; | |||
import com.huntersun.vkyes.etcopencard.src.aop.SingleClick; | |||
@@ -67,8 +70,11 @@ public class BluetoothDialog { | |||
private final List<BluetoothDevice> list = new ArrayList<>();//数据来源 | |||
private OnResult mResult; | |||
private final BaseDialog mDialog; | |||
private final JLBydBleSDK jlBydBleSDK; | |||
private static JLBydBleSDK jlBydBleSDK; | |||
private BluetoothReceiver bluetoothReceiver; | |||
private int isPlk; | |||
private int JL= 0;//聚力 | |||
private int ATS= 1;//聚力 | |||
// private HandlerThread thread; | |||
// private Handler mBackgroundHandler; | |||
private final TextView mHintTextView; | |||
@@ -137,7 +143,7 @@ public class BluetoothDialog { | |||
} | |||
default void BluetoothLinkIsSuccessful9901(int code, JLBydBleSDK jlBydBleSDK) { | |||
default void BluetoothLinkIsSuccessful9901(int code) { | |||
} | |||
default void close() { | |||
@@ -319,8 +325,6 @@ public class BluetoothDialog { | |||
if (list.get(position).getName().startsWith("ETC")) { | |||
if (list.get(position).getName().contains("CTSK") || list.get(position).getName().contains("JL")) { | |||
new ConnectDeviceThread(list.get(position)).start(); | |||
}else{ | |||
connectDevice(plkCallBack, list.get(position)); | |||
} | |||
} else { | |||
connectDevice(plkCallBack, list.get(position)); | |||
@@ -365,43 +369,19 @@ public class BluetoothDialog { | |||
@Override | |||
public void run() { | |||
// if (d.getName().contains("ATS")){ | |||
// artcBleAPI.connectBleDev(d, new ArtcInterface.BleConnectCallBack() { | |||
// @Override | |||
// public void onFail(String s) { | |||
// | |||
// } | |||
// | |||
// @Override | |||
// public void onSuccess() { | |||
// mDialog.dismiss(); | |||
// artcBleAPI.getDeviceInfo("CC", new ArtcInterface.SendDevDataCallBack() { | |||
// @Override | |||
// public void onFail(String s) { | |||
// | |||
// } | |||
// | |||
// @Override | |||
// public void onSuccess(String s) { | |||
// Log.e("ATS艾特斯",s); | |||
// } | |||
// }); | |||
// } | |||
// }); | |||
// }else { | |||
jlBydBleSDK.connectDevice(d, resultStatus -> { | |||
//链接提示 | |||
autoDismiss(); | |||
if (resultStatus.getCode() == 0) { | |||
isPlk = JL; | |||
mDialog.dismiss(); | |||
mResult.BluetoothLinkIsSuccessful9901(resultStatus.getCode(), jlBydBleSDK); | |||
mResult.BluetoothLinkIsSuccessful9901(resultStatus.getCode()); | |||
} | |||
}, resultStatus -> { | |||
if (resultStatus.getCode() != 0) { | |||
// new Utils().showMessDialog(Context,resultStatus.getMsg()); | |||
} | |||
}); | |||
// } | |||
} | |||
} | |||
@@ -488,7 +468,17 @@ public class BluetoothDialog { | |||
} | |||
} | |||
} | |||
public static ServiceObject readCard(){ | |||
return JSON.parseObject(JSON.toJSONString(jlBydBleSDK.ccGetCardInformation().getServiceObject()), ServiceObject.class); | |||
} | |||
public static ServiceObject readObu(){ | |||
return JSON.parseObject(JSON.toJSONString(jlBydBleSDK.ccReadObuSystemInfo().getServiceObject()), ServiceObject.class); | |||
} | |||
public static Object readEncryptedInfo(){ | |||
return jlBydBleSDK.readObuCarInfo(CardObuCommandManager.getInstance().initJLSdk(jlBydBleSDK).getCarInfoOBURand()).getServiceObject(); | |||
} | |||
} | |||
} |
@@ -164,25 +164,25 @@ public class MainActivity extends AppActivity implements | |||
fragments.add(FragmentHomeThree.newInstance()); | |||
fragments.add(FragmentHomeFour.newInstance()); | |||
binding.vp.setAdapter(new VpAdapter(getSupportFragmentManager(), fragments)); | |||
requestPermission(); | |||
// requestPermission(); | |||
} | |||
private void requestPermission() { | |||
if (ActivityCompat.checkSelfPermission(this,Manifest.permission.BLUETOOTH_SCAN)!=PackageManager.PERMISSION_GRANTED | |||
||ActivityCompat.checkSelfPermission(this,Manifest.permission.BLUETOOTH_CONNECT)!=PackageManager.PERMISSION_GRANTED){ | |||
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.BLUETOOTH_SCAN,Manifest.permission.BLUETOOTH_CONNECT},111); | |||
} | |||
} | |||
@Override | |||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { | |||
super.onRequestPermissionsResult(requestCode, permissions, grantResults); | |||
if (requestCode == 111){ | |||
if (grantResults.length>0&&grantResults[0]==PackageManager.PERMISSION_GRANTED&&grantResults[1]==PackageManager.PERMISSION_GRANTED){ | |||
} | |||
} | |||
} | |||
// private void requestPermission() { | |||
// if (ActivityCompat.checkSelfPermission(this,Manifest.permission.BLUETOOTH_SCAN)!=PackageManager.PERMISSION_GRANTED | |||
// ||ActivityCompat.checkSelfPermission(this,Manifest.permission.BLUETOOTH_CONNECT)!=PackageManager.PERMISSION_GRANTED){ | |||
// ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.BLUETOOTH_SCAN,Manifest.permission.BLUETOOTH_CONNECT},111); | |||
// } | |||
// } | |||
// | |||
// @Override | |||
// public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { | |||
// super.onRequestPermissionsResult(requestCode, permissions, grantResults); | |||
// if (requestCode == 111){ | |||
// if (grantResults.length>0&&grantResults[0]==PackageManager.PERMISSION_GRANTED&&grantResults[1]==PackageManager.PERMISSION_GRANTED){ | |||
// | |||
// } | |||
// } | |||
// } | |||
@Override | |||
protected void initData() { |
@@ -21,6 +21,7 @@ import com.huntersun.vkyes.etcopencard.project.api.bean.EnumBean; | |||
import com.huntersun.vkyes.etcopencard.project.api.bean.IFCode; | |||
import com.huntersun.vkyes.etcopencard.project.api.bean.ResultBean; | |||
import com.huntersun.vkyes.etcopencard.project.api.bean.SendTheVerificationCodeBean; | |||
import com.huntersun.vkyes.etcopencard.project.bluetooth.BluetoothDialog; | |||
import com.huntersun.vkyes.etcopencard.project.dialog.MenuMailDialog; | |||
import com.huntersun.vkyes.etcopencard.project.tool.Utils; | |||
import com.huntersun.vkyes.etcopencard.project.ui.activity.ydplatform.bluetooth9901.bean.ServiceObject; | |||
@@ -75,12 +76,12 @@ public class FormDeliveryActivity extends AppActivity { | |||
} | |||
@Override | |||
public void success9901(JLBydBleSDK jlBydBleSDK) { | |||
public void success9901() { | |||
FormDeliveryActivity.this.post(new Runnable() { | |||
@Override | |||
public void run() { | |||
ServiceObject serviceObjectCard = JSON.parseObject(JSON.toJSONString(jlBydBleSDK.ccGetCardInformation().getServiceObject()), ServiceObject.class); | |||
ServiceObject serviceObjectObu = JSON.parseObject(JSON.toJSONString(jlBydBleSDK.ccReadObuSystemInfo().getServiceObject()), ServiceObject.class); | |||
ServiceObject serviceObjectCard = BluetoothDialog.Builder.readCard(); | |||
ServiceObject serviceObjectObu = BluetoothDialog.Builder.readObu(); | |||
binding.text3.setText(serviceObjectCard.cardId); //卡号 | |||
binding.text4.setText(serviceObjectObu.contractNo); //签号 | |||
binding.lyCardType.setVisibility(View.GONE); |
@@ -29,6 +29,7 @@ import com.huntersun.vkyes.etcopencard.project.api.Result; | |||
import com.huntersun.vkyes.etcopencard.project.api.bean.EnumBean; | |||
import com.huntersun.vkyes.etcopencard.project.api.bean.IFCode; | |||
import com.huntersun.vkyes.etcopencard.project.api.bean.ResultBean; | |||
import com.huntersun.vkyes.etcopencard.project.bluetooth.BluetoothDialog; | |||
import com.huntersun.vkyes.etcopencard.project.ui.activity.ydplatform.bluetooth9901.bean.ServiceObject; | |||
import com.huntersun.vkyes.etcopencard.project.ui.activity.ydplatform.manager.CardObuCommandManager; | |||
import com.huntersun.vkyes.etcopencard.project.ui.activity.ydplatform.ydCode.YdCode; | |||
@@ -149,12 +150,11 @@ public class InfoTabActivity extends AppActivity { | |||
} | |||
@Override | |||
public void success9901(JLBydBleSDK jlBydBleSDK) { | |||
Log.e("设备信息", JSON.toJSONString(jlBydBleSDK.getJLCardInformation()) + "~" + JSON.toJSONString(jlBydBleSDK.ccReadObuSystemInfo()) + "!!!~" + jlBydBleSDK.jlCardInfor1516mation()); | |||
public void success9901() { | |||
// //卡信息 | |||
ServiceObject serviceObjectCard = JSON.parseObject(JSON.toJSONString(jlBydBleSDK.ccGetCardInformation().getServiceObject()), ServiceObject.class); | |||
ServiceObject serviceObjectObu = JSON.parseObject(JSON.toJSONString(jlBydBleSDK.ccReadObuSystemInfo().getServiceObject()), ServiceObject.class); | |||
Object encryptedInfo = jlBydBleSDK.readObuCarInfo(CardObuCommandManager.getInstance().initJLSdk(jlBydBleSDK).getCarInfoOBURand()).getServiceObject(); | |||
ServiceObject serviceObjectCard = BluetoothDialog.Builder.readCard(); | |||
ServiceObject serviceObjectObu = BluetoothDialog.Builder.readObu(); | |||
Object encryptedInfo = BluetoothDialog.Builder.readEncryptedInfo(); | |||
Log.e("encryptedInfo~~~~~~~", encryptedInfo.toString()); | |||
InfoTabActivity.this.post(new Runnable() { | |||
@Override |
@@ -343,7 +343,7 @@ public abstract class AppActivity extends BaseActivity | |||
public interface Currency { | |||
void success(); | |||
default void success9901(JLBydBleSDK jlBydBleSDK){ | |||
default void success9901(){ | |||
} | |||
default void close() { | |||
@@ -386,9 +386,9 @@ public abstract class AppActivity extends BaseActivity | |||
* 9901蓝牙链接成功 | |||
*/ | |||
@Override | |||
public void BluetoothLinkIsSuccessful9901(int code,JLBydBleSDK jlBydBleSDK) { | |||
public void BluetoothLinkIsSuccessful9901(int code) { | |||
if (code==0){ | |||
currency.success9901(jlBydBleSDK); | |||
currency.success9901(); | |||
}else { | |||
currency.close(); | |||
} |
@@ -20,6 +20,8 @@ import androidx.multidex.MultiDexApplication; | |||
import com.alibaba.fastjson.JSONObject; | |||
import com.amap.api.location.AMapLocationClient; | |||
import com.artc.gbapi.ArtcCallBack.ArtcInitCallback; | |||
import com.artc.gbapi.invoke.ArtcObuManger; | |||
import com.google.gson.internal.LinkedTreeMap; | |||
import com.hjq.bar.TitleBar; | |||
import com.huntersun.vkyes.etcopencard.R; | |||
@@ -82,6 +84,18 @@ public class AppApplication extends MultiDexApplication { | |||
mInstance = this; | |||
initSdk(this); | |||
LiveEventBus.config().autoClear(true).lifecycleObserverAlwaysActive(true); | |||
//艾特斯SDK初始化 | |||
ArtcObuManger.InitSDK(getApplicationContext(), true, "ArtcLog", 5000, 15*1000, 10*1000, new ArtcInitCallback() { | |||
@Override | |||
public void onSuccess() { | |||
System.out.println("埃特斯SDK初始化成功"); | |||
} | |||
@Override | |||
public void onFail(int status, String err) { | |||
System.out.println(err+":"+status); | |||
} | |||
}); | |||
} | |||
@Override |
@@ -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" /> | |||
@@ -105,7 +104,6 @@ | |||
android:hint="@string/common_password_input_error" | |||
android:imeOptions="actionDone" | |||
android:maxLength="20" | |||
android:text="Ll11223344!" | |||
android:singleLine="true" | |||
tools:text="Huting123*" | |||
android:visibility="visible" /> |
@@ -9,8 +9,8 @@ android { | |||
// 目标适配版本 | |||
//noinspection ExpiredTargetSdkVersion,OldTargetApi | |||
targetSdkVersion 30 | |||
versionName '1.3.3' | |||
versionCode 1 | |||
versionName '1.0.1' | |||
versionCode 2 | |||
//当前线上版本 103 5 | |||
} | |||