"type": "SINGLE", | "type": "SINGLE", | ||||
"filters": [], | "filters": [], | ||||
"versionCode": 10, | "versionCode": 10, | ||||
"versionName": "1.0.7", | |||||
"outputFile": "KyushuETC1.0_v1.0.7_debug.apk" | |||||
"versionName": "1.0.8", | |||||
"outputFile": "KyushuETC1.0_v1.0.8_debug.apk" | |||||
} | } | ||||
] | ] | ||||
} | } |
import android.annotation.SuppressLint; | import android.annotation.SuppressLint; | ||||
import android.app.Activity; | import android.app.Activity; | ||||
import android.content.Context; | import android.content.Context; | ||||
import android.content.Intent; | |||||
import android.net.ConnectivityManager; | import android.net.ConnectivityManager; | ||||
import android.net.NetworkInfo; | import android.net.NetworkInfo; | ||||
import android.util.Log; | import android.util.Log; | ||||
import com.huntersun.vkyes.etcopencard.project.ui.adapter.DataTypeAdaptor; | import com.huntersun.vkyes.etcopencard.project.ui.adapter.DataTypeAdaptor; | ||||
import com.huntersun.vkyes.etcopencard.src.action.ToastAction; | import com.huntersun.vkyes.etcopencard.src.action.ToastAction; | ||||
import com.huntersun.vkyes.etcopencard.src.app.AppApplication; | import com.huntersun.vkyes.etcopencard.src.app.AppApplication; | ||||
import com.huntersun.vkyes.etcopencard.src.manager.ActivityManager; | |||||
import com.huntersun.vkyes.etcopencard.src.ui.activity.LoginActivity; | |||||
import com.huntersun.vkyes.etcopencard.src.ui.dialog.WaitDialog; | import com.huntersun.vkyes.etcopencard.src.ui.dialog.WaitDialog; | ||||
import org.jetbrains.annotations.NotNull; | import org.jetbrains.annotations.NotNull; | ||||
*/ | */ | ||||
public abstract class Converter<T extends Result> implements Callback<T>, ToastAction, HandlerAction { | public abstract class Converter<T extends Result> implements Callback<T>, ToastAction, HandlerAction { | ||||
private static final int CODE = 0; /*请求码*/ | private static final int CODE = 0; /*请求码*/ | ||||
private static final int CODE401 = 401; /*登录超时*/ | |||||
private static final int CODES = -1; /*请求码*/ | private static final int CODES = -1; /*请求码*/ | ||||
private Context context; | private Context context; | ||||
private Boolean start = false; | private Boolean start = false; | ||||
} | } | ||||
}, 0); | }, 0); | ||||
} | } | ||||
//解密 | |||||
// resultBean.setBizContent(SM4Utils.decryptCBC(resultBean.getBizContent(), MyRetrofit.SM4_KEY)); | |||||
if (start) { | if (start) { | ||||
onSuccess(resultBean, null); | onSuccess(resultBean, null); | ||||
} else { | } else { | ||||
resultBean.setBizContent(SM4Utils.decryptCBC(resultBean.getBizContent(),MyRetrofit.SM4_KEY)); | |||||
ResultBean.BizContent bizContent = | ResultBean.BizContent bizContent = | ||||
Gson().fromJson(String.valueOf(resultBean.getBizContent()), ResultBean.BizContent.class); | Gson().fromJson(String.valueOf(resultBean.getBizContent()), ResultBean.BizContent.class); | ||||
onSuccess(resultBean, bizContent); | onSuccess(resultBean, bizContent); | ||||
} | } | ||||
} else if (t.statusCode == CODE401) { //登录失效 | |||||
if (context != null) { | |||||
context.startActivity(new Intent().setClass(context, LoginActivity.class)); | |||||
// 进行内存优化,销毁除登录页之外的所有界面 | |||||
ActivityManager.getInstance().finishAllActivities(LoginActivity.class); | |||||
} else { | |||||
toast(t.errorMsg); | |||||
} | |||||
} else { | } else { | ||||
String err = t.errorMsg; | String err = t.errorMsg; | ||||
if ("Read timed out".equals(err)) { | if ("Read timed out".equals(err)) { |
public class MyRetrofit implements ToastAction { | public class MyRetrofit implements ToastAction { | ||||
//是否设置缓存 | //是否设置缓存 | ||||
private static final boolean Cache = false; | private static final boolean Cache = false; | ||||
private static final String Url = "192.168.100.63"; //222.85.144.89 | |||||
// private static final String Url = "192.168.100.63"; //8087 | |||||
private static final String Url = "222.85.144.89"; //19002 | |||||
public static final String PORT = "192.168.100.63".equals(Url) ? "8087" : "19002"; | |||||
public static final String Urls = "http://" + Url + ":" + PORT; | |||||
/** | /** | ||||
* 修改文件上传地址:VPN访问:192.168.101.145:6001、办公网络访问:222.85.144.89:19003 | * 修改文件上传地址:VPN访问:192.168.101.145:6001、办公网络访问:222.85.144.89:19003 | ||||
* 回显地址:222.85.144.89:19002/xxxxxx | * 回显地址:222.85.144.89:19002/xxxxxx | ||||
*/ | */ | ||||
private final String BaseUrl = "http://" + Url + ":8087/ifzt/api/"; //VPN访问请求地址 | |||||
private final String BaseUrl = "http://" + Url + ":" + PORT + "/ifzt/api/"; //VPN访问请求地址 8087 | |||||
private final String FileUrl = "http://" + Url + ":19003/ifzt/api/"; //文件服务 | private final String FileUrl = "http://" + Url + ":19003/ifzt/api/"; //文件服务 | ||||
public static final String URL_DOWNLOAD_FILE = "http://" + Url + ":19002/user-export-excel/";//通行流水下载路径前缀 | public static final String URL_DOWNLOAD_FILE = "http://" + Url + ":19002/user-export-excel/";//通行流水下载路径前缀 | ||||
public static final String URL_APP_IMG = "http://" + Url + ":19002/default-bucket/app/";//APP图标路径前缀 | public static final String URL_APP_IMG = "http://" + Url + ":19002/default-bucket/app/";//APP图标路径前缀 | ||||
public final static String SM4_KEY = "5dc11f854ceca147"; | public final static String SM4_KEY = "5dc11f854ceca147"; | ||||
loadHint = IFCode.LoadingMsgMap.get(code); | loadHint = IFCode.LoadingMsgMap.get(code); | ||||
} | } | ||||
//加密 | //加密 | ||||
parameters.setBizContent(SM4Utils.encryptCBC(parameters.getBizContent(), SM4_KEY)); | |||||
// parameters.setBizContent(SM4Utils.encryptCBC(parameters.getBizContent(), SM4_KEY)); | |||||
new MyRetrofit().getRetrofit().create(Api.class) | new MyRetrofit().getRetrofit().create(Api.class) | ||||
.message2(parameters) | .message2(parameters) | ||||
.enqueue(new Converter<Result>(context, start, loadHint) { | .enqueue(new Converter<Result>(context, start, loadHint) { |
*/ | */ | ||||
public class RequestParameters { | public class RequestParameters { | ||||
private final String ifCode; | private final String ifCode; | ||||
// private final String appId = "admin001"; | |||||
private final String appId = "52030131"; | |||||
private final String encryptType = "SM4"; | |||||
private final String appId = "admin001"; | |||||
// private final String appId = "52030131"; | |||||
private final String encryptType = "NONE"; | |||||
// private final String encryptType = "SM4"; | |||||
private final String signType = "MD5"; | private final String signType = "MD5"; | ||||
private String sign; | private String sign; | ||||
@SuppressLint("SimpleDateFormat") | @SuppressLint("SimpleDateFormat") |
private static final boolean HEX_STRING = false; | private static final boolean HEX_STRING = false; | ||||
private static final Pattern P = Pattern.compile("\\s*|\t|\r|\n"); | private static final Pattern P = Pattern.compile("\\s*|\t|\r|\n"); | ||||
; | |||||
/** | /** | ||||
* ECB模式加密 | * ECB模式加密 |
import android.content.Context; | import android.content.Context; | ||||
import android.content.Intent; | import android.content.Intent; | ||||
import android.content.IntentFilter; | import android.content.IntentFilter; | ||||
import android.media.Image; | |||||
import android.util.Log; | import android.util.Log; | ||||
import android.view.Gravity; | import android.view.Gravity; | ||||
import android.view.View; | import android.view.View; | ||||
import android.widget.ImageView; | |||||
import android.widget.LinearLayout; | import android.widget.LinearLayout; | ||||
import android.widget.TextView; | import android.widget.TextView; | ||||
import com.huntersun.vky.obublelib.box.BoxManagers; | import com.huntersun.vky.obublelib.box.BoxManagers; | ||||
import com.huntersun.vky.obublelib.constant.Constant; | import com.huntersun.vky.obublelib.constant.Constant; | ||||
import com.huntersun.vkyes.etcopencard.R; | import com.huntersun.vkyes.etcopencard.R; | ||||
import com.huntersun.vkyes.etcopencard.project.api.MyRetrofit; | |||||
import com.huntersun.vkyes.etcopencard.project.bluetooth.BluetoothReceiver; | import com.huntersun.vkyes.etcopencard.project.bluetooth.BluetoothReceiver; | ||||
import com.huntersun.vkyes.etcopencard.project.bluetooth.MethodManager; | import com.huntersun.vkyes.etcopencard.project.bluetooth.MethodManager; | ||||
import com.huntersun.vkyes.etcopencard.project.ui.adapter.DeviceAdapter; | import com.huntersun.vkyes.etcopencard.project.ui.adapter.DeviceAdapter; | ||||
import com.huntersun.vkyes.etcopencard.src.action.ToastAction; | import com.huntersun.vkyes.etcopencard.src.action.ToastAction; | ||||
import com.huntersun.vkyes.etcopencard.src.aop.SingleClick; | import com.huntersun.vkyes.etcopencard.src.aop.SingleClick; | ||||
import com.huntersun.vkyes.etcopencard.src.http.glide.GlideApp; | |||||
import com.huntersun.vkyes.etcopencard.src.ui.dialog.CommonDialog; | import com.huntersun.vkyes.etcopencard.src.ui.dialog.CommonDialog; | ||||
import java.util.ArrayList; | import java.util.ArrayList; | ||||
private final List<BluetoothDevice> list = new ArrayList<>();//数据来源 | private final List<BluetoothDevice> list = new ArrayList<>();//数据来源 | ||||
private BluetoothReceiver bluetoothReceiver; | private BluetoothReceiver bluetoothReceiver; | ||||
private LinearLayout scanDevices, scanCancel; | private LinearLayout scanDevices, scanCancel; | ||||
private final ImageView image, image1; | |||||
public Builder(Context context) { | public Builder(Context context) { | ||||
super(context); | super(context); | ||||
//扫描设备 扫描蓝牙按钮 | //扫描设备 扫描蓝牙按钮 | ||||
scanDevices = findViewById(R.id.scan_devices); | scanDevices = findViewById(R.id.scan_devices); | ||||
scanCancel = findViewById(R.id.scan_cancel); | scanCancel = findViewById(R.id.scan_cancel); | ||||
image = findViewById(R.id.type1); | |||||
image1 = findViewById(R.id.type2); | |||||
scanDevices.setOnClickListener(this); | scanDevices.setOnClickListener(this); | ||||
scanCancel.setOnClickListener(this); | scanCancel.setOnClickListener(this); | ||||
GlideApp.with(Context).load(MyRetrofit.Urls + "/default-bucket/image/index/icon-car.png").into(image); | |||||
GlideApp.with(Context).load(MyRetrofit.Urls + "/default-bucket/image/index/icon-truck.png").into(image1); | |||||
//隐藏确认关闭框 | //隐藏确认关闭框 | ||||
mShuView.setVisibility(View.GONE); | mShuView.setVisibility(View.GONE); | ||||
mSelect.setVisibility(View.GONE); | mSelect.setVisibility(View.GONE); |
getEnumList(); | getEnumList(); | ||||
} | } | ||||
/* 获取枚举值 */ | /* 获取枚举值 */ | ||||
private void getEnumList(){ | private void getEnumList(){ | ||||
MyRetrofit.newInstance(IFCode.IFCODE_ENUM, new ResultBean.BizContent<>(), new MyRetrofit.ReturnResult() { | MyRetrofit.newInstance(IFCode.IFCODE_ENUM, new ResultBean.BizContent<>(), new MyRetrofit.ReturnResult() { |
/** | /** | ||||
* Date :2023-03-31 | * Date :2023-03-31 | ||||
* Description:菜单Item列表adapter | * Description:菜单Item列表adapter | ||||
* @author admin | |||||
*/ | */ | ||||
public class MenuListItemAdapter extends BaseQuickAdapter<ResultBean.BizContent, BaseViewHolder> { | public class MenuListItemAdapter extends BaseQuickAdapter<ResultBean.BizContent, BaseViewHolder> { | ||||
private Context mContext; | private Context mContext; |
} | } | ||||
BaseQuickAdapter<ResultBean.BizContent, BaseViewHolder> adapter | |||||
= new BaseQuickAdapter<ResultBean.BizContent, BaseViewHolder>(R.layout.item_list_content) { | |||||
@SuppressLint("LogNotTimber") | |||||
@Override | |||||
protected void convert(BaseViewHolder helper, ResultBean.BizContent item) { | |||||
} | |||||
}; | |||||
//VALIDITY validity | |||||
@Override | @Override | ||||
@SingleClick | @SingleClick | ||||
public void onClick(View view) { | public void onClick(View view) { |
binding.etSearch.addTextChangedListener(new BaseTextWatcher() { | binding.etSearch.addTextChangedListener(new BaseTextWatcher() { | ||||
@Override | @Override | ||||
public void onTextChanged(CharSequence s, int start, int before, int count) { | public void onTextChanged(CharSequence s, int start, int before, int count) { | ||||
super.onTextChanged(s, start, before, count); | super.onTextChanged(s, start, before, count); | ||||
filterList(s.toString()); | filterList(s.toString()); | ||||
} | } |
android:orientation="vertical"> | android:orientation="vertical"> | ||||
<ImageView | <ImageView | ||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:src="@mipmap/person" /> | |||||
android:id="@+id/type1" | |||||
android:layout_width="@dimen/dp_60" | |||||
android:layout_height="@dimen/dp_60" | |||||
android:src="@mipmap/v_type1" /> | |||||
<TextView | <TextView | ||||
android:layout_width="match_parent" | android:layout_width="match_parent" | ||||
android:orientation="vertical"> | android:orientation="vertical"> | ||||
<ImageView | <ImageView | ||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:id="@+id/type2" | |||||
android:layout_width="@dimen/dp_60" | |||||
android:layout_height="@dimen/dp_60" | |||||
android:src="@mipmap/unit" /> | android:src="@mipmap/unit" /> | ||||
<TextView | <TextView |
android:layout_height="@dimen/dp_20" | android:layout_height="@dimen/dp_20" | ||||
android:src="@mipmap/phone" /> | android:src="@mipmap/phone" /> | ||||
<!--15764350434--> | |||||
<com.hjq.widget.view.ClearEditText | <com.hjq.widget.view.ClearEditText | ||||
android:id="@+id/et_login_phone" | android:id="@+id/et_login_phone" | ||||
style="@style/EditTextStyle" | style="@style/EditTextStyle" | ||||
android:background="@null" | android:background="@null" | ||||
android:hint="@string/common_phone_input_hint" | android:hint="@string/common_phone_input_hint" | ||||
android:inputType="phone" | android:inputType="phone" | ||||
android:text="15764350434" | |||||
tools:text="15764350434" | |||||
app:regexType="mobile" /> | app:regexType="mobile" /> | ||||
</LinearLayout> | </LinearLayout> | ||||
android:imeOptions="actionDone" | android:imeOptions="actionDone" | ||||
android:maxLength="20" | android:maxLength="20" | ||||
android:singleLine="true" | android:singleLine="true" | ||||
android:text="Huting123*" | |||||
tools:text="Huting123*" | |||||
android:visibility="visible" /> | android:visibility="visible" /> | ||||
<LinearLayout | <LinearLayout | ||||
android:id="@+id/mGetCodeBtn" | android:id="@+id/mGetCodeBtn" | ||||
style="@style/WrapWrap" | style="@style/WrapWrap" | ||||
android:layout_height="@dimen/dp_25" | android:layout_height="@dimen/dp_25" | ||||
android:paddingLeft="@dimen/dp_8" | |||||
android:paddingRight="@dimen/dp_8" | |||||
android:layout_gravity="right|center" | android:layout_gravity="right|center" | ||||
android:background="@drawable/bg_border_green_radius" | android:background="@drawable/bg_border_green_radius" | ||||
android:enabled="true" | android:enabled="true" | ||||
android:foreground="?attr/selectableItemBackground" | android:foreground="?attr/selectableItemBackground" | ||||
android:paddingLeft="@dimen/dp_8" | |||||
android:paddingRight="@dimen/dp_8" | |||||
android:text="获取验证码" | android:text="获取验证码" | ||||
android:textColor="@color/common_accent_color" | android:textColor="@color/common_accent_color" | ||||
android:textSize="@dimen/sp_12" /> | android:textSize="@dimen/sp_12" /> | ||||
<com.hjq.widget.view.CountdownView | <com.hjq.widget.view.CountdownView | ||||
android:id="@+id/cv_phone_reset_countdown" | android:id="@+id/cv_phone_reset_countdown" | ||||
style="@style/CountdownViewStyle" | style="@style/CountdownViewStyle" | ||||
android:visibility="gone" | |||||
android:layout_marginEnd="0dp" | android:layout_marginEnd="0dp" | ||||
android:paddingVertical="@dimen/dp_10" /> | |||||
android:paddingVertical="@dimen/dp_10" | |||||
android:visibility="gone" /> | |||||
</LinearLayout> | </LinearLayout> | ||||
// 目标适配版本 | // 目标适配版本 | ||||
//noinspection OldTargetApi | //noinspection OldTargetApi | ||||
targetSdkVersion 30 | targetSdkVersion 30 | ||||
versionName '1.0.7' | |||||
versionName '1.0.8' | |||||
versionCode 10 | versionCode 10 | ||||
} | } | ||||