@@ -11,8 +11,8 @@ | |||
"type": "SINGLE", | |||
"filters": [], | |||
"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" | |||
} | |||
] | |||
} |
@@ -3,6 +3,7 @@ package com.huntersun.vkyes.etcopencard.project.api; | |||
import android.annotation.SuppressLint; | |||
import android.app.Activity; | |||
import android.content.Context; | |||
import android.content.Intent; | |||
import android.net.ConnectivityManager; | |||
import android.net.NetworkInfo; | |||
import android.util.Log; | |||
@@ -18,6 +19,8 @@ import com.huntersun.vkyes.etcopencard.project.tool.Utils; | |||
import com.huntersun.vkyes.etcopencard.project.ui.adapter.DataTypeAdaptor; | |||
import com.huntersun.vkyes.etcopencard.src.action.ToastAction; | |||
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 org.jetbrains.annotations.NotNull; | |||
@@ -34,6 +37,7 @@ import retrofit2.Response; | |||
*/ | |||
public abstract class Converter<T extends Result> implements Callback<T>, ToastAction, HandlerAction { | |||
private static final int CODE = 0; /*请求码*/ | |||
private static final int CODE401 = 401; /*登录超时*/ | |||
private static final int CODES = -1; /*请求码*/ | |||
private Context context; | |||
private Boolean start = false; | |||
@@ -96,14 +100,23 @@ public abstract class Converter<T extends Result> implements Callback<T>, ToastA | |||
} | |||
}, 0); | |||
} | |||
//解密 | |||
// resultBean.setBizContent(SM4Utils.decryptCBC(resultBean.getBizContent(), MyRetrofit.SM4_KEY)); | |||
if (start) { | |||
onSuccess(resultBean, null); | |||
} else { | |||
resultBean.setBizContent(SM4Utils.decryptCBC(resultBean.getBizContent(),MyRetrofit.SM4_KEY)); | |||
ResultBean.BizContent bizContent = | |||
Gson().fromJson(String.valueOf(resultBean.getBizContent()), ResultBean.BizContent.class); | |||
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 { | |||
String err = t.errorMsg; | |||
if ("Read timed out".equals(err)) { |
@@ -46,13 +46,18 @@ import retrofit2.converter.scalars.ScalarsConverterFactory; | |||
public class MyRetrofit implements ToastAction { | |||
//是否设置缓存 | |||
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 | |||
* 回显地址: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/"; //文件服务 | |||
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 final static String SM4_KEY = "5dc11f854ceca147"; | |||
@@ -92,7 +97,7 @@ public class MyRetrofit implements ToastAction { | |||
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) | |||
.message2(parameters) | |||
.enqueue(new Converter<Result>(context, start, loadHint) { |
@@ -13,9 +13,10 @@ import java.util.Date; | |||
*/ | |||
public class RequestParameters { | |||
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 String sign; | |||
@SuppressLint("SimpleDateFormat") |
@@ -23,7 +23,6 @@ public class SM4Utils implements EncryptParent { | |||
private static final boolean HEX_STRING = false; | |||
private static final Pattern P = Pattern.compile("\\s*|\t|\r|\n"); | |||
; | |||
/** | |||
* ECB模式加密 |
@@ -7,9 +7,11 @@ import android.content.BroadcastReceiver; | |||
import android.content.Context; | |||
import android.content.Intent; | |||
import android.content.IntentFilter; | |||
import android.media.Image; | |||
import android.util.Log; | |||
import android.view.Gravity; | |||
import android.view.View; | |||
import android.widget.ImageView; | |||
import android.widget.LinearLayout; | |||
import android.widget.TextView; | |||
@@ -19,11 +21,13 @@ import androidx.recyclerview.widget.RecyclerView; | |||
import com.huntersun.vky.obublelib.box.BoxManagers; | |||
import com.huntersun.vky.obublelib.constant.Constant; | |||
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.MethodManager; | |||
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; | |||
import com.huntersun.vkyes.etcopencard.src.http.glide.GlideApp; | |||
import com.huntersun.vkyes.etcopencard.src.ui.dialog.CommonDialog; | |||
import java.util.ArrayList; | |||
@@ -49,6 +53,7 @@ public class PersonalCompanyDialog { | |||
private final List<BluetoothDevice> list = new ArrayList<>();//数据来源 | |||
private BluetoothReceiver bluetoothReceiver; | |||
private LinearLayout scanDevices, scanCancel; | |||
private final ImageView image, image1; | |||
public Builder(Context context) { | |||
super(context); | |||
@@ -57,8 +62,12 @@ public class PersonalCompanyDialog { | |||
//扫描设备 扫描蓝牙按钮 | |||
scanDevices = findViewById(R.id.scan_devices); | |||
scanCancel = findViewById(R.id.scan_cancel); | |||
image = findViewById(R.id.type1); | |||
image1 = findViewById(R.id.type2); | |||
scanDevices.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); | |||
mSelect.setVisibility(View.GONE); |
@@ -113,8 +113,6 @@ public class MainActivity extends AppActivity implements | |||
getEnumList(); | |||
} | |||
/* 获取枚举值 */ | |||
private void getEnumList(){ | |||
MyRetrofit.newInstance(IFCode.IFCODE_ENUM, new ResultBean.BizContent<>(), new MyRetrofit.ReturnResult() { |
@@ -17,6 +17,7 @@ import androidx.annotation.NonNull; | |||
/** | |||
* Date :2023-03-31 | |||
* Description:菜单Item列表adapter | |||
* @author admin | |||
*/ | |||
public class MenuListItemAdapter extends BaseQuickAdapter<ResultBean.BizContent, BaseViewHolder> { | |||
private Context mContext; |
@@ -92,15 +92,7 @@ public class FragmentHomeOne extends TitleBarFragment<MainActivity> implements V | |||
} | |||
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 | |||
@SingleClick | |||
public void onClick(View view) { |
@@ -93,7 +93,6 @@ public class FragmentHomeTow extends TitleBarFragment<MainActivity> { | |||
binding.etSearch.addTextChangedListener(new BaseTextWatcher() { | |||
@Override | |||
public void onTextChanged(CharSequence s, int start, int before, int count) { | |||
super.onTextChanged(s, start, before, count); | |||
filterList(s.toString()); | |||
} |
@@ -27,9 +27,10 @@ | |||
android:orientation="vertical"> | |||
<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 | |||
android:layout_width="match_parent" | |||
@@ -57,8 +58,9 @@ | |||
android:orientation="vertical"> | |||
<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" /> | |||
<TextView |
@@ -64,6 +64,7 @@ | |||
android:layout_height="@dimen/dp_20" | |||
android:src="@mipmap/phone" /> | |||
<!--15764350434--> | |||
<com.hjq.widget.view.ClearEditText | |||
android:id="@+id/et_login_phone" | |||
style="@style/EditTextStyle" | |||
@@ -72,7 +73,7 @@ | |||
android:background="@null" | |||
android:hint="@string/common_phone_input_hint" | |||
android:inputType="phone" | |||
android:text="15764350434" | |||
tools:text="15764350434" | |||
app:regexType="mobile" /> | |||
</LinearLayout> | |||
@@ -102,7 +103,7 @@ | |||
android:imeOptions="actionDone" | |||
android:maxLength="20" | |||
android:singleLine="true" | |||
android:text="Huting123*" | |||
tools:text="Huting123*" | |||
android:visibility="visible" /> | |||
<LinearLayout | |||
@@ -130,12 +131,12 @@ | |||
android:id="@+id/mGetCodeBtn" | |||
style="@style/WrapWrap" | |||
android:layout_height="@dimen/dp_25" | |||
android:paddingLeft="@dimen/dp_8" | |||
android:paddingRight="@dimen/dp_8" | |||
android:layout_gravity="right|center" | |||
android:background="@drawable/bg_border_green_radius" | |||
android:enabled="true" | |||
android:foreground="?attr/selectableItemBackground" | |||
android:paddingLeft="@dimen/dp_8" | |||
android:paddingRight="@dimen/dp_8" | |||
android:text="获取验证码" | |||
android:textColor="@color/common_accent_color" | |||
android:textSize="@dimen/sp_12" /> | |||
@@ -143,9 +144,9 @@ | |||
<com.hjq.widget.view.CountdownView | |||
android:id="@+id/cv_phone_reset_countdown" | |||
style="@style/CountdownViewStyle" | |||
android:visibility="gone" | |||
android:layout_marginEnd="0dp" | |||
android:paddingVertical="@dimen/dp_10" /> | |||
android:paddingVertical="@dimen/dp_10" | |||
android:visibility="gone" /> | |||
</LinearLayout> | |||
@@ -9,7 +9,7 @@ android { | |||
// 目标适配版本 | |||
//noinspection OldTargetApi | |||
targetSdkVersion 30 | |||
versionName '1.0.7' | |||
versionName '1.0.8' | |||
versionCode 10 | |||
} | |||