version:zhanrui 6.3.8,MTK 2.3.8

fix:
update:接口优化,主页优化,心跳机制优化
This commit is contained in:
2023-02-06 19:08:49 +08:00
parent 4371ae3059
commit 93f87d3b68
50 changed files with 2399 additions and 1358 deletions

View File

@@ -282,7 +282,7 @@ public class AesCbcWithIntegrity {
aesCipherForEncryption.init(Cipher.ENCRYPT_MODE, secretKeys.getConfidentialityKey(), new IvParameterSpec(iv));
/*
* Now we get back the IV that will actually be used. Some Android
* Now we get bt_return the IV that will actually be used. Some Android
* versions do funny stuff w/ the IV, so this is to work around bugs:
*/
iv = aesCipherForEncryption.getIV();

View File

@@ -427,7 +427,6 @@ public class ApkUtils {
ToastUtil.show("正在安装应用");
install(packageInstaller, sessionId, context);
}
}
}
@@ -447,7 +446,6 @@ public class ApkUtils {
}
}
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
private static int createSession(PackageInstaller packageInstaller, PackageInstaller.SessionParams sessionParams) {
int sessionId = -1;

View File

@@ -51,6 +51,7 @@ import com.aoleyun.sn.comm.CommonConfig;
import com.aoleyun.sn.comm.JGYActions;
import com.aoleyun.sn.comm.PackageNames;
import com.aoleyun.sn.disklrucache.CacheHelper;
import com.aoleyun.sn.gson.GsonUtils;
import com.aoleyun.sn.network.NetInterfaceManager;
import com.aoleyun.sn.network.UrlAddress;
import com.aoleyun.sn.receiver.BootReceiver;
@@ -94,6 +95,7 @@ import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Executor;
import java.util.function.Consumer;
import java.util.function.Predicate;
@@ -107,6 +109,7 @@ public class JGYUtils {
@SuppressLint("StaticFieldLeak")
private static JGYUtils sInstance;
private MMKV mMMKV = MMKV.defaultMMKV();
private Context mContext;
private ContentResolver crv;
@@ -136,6 +139,7 @@ public class JGYUtils {
this.mContext = context;
this.crv = context.getContentResolver();
this.cacheHelper = new CacheHelper(context);
initConnectedTimeCache();
}
public static void init(Context context) {
@@ -2165,7 +2169,7 @@ public class JGYUtils {
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("PN_ip", MMKV.defaultMMKV().decodeString(NetInterfaceManager.PublicIP, ""));
jsonObject.addProperty("PN_ip", mMMKV.decodeString(NetInterfaceManager.PublicIP, ""));
jsonObject.addProperty("LAN_ip", Utils.getIPAddress(mContext));
jsonObject.addProperty("bluetooth", Utils.getBluetoothList());
jsonObject.addProperty("wifi_name", Utils.getWifiAlias(mContext));
@@ -2370,4 +2374,43 @@ public class JGYUtils {
//true为打开false为关闭
return powerManager.isInteractive();
}
private static final String CONNECTED_TIME_KEY = "connectedTimeKey";
private List<Long> connectedTime;
private void initConnectedTimeCache() {
String jsonString = cacheHelper.getAsString(CONNECTED_TIME_KEY);
Gson gson = new Gson();
Type listType = new TypeToken<List<Long>>() {
}.getType();
List<Long> longList = gson.fromJson(jsonString, listType);
if (longList == null) {
connectedTime = new ArrayList<>();
} else {
connectedTime = longList;
}
}
public List<Long> getNetworkConnectedTime() {
Log.e(TAG, "getNetworkConnectedTime: " + connectedTime);
return connectedTime;
}
public void addNetworkConnectedTime(Long time) {
Log.e(TAG, "addNetworkConnectedTime: " + time);
connectedTime.add(time);
cacheHelper.put(CONNECTED_TIME_KEY, GsonUtils.toJSONString(connectedTime));
}
public void removeNetworkConnectedTime(List<Long> time) {
if (time == null || time.size() == 0) {
return;
}
List<Long> copy = new ArrayList<>(time);
for (Long l : copy) {
connectedTime.remove(l);
}
cacheHelper.put(CONNECTED_TIME_KEY, GsonUtils.toJSONString(connectedTime));
}
}

View File

@@ -271,7 +271,7 @@ public class StatusBarUtil {
decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
} else {
// We want to change tint color to white again.
// You can also record the flags in advance so that you can turn UI back completely if
// You can also record the flags in advance so that you can turn UI bt_return completely if
// you have set other flags before, such as translucent or full screen.
decor.setSystemUiVisibility(0);
}

View File

@@ -1755,20 +1755,6 @@ public class Utils {
return "获取失败";
}
/**
* 获取公网IP并保存
*
* @param context
*/
public static void getPublicIP(Context context) {
NetInterfaceManager.getPublicIP(new NetInterfaceManager.PublicIP() {
@Override
public void set(String ip) {
Log.e("getPublicIP", "set: " + ip);
}
});
}
/**
* 获取WiFi信号强度
*