version:1.2.6

fix:
update:修复闪退,优化定位小数问题
This commit is contained in:
2026-03-13 16:02:10 +08:00
parent 7e2b3f5165
commit 9978687c29
7 changed files with 32 additions and 17 deletions

View File

@@ -17,8 +17,8 @@ android {
minSdkVersion 23
targetSdkVersion 29
versionCode 26
versionName "1.2.5"
versionCode 27
versionName "1.2.6"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

View File

@@ -943,10 +943,20 @@ public class HomeActivity extends BaseMvvmActivity<HomeViewModel, ActivityHomeBi
private void sendNotification() {
if (!ServiceUtils.isServiceRunning(MainService.class)) {
startService(new Intent(HomeActivity.this, MainService.class));
Intent intent = new Intent(HomeActivity.this, MainService.class);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
startForegroundService(intent);
} else {
startService(intent);
}
}
if (!ServiceUtils.isServiceRunning(SocketService.class)) {
startService(new Intent(HomeActivity.this, SocketService.class));
Intent intent = new Intent(HomeActivity.this, SocketService.class);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
startForegroundService(intent);
} else {
startService(intent);
}
}
}

View File

@@ -163,13 +163,13 @@ public class UserActivity extends BaseMvvmActivity<UserViewModel, ActivityUserBi
mViewModel.mAppUpdateInfoData.observe(this, new Observer<AppInfo>() {
@Override
public void onChanged(AppInfo appUpdateInfo) {
if (appUpdateInfo == null) {
public void onChanged(AppInfo appInfo) {
if (appInfo == null) {
// Toaster.show("已是最新版本");
} else {
if (ApkUtils.isUpdate(UserActivity.this, appUpdateInfo)) {
if (ApkUtils.isUpdate(UserActivity.this, appInfo)) {
Intent intent = new Intent(UserActivity.this, UpdateActivity.class);
intent.putExtra("appUpdateInfo", appUpdateInfo);
intent.putExtra("appInfo", appInfo);
startActivity(intent);
Toaster.show("有新的版本需要更新");
} else {

View File

@@ -94,7 +94,7 @@ public class BaseApplication extends Application {
AdminManager.init(this);
CrashReport.initCrashReport(getApplicationContext(), "4efcaad4c9", false);
CrashReport.initCrashReport(getApplicationContext(), "4d42cfdef5", false);
CrashReport.setDeviceId(BaseApplication.this, AdminManager.getInstance().getSerial());
// 初始化 Toast 框架

View File

@@ -53,13 +53,13 @@ public class DeviceFragment extends BaseMvvmFragment<DeviceViewModel, FragmentDe
protected void initData(Bundle savedInstanceState) {
mViewModel.mAppUpdateInfoData.observe(this, new Observer<AppInfo>() {
@Override
public void onChanged(AppInfo appUpdateInfo) {
if (appUpdateInfo == null) {
public void onChanged(AppInfo appInfo) {
if (appInfo == null) {
Toaster.show("已是最新版本");
} else {
if (ApkUtils.isUpdate(mContext, appUpdateInfo)) {
if (ApkUtils.isUpdate(mContext, appInfo)) {
Intent intent = new Intent(mContext, UpdateActivity.class);
intent.putExtra("appUpdateInfo", appUpdateInfo);
intent.putExtra("appInfo", appInfo);
startActivity(intent);
Toaster.show("有新的版本需要更新");
} else {

View File

@@ -24,6 +24,7 @@ import com.xwad.os.network.NetInterfaceManager;
import com.xwad.os.utils.ActivationUtil;
import java.lang.reflect.Type;
import java.math.BigDecimal;
import io.reactivex.rxjava3.annotations.NonNull;
import io.reactivex.rxjava3.core.Observer;
@@ -235,8 +236,8 @@ public class AmapManager {
private void saveMapResult(MapBean mapBean) {
Log.e(TAG, "saveMapResult: " + GsonUtils.toJSONString(mapBean));
mMMKV.encode(CommonConfig.MAP_LOCATION_JSON_KEY, GsonUtils.toJSONString(mapBean));
mMMKV.encode(CommonConfig.MAP_LONGITUDE_KEY, mapBean.getLongitude());
mMMKV.encode(CommonConfig.MAP_LATITUDE_KEY, mapBean.getLatitude());
mMMKV.encode(CommonConfig.MAP_LONGITUDE_KEY, doubleToStringExact(mapBean.getLongitude()));
mMMKV.encode(CommonConfig.MAP_LATITUDE_KEY, doubleToStringExact(mapBean.getLatitude()));
mMMKV.encode(CommonConfig.MAP_ADDRESS_KEY, mapBean.getAddress());
mMMKV.encode(CommonConfig.MAP_PROVINCE_KEY, mapBean.getProvince());
mMMKV.encode(CommonConfig.MAP_CITY_KEY, mapBean.getCity());
@@ -245,4 +246,8 @@ public class AmapManager {
mMMKV.encode(CommonConfig.MAP_LOCATION_DESCRIBE_KEY, mapBean.getLocationDescribe());
}
public static String doubleToStringExact(double value) {
// 使用 BigDecimal 避免科学计数法
return new BigDecimal(Double.toString(value)).toPlainString();
}
}

View File

@@ -251,7 +251,7 @@ public class ManagerService extends Service implements NetworkUtils.OnNetworkSta
if (!isServiceRunning) {
startService(new Intent(this, MainService.class));
}
bindService(new Intent(this, MainService.class), mServiceConnection, Context.BIND_IMPORTANT);
// bindService(new Intent(this, MainService.class), mServiceConnection, Context.BIND_IMPORTANT);
PushServiceFactory.getPushControlService().setConnectionChangeListener(new PushControlService.ConnectionChangeListener() {
@Override
@@ -802,7 +802,7 @@ public class ManagerService extends Service implements NetworkUtils.OnNetworkSta
soundPool.release();
soundPool = null;
}
unbindService(mServiceConnection);
// unbindService(mServiceConnection);
}
}