手机信息上报
This commit is contained in:
parent
c45e623a58
commit
8ba586c204
@ -21,7 +21,7 @@ public class AppInfoBean {
|
||||
private String macIpaddr = Settings.Secure.getString(App.getApp().getContentResolver(),Settings.Secure.ANDROID_ID);
|
||||
// private String macIpaddr = android.os.Build.ID;
|
||||
private String clientSource = "driver";
|
||||
private String status = "0";
|
||||
private String status = "";
|
||||
private String mobilePhoneManufacturerName = android.os.Build.BRAND;
|
||||
private String mobilePhoneProductName = android.os.Build.MODEL;
|
||||
private String mobilePhoneMotherboardName = android.os.Build.BOARD;
|
||||
|
@ -162,11 +162,16 @@ public class RequestConstant {
|
||||
|
||||
//车辆自动审核触发器
|
||||
private static final String CAR_AUDIT = "/app/carDriver/carAutomaticAudit";
|
||||
private static final String APP_INFO = "/common/app/logininfor";
|
||||
|
||||
public static String getCarAudit() {
|
||||
return BASE_URL + CAR_AUDIT;
|
||||
}
|
||||
|
||||
public static String postAppInfo() {
|
||||
return BASE_URL + APP_INFO;
|
||||
}
|
||||
|
||||
public static String getCarColor() {
|
||||
return BASE_URL + CAR_COLOR;
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ public class UserRequset {
|
||||
/**
|
||||
* 判断是否开启未知应用安装权限
|
||||
*/
|
||||
private void isOpenAppNoRe(){
|
||||
private void isOpenAppNoRe() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
boolean b = con.getPackageManager().canRequestPackageInstalls();
|
||||
if (!b) {
|
||||
@ -178,8 +178,8 @@ public class UserRequset {
|
||||
@RequiresApi(api = Build.VERSION_CODES.O)
|
||||
private void startInstallPermissionSettingActivity() {
|
||||
//注意这个是8.0新API
|
||||
Uri packageURI = Uri.parse("package:" +con.getPackageName());
|
||||
Intent intent = new Intent(Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES,packageURI);
|
||||
Uri packageURI = Uri.parse("package:" + con.getPackageName());
|
||||
Intent intent = new Intent(Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES, packageURI);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
con.startActivity(intent);
|
||||
}
|
||||
@ -230,13 +230,18 @@ public class UserRequset {
|
||||
public void carAudit(String carId) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("carId", carId);
|
||||
Request re = OkHttpUtil.get(new OkDate(RequestConstant.getCarAudit(),"get", Md5Util.resNoUrl(map)),getToken(con));
|
||||
Request re = OkHttpUtil.get(new OkDate(RequestConstant.getCarAudit(), "get", Md5Util.resNoUrl(map)), getToken(con));
|
||||
RequestUtil.start(1, VehicleAuthActivity.CAR_AUDIO, re, con, hd);
|
||||
}
|
||||
|
||||
public void putAppInfo(AppInfoBean appInfoBean){
|
||||
public void postAppInfo(AppInfoBean appInfoBean, String type) {
|
||||
// Request re = OkHttpUtil.get(new OkDate(RequestConstant.getCarAudit(),"get", gson.toJson(appInfoBean)),getToken(con));
|
||||
Request re = OkHttpUtil.post(new OkDate(RequestConstant.getCarAudit(),"post", gson.toJson(appInfoBean)),con);
|
||||
RequestUtil.start(1, VehicleAuthActivity.CAR_AUDIO, re, con, hd);
|
||||
Request re;
|
||||
if ("put".equals(type)) {
|
||||
re = OkHttpUtil.put(new OkDate(RequestConstant.postAppInfo(), type, gson.toJson(appInfoBean)), con);
|
||||
} else {
|
||||
re = OkHttpUtil.post(new OkDate(RequestConstant.postAppInfo(), type, gson.toJson(appInfoBean)), con);
|
||||
}
|
||||
RequestUtil.start(1, VehicleAuthActivity.APP_INFO, re, con, hd);
|
||||
}
|
||||
}
|
||||
|
@ -55,6 +55,7 @@ public class VehicleAuthActivity extends BaseAppCompatActivity {
|
||||
public String carId="";
|
||||
public static final String DEL_CAR="delete_che";
|
||||
public static final String CAR_AUDIO="CAR_AUDIO";
|
||||
public static final String APP_INFO="APP_INFO";
|
||||
private int submitIndex=0;
|
||||
private BaseBean bb;
|
||||
private ImageView show_img;
|
||||
|
@ -26,6 +26,7 @@ import android.widget.Toast;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.cardview.widget.CardView;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.AppInfoBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.ConfigParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.net.BaseObserver;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.net.DataManager;
|
||||
@ -96,15 +97,22 @@ public class LoginActivity extends BaseActivity {
|
||||
//存储登录记录
|
||||
loginBean = new Gson().fromJson(CacheGroup.cacheList.get(LOGIN_RESULT), LoginBean.class);
|
||||
Log.e("--登录信息--", new Gson().toJson(loginBean));
|
||||
AppInfoBean appInfoBean = new AppInfoBean();
|
||||
if (loginBean.getCode() == 200) {
|
||||
SPUtil.insSP(con, USER, USER_TOKEN, loginBean.getData().getToken());
|
||||
SPUtil.insSP(con, USER, USER_UNAME, loginBean.getData().getUname());
|
||||
SPUtil.insSP(con, USER, USER_RNAME, loginBean.getData().getRname());
|
||||
SPUtil.insSP(con, USER, USER_ID, loginBean.getData().getId() + "");
|
||||
JPushInterface.setAlias(con, 0, loginBean.getData().getUname());
|
||||
appInfoBean.setStatus("0");
|
||||
appInfoBean.setUserPhone(String.valueOf(input_phone.getText()));
|
||||
ur.postAppInfo(appInfoBean,"put");
|
||||
UiAuxiliary.homeRequest("登录成功");
|
||||
finish();
|
||||
} else {
|
||||
appInfoBean.setStatus("1");
|
||||
appInfoBean.setUserPhone(String.valueOf(input_phone.getText()));
|
||||
ur.postAppInfo(appInfoBean,"put");
|
||||
Toast.makeText(con, loginBean.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove(LOGIN_RESULT);
|
||||
|
@ -30,6 +30,7 @@ import androidx.core.app.ActivityCompat;
|
||||
|
||||
import com.alct.mdp.MDPLocationCollectionManager;
|
||||
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.AppInfoBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.ImageConfig;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.ConfigParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||
@ -160,6 +161,8 @@ public class WelcomeActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
ur.postAppInfo(new AppInfoBean(),"post");
|
||||
|
||||
// String[] permissions=new String[]{
|
||||
// Manifest.permission.ACCESS_FINE_LOCATION,
|
||||
// Manifest.permission.ACCESS_COARSE_LOCATION
|
||||
|
@ -81,6 +81,39 @@ public class OkHttpUtil {
|
||||
return request;
|
||||
}
|
||||
|
||||
public static Request put(OkDate od, Context con){
|
||||
MediaType mediaType = MediaType.parse("application/json");
|
||||
if(od.getMadiaType()!=null && od.getMadiaType().equals("")){
|
||||
od.setMadiaType("{}");
|
||||
}
|
||||
// JSONObject jsonObject = JSON.parseObject(od.getMadiaType());
|
||||
// jsonObject.put("timestamp", DateUtil.current());
|
||||
// jsonObject.put("deviceId", GetUtil.getDeviceId(con));
|
||||
// String sign = SecureUtil.signParamsSha1(jsonObject,SIGN_PASSWORD);
|
||||
// Log.e("jsonObject",jsonObject.toString());
|
||||
// Log.e("sign",sign);
|
||||
// Map<String,Object> map=new HashMap<>();
|
||||
// map.put("data",SecurityUtil.encrypt(jsonObject.toString()));
|
||||
// Log.e("参数1",od.getMadiaType());
|
||||
// Log.e("参数2",MapUtil.mapJson(map));
|
||||
//MapUtil.mapJson(map)
|
||||
RequestBody body = RequestBody.create(mediaType,od.getMadiaType());
|
||||
Headers.Builder hb=new Headers.Builder();
|
||||
hb.add("Content-Type","application/json");
|
||||
hb.add("Cache-Control","no-cache");
|
||||
Request request = new Request.Builder()
|
||||
.url(od.getUrl())
|
||||
.put(body)
|
||||
.headers(hb.build())
|
||||
.addHeader("Version", VersionUtil.getVersion(con))
|
||||
.addHeader("VersionCode",String.valueOf(AppUtils.getAppVersionCode()))
|
||||
//.addHeader("sign",sign)
|
||||
.removeHeader("User-Agent")
|
||||
.addHeader("User-Agent",GetUtil.getUserAgent(con))
|
||||
.build();
|
||||
return request;
|
||||
}
|
||||
|
||||
public static Request get(OkDate od){
|
||||
Headers.Builder hb=new Headers.Builder();
|
||||
hb.add("Content-Type","application/json");
|
||||
|
Loading…
Reference in New Issue
Block a user