From 2965dc60c703103c53f413226686cd3aca6881f4 Mon Sep 17 00:00:00 2001 From: Matthew Date: Tue, 16 Apr 2024 14:37:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E8=87=AA=E5=8A=A8=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E7=BD=91=E7=BB=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/xypower/mpmaster/AppMaster.java | 22 ++++++++++++++++--- .../com/xypower/mpmaster/MpMasterService.java | 9 ++++++-- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/mpmaster/src/main/java/com/xypower/mpmaster/AppMaster.java b/mpmaster/src/main/java/com/xypower/mpmaster/AppMaster.java index 1fb1470f..6b116a40 100644 --- a/mpmaster/src/main/java/com/xypower/mpmaster/AppMaster.java +++ b/mpmaster/src/main/java/com/xypower/mpmaster/AppMaster.java @@ -143,13 +143,13 @@ public class AppMaster { ex.printStackTrace(); } finally { try { - SysApi.selectSimCard4Data(mService.getApplicationContext(), 1); + if (!mService.isMntnMode()) { + SysApi.selectSimCard4Data(mService.getApplicationContext(), 1); + } } catch (Exception ex) { ex.printStackTrace(); } } - - } catch (Exception ex) { ex.printStackTrace(); } @@ -206,6 +206,13 @@ public class AppMaster { postParams.add(new Pair("oid", mService.getSerialNo())); postParams.add(new Pair("maintainVersion", mService.getMasterAppVersion())); + postParams.add(new Pair("simcard1", getSimcard(1))); + if (mService.isSeparateNetwork()) { + postParams.add(new Pair("simcard2", getSimcard(2))); + } + + postParams.add(new Pair("freeROM", getFreeROM())); + DBHandler dbHandler = null; try { dbHandler = new DBHandler(mService); @@ -290,6 +297,15 @@ public class AppMaster { return ""; } + private String getSimcard(int number) { + return (number == 1) ? SysApi.getImei(mService) : SysApi.getImei2(mService); + } + + private String getFreeROM() { + // return SysApi.get + return ""; + } + private void process(String content) { if (TextUtils.isEmpty(content)) { return; diff --git a/mpmaster/src/main/java/com/xypower/mpmaster/MpMasterService.java b/mpmaster/src/main/java/com/xypower/mpmaster/MpMasterService.java index 018a3e33..b4d8edc8 100644 --- a/mpmaster/src/main/java/com/xypower/mpmaster/MpMasterService.java +++ b/mpmaster/src/main/java/com/xypower/mpmaster/MpMasterService.java @@ -216,6 +216,10 @@ public class MpMasterService extends Service { return mSeparateNetwork; } + public boolean isMntnMode() { + return mMntnMode; + } + public void startMpApp() { try { final Context context = getApplicationContext(); @@ -304,8 +308,9 @@ public class MpMasterService extends Service { String masterUrl = MicroPhotoContext.DEFAULT_MASTER_URL; MicroPhotoContext.MasterConfig masterConfig = MicroPhotoContext.getMasterConfig(getApplicationContext()); - if (!TextUtils.isEmpty(masterConfig.getUrl())) { - masterUrl = masterConfig.getUrl(); + String url = masterConfig.getUrl(); + if (!TextUtils.isEmpty(url)) { + masterUrl = url; } MicroPhotoContext.AppConfig appConfig = MicroPhotoContext.getMpAppConfig(getApplicationContext());