version:1.8

fix:应用数据统计
add:
This commit is contained in:
2021-12-25 16:39:43 +08:00
parent 7c3a035ca6
commit c9e72d00fb
7 changed files with 15 additions and 9 deletions

View File

@@ -230,6 +230,8 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
mPresenter.setJpushAlias();
//设置极光推送标签
mPresenter.setJpushTags();
Log.e(TAG, "netWorkIsRunning: " + netWorkIsRunning);
Log.e(TAG, "MainService.netWorkIsRunning: " + MainService.netWorkIsRunning);
if (loocked) {
iv_locked.setVisibility(View.VISIBLE);
iv_locked.setImageDrawable(getDrawable(R.drawable.locked));

View File

@@ -350,7 +350,10 @@ public class MainPresenter implements MainContact.Presenter {
}
lastSendMACTime = System.currentTimeMillis();
String macJson = (String) SPUtils.get(mContext, "macJson", "");
if (macJson.equals(JGYUtils.getInstance().getMacJson())) {
String jsonString = JGYUtils.getInstance().getMacJson();
// Log.e(TAG, "sendMACAddress: macJson = " + macJson);
// Log.e(TAG, "sendMACAddress: jsonString = " + jsonString);
if (macJson.equals(jsonString)) {
mView.sendMACFinish();
return;
}

View File

@@ -81,8 +81,6 @@ import okhttp3.Protocol;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.ResponseBody;
import retrofit2.CallAdapter;
import retrofit2.Converter;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;

View File

@@ -82,6 +82,8 @@ public class UrlAddress {
//上传log文件
public static final String UPLOAD_LOG_FILE = "And/uploadLogFile";
//获取公网IP
public static final String SHOUHU_CITYJSON = "http://pv.sohu.com/cityjson/";
//删除alias

View File

@@ -80,13 +80,13 @@ public class MainService extends Service implements MainContact.MainView, Networ
@Override
public void onDisconnected() {
Log.e("OnNetworkStatusChangedListener", "onDisconnected: ");
Log.e("OnNetworkStatusChanged", "onDisconnected: ");
ToastUtil.betaShow("网络断开连接");
}
@Override
public void onConnected(NetworkUtils.NetworkType networkType) {
Log.e("OnNetworkStatusChangedListener", "onConnected: ");
Log.e("OnNetworkStatusChanged", "onConnected: ");
runningTime = SystemClock.elapsedRealtime();
//直接获取数据
ToastUtil.betaShow("网络已连接");
@@ -643,6 +643,7 @@ public class MainService extends Service implements MainContact.MainView, Networ
@Override
public void setLockedState(boolean loocked) {
Log.e(TAG, "netWorkIsRunning: " + netWorkIsRunning);
//发送设备mac地址和信息
mPresenter.sendMACAddress();
//设置极光推送别名
@@ -651,7 +652,6 @@ public class MainService extends Service implements MainContact.MainView, Networ
mPresenter.setJpushTags();
if (loocked) {
ToastUtil.betaShow("设备已上锁");
Log.e(TAG, "setLockedState: " + netWorkIsRunning);
//上传APP信息
ApkUtils.getAppInfo(this);
SaveListUtils.getList();

View File

@@ -923,6 +923,7 @@ public class JGYUtils {
public void writeAppPackageList(Context context, String packageList) {
ApkUtils.addShortcut(context);
HashSet<String> packages = new HashSet<String>() {{
this.add(BuildConfig.APPLICATION_ID);
this.add(PackageNames.OLD_DEVICE_INFO);//设备信息
this.add(PackageNames.OLD_APPSTORE);//教管壹
this.add(PackageNames.DEVICE_INFO);
@@ -1843,7 +1844,7 @@ public class JGYUtils {
jsonObject.addProperty("store_version", Utils.getAPPVersionName(PackageNames.APPSTORE, mContext));
jsonObject.addProperty("desktop_version", Utils.getAPPVersionName("com.aoleyun.os", mContext));
jsonObject.addProperty("local_mac", Utils.getAndroid7MAC());
jsonObject.addProperty("wifi_status", Utils.obtainWifiInfo(mContext));
// jsonObject.addProperty("wifi_status", Utils.obtainWifiInfo(mContext));
jsonObject.addProperty("PN_ip", (String) SPUtils.get(mContext, "PublicIP", ""));
jsonObject.addProperty("LAN_ip", Utils.getIPAddress(mContext));
jsonObject.addProperty("bluetooth", Utils.getBluetoothList());