Ver código fonte

android crm 1.18 更换图标和app框架

Ray Zhang 5 anos atrás
pai
commit
38ca0a58f4
27 arquivos alterados com 440 adições e 41 exclusões
  1. 3 3
      ApexDrivers/apexcrm/build.gradle
  2. 12 6
      ApexDrivers/apexcrm/src/main/AndroidManifest.xml
  3. BIN
      ApexDrivers/apexcrm/src/main/ic_launcher-playstore.png
  4. 5 5
      ApexDrivers/apexcrm/src/main/java/com/usai/apex/apexcrm/MainActivity.java
  5. 5 1
      ApexDrivers/apexcrm/src/main/java/com/usai/apex/apexcrm/RAWebView.java
  6. 327 0
      ApexDrivers/apexcrm/src/main/java/com/usai/apex/apexcrm/application/RACRMApp.java
  7. 12 12
      ApexDrivers/apexcrm/src/main/java/com/usai/apex/apexcrm/dataProvider/DataProvider.java
  8. 7 7
      ApexDrivers/apexcrm/src/main/java/com/usai/apex/apexcrm/receiver/AlarmReceiver.java
  9. 4 3
      ApexDrivers/apexcrm/src/main/java/com/usai/apex/apexcrm/receiver/BootReceiver.java
  10. 3 3
      ApexDrivers/apexcrm/src/main/java/com/usai/apex/apexcrm/service/CRMService.java
  11. 61 0
      ApexDrivers/apexcrm/src/main/java/com/usai/apex/apexcrm/service/CRMService3.java
  12. BIN
      ApexDrivers/apexcrm/src/main/res/mipmap-hdpi/ic_launcher.png
  13. BIN
      ApexDrivers/apexcrm/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
  14. BIN
      ApexDrivers/apexcrm/src/main/res/mipmap-hdpi/ic_launcher_round.png
  15. BIN
      ApexDrivers/apexcrm/src/main/res/mipmap-mdpi/ic_launcher.png
  16. BIN
      ApexDrivers/apexcrm/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
  17. BIN
      ApexDrivers/apexcrm/src/main/res/mipmap-mdpi/ic_launcher_round.png
  18. BIN
      ApexDrivers/apexcrm/src/main/res/mipmap-xhdpi/ic_launcher.png
  19. BIN
      ApexDrivers/apexcrm/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
  20. BIN
      ApexDrivers/apexcrm/src/main/res/mipmap-xhdpi/ic_launcher_round.png
  21. BIN
      ApexDrivers/apexcrm/src/main/res/mipmap-xxhdpi/ic_launcher.png
  22. BIN
      ApexDrivers/apexcrm/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
  23. BIN
      ApexDrivers/apexcrm/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
  24. BIN
      ApexDrivers/apexcrm/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  25. BIN
      ApexDrivers/apexcrm/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
  26. BIN
      ApexDrivers/apexcrm/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
  27. 1 1
      ApexDrivers/apexcrm/src/main/res/values/ic_launcher_background.xml

+ 3 - 3
ApexDrivers/apexcrm/build.gradle

@@ -17,7 +17,7 @@ android {
         minSdkVersion 24
         targetSdkVersion 29
         versionCode 3
-        versionName "1.17.45771"
+        versionName "1.18.45771"
         ndk.abiFilters 'armeabi-v7a',"arm64-v8a"
 //        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
 
@@ -48,8 +48,8 @@ android {
 
 dependencies {
 //    implementation fileTree(include: ['*.jar'], dir: 'libs')
-    api 'androidx.appcompat:appcompat:1.1.0'
-    api 'androidx.constraintlayout:constraintlayout:1.1.3'
+    api 'androidx.appcompat:appcompat:1.2.0'
+    api 'androidx.constraintlayout:constraintlayout:2.0.1'
 //    testImplementation 'junit:junit:4.12'
 //    androidTestImplementation 'com.android.support.test:runner:1.0.2'
 //    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

+ 12 - 6
ApexDrivers/apexcrm/src/main/AndroidManifest.xml

@@ -20,7 +20,8 @@
     <uses-permission android:name="android.permission.VIBRATE" />
 
     <application
-        android:name=".application.ApexCRMApp"
+        android:requestLegacyExternalStorage="true"
+        android:name=".application.RACRMApp"
         android:allowBackup="true"
         android:icon="@mipmap/ic_launcher"
         android:label="@string/app_name"
@@ -44,13 +45,18 @@
 
         <!-- Service -->
         <!--android:directBootAware="true"-->
-        <service android:name=".service.CRMService"
-                 android:enabled="true"
-                 android:exported="true"
+<!--        <service android:name=".service.CRMService"-->
+<!--                 android:enabled="true"-->
+<!--                 android:exported="true"-->
+
+<!--                 android:label="ApexCRM Background Service"-->
+<!--            />-->
+        <service android:name=".service.CRMService3"
+            android:enabled="true"
+            android:exported="false"
 
-                 android:label="ApexCRM Background Service"
+            android:label="ApexCRM Background Service"
             />
-
         <!-- Receiver -->
         <!--android:directBootAware="true"-->
         <receiver android:name=".receiver.AlarmReceiver"

BIN
ApexDrivers/apexcrm/src/main/ic_launcher-playstore.png


+ 5 - 5
ApexDrivers/apexcrm/src/main/java/com/usai/apex/apexcrm/MainActivity.java

@@ -35,7 +35,7 @@ import android.widget.ProgressBar;
 import android.widget.RelativeLayout;
 import android.widget.Toast;
 
-import com.usai.apex.apexcrm.application.ApexCRMApp;
+import com.usai.apex.apexcrm.application.RACRMApp;
 import com.usai.apex.apexcrm.dataProvider.DataProvider;
 import com.usai.redant.rautils.actionsheet.ActionSheet;
 import com.usai.redant.rautils.calendar_event.CalendarEventManager;
@@ -1418,12 +1418,12 @@ public void QueryLaunchNotification(String msg) {
 
         @Override
         public void Login(String user, String password) {
-            ApexCRMApp.sharedCRM().login(user, password);
+            RACRMApp.sharedCRM().login(user, password);
         }
 
         @Override
         public void Logout() {
-            ApexCRMApp.sharedCRM().logout();
+            RACRMApp.sharedCRM().logout();
         }
     };
 
@@ -1572,8 +1572,8 @@ public void QueryLaunchNotification(String msg) {
         if (TextUtils.isEmpty(notificationstr)) {
             return;
         }
-        String user = ApexCRMApp.sharedCRM().getUser();
-        String password = ApexCRMApp.sharedCRM().getPassword();
+        String user = RACRMApp.sharedCRM().getUser();
+        String password = RACRMApp.sharedCRM().getPassword();
 
         user = RAUtil.ra_stringByEscapingForJavascriptWithDelimiter(user,'\'',true);
         password = RAUtil.ra_stringByEscapingForJavascriptWithDelimiter(password,'\'',true);

+ 5 - 1
ApexDrivers/apexcrm/src/main/java/com/usai/apex/apexcrm/RAWebView.java

@@ -11,6 +11,7 @@ import android.os.Bundle;
 import androidx.annotation.Nullable;
 import androidx.appcompat.app.AppCompatActivity;
 import android.util.AttributeSet;
+import android.util.Base64;
 import android.util.Log;
 import android.view.View;
 import android.webkit.ConsoleMessage;
@@ -192,7 +193,10 @@ public class RAWebView extends RelativeLayout {
 
     public void loadHtmlString(String html) {
         if (html != null) {
-            mWebView.loadData(html, "text/html", null);
+
+            String encodedHtml = Base64.encodeToString(html.getBytes(), Base64.NO_PADDING);
+            mWebView.loadData(encodedHtml, "text/html", "base64");
+//            mWebView.loadData(html, "text/html", null);
         }
     }
 

+ 327 - 0
ApexDrivers/apexcrm/src/main/java/com/usai/apex/apexcrm/application/RACRMApp.java

@@ -0,0 +1,327 @@
+package com.usai.apex.apexcrm.application;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.content.res.Configuration;
+import android.content.res.Resources;
+import android.os.Handler;
+import android.os.Looper;
+import android.text.TextUtils;
+
+import com.usai.apex.apexcrm.MainActivity;
+import com.usai.apex.apexcrm.R;
+import com.usai.apex.apexcrm.dataProvider.DataProvider;
+import com.usai.apex.apexcrm.receiver.AlarmReceiver;
+//import com.usai.apex.apexcrm.service.CRMService;
+import com.usai.apex.apexcrm.service.CRMService3;
+import com.usai.redant.rautils.application.RAApplication;
+import com.usai.redant.rautils.receiver.RABroadcast;
+import com.usai.redant.rautils.utils.AESUtil;
+import com.usai.redant.rautils.utils.RAProviderHelper;
+
+import org.json.JSONObject;
+
+public class RACRMApp extends RAApplication implements RAProviderHelper.ProviderHelperDelegate {
+
+    private final static String PreferenceKey = "ApexCRM";
+    private final static String SecretKey = "usai";
+
+    // region Service
+    public static String CHANNEL_ID = "ApexCRM";
+    public static String CHANNEL_NAME = "ApexCRM";
+    private boolean bLogin = false;
+
+    // endregion
+
+    // region File Provider
+    @Override
+    public String getProviderAuthorities() {
+        return "com.usai.apex.apex.crm.fileprovider";
+    }
+    // endregion
+
+    // region Activity Life
+
+    @Override
+    public void applicationDidEnterBackground() {
+        super.applicationDidEnterBackground();
+    }
+
+    @Override
+    public void applicationDidEnterForeground() {
+        super.applicationDidEnterForeground();
+
+        //notification
+        Intent intent = new Intent(RABroadcast.ACTION_REDANT_INIT_ALARM);
+        intent.setClass(RACRMApp.this, AlarmReceiver.class);
+        intent.setPackage(getPackageName());
+        sendBroadcast(intent);
+    }
+
+//    @Override
+//    public Resources getResources() {
+//        Resources resources = super.getResources();
+//        Configuration config = resources.getConfiguration();
+//        if(config.fontScale != 1.0f) {
+//            config.fontScale = 1.0f;
+//            return this.createConfigurationContext(config).getResources();
+//        } else {
+//            return resources;
+//        }
+//    }
+@Override
+public void onConfigurationChanged(Configuration newConfig) {
+    if (newConfig.fontScale != 1)//非默认值
+        getResources();
+    super.onConfigurationChanged(newConfig);
+}
+    @Override
+    public Resources getResources() {
+        Resources res = super.getResources();
+        if (res.getConfiguration().fontScale != 1) {//非默认值
+            Configuration newConfig = new Configuration();
+            newConfig.setToDefaults();//设置默认
+            res.updateConfiguration(newConfig, res.getDisplayMetrics());
+        }
+        return res;
+    }
+
+    // endregion
+
+    // region Override
+    @Override
+    public void onCreate() {
+        super.onCreate();
+
+        SharedPreferences pref = sharedPreferences(PreferenceKey);
+
+        user = decryptString(pref.getString("user", ""));
+        password = decryptString(pref.getString("password", ""));
+
+        startService(CRMService3.class);
+        initAlarm(AlarmReceiver.class);
+    }
+
+    // endregion
+
+    // region Getter
+
+    public static RACRMApp sharedCRM() {
+        return (RACRMApp)sharedApplication();
+    }
+
+    // endregion
+
+    // region User
+
+    private String user;
+    private String password;
+
+    public String getUser() {
+        return user;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setUser(String user) {
+        this.user = user;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public void login(String user, String password) {
+        bLogin = true;
+
+        SharedPreferences pref = sharedPreferences(PreferenceKey);
+        SharedPreferences.Editor editor = pref.edit();
+        String key = user + "_notification_id";
+        try {
+
+
+            editor.putString("user", encryptString(user));
+            editor.putString("password",  encryptString(password));
+
+        } catch (Exception e) {
+            editor.putString(key, null);
+            e.printStackTrace();
+        }
+        editor.commit();
+
+
+        setUser(user);
+        setPassword(password);
+
+        DataProvider.uploadDeviceId();
+    }
+
+    public void logout() {
+        setUser(null);
+        setPassword(null);
+        bLogin = false;
+
+        SharedPreferences pref = sharedPreferences(PreferenceKey);
+        SharedPreferences.Editor editor = pref.edit();
+        String key = user + "_notification_id";
+        try {
+
+
+            editor.remove("user");
+            editor.remove("password");
+
+
+        } catch (Exception e) {
+            editor.putString(key, null);
+            e.printStackTrace();
+        }
+        editor.commit();
+    }
+
+    public boolean isLogin() {
+        return bLogin;
+//        return user != null && password != null;
+    }
+
+    public boolean noAccount()
+    {
+        return TextUtils.isEmpty(RACRMApp.sharedCRM().getUser())||TextUtils.isEmpty(RACRMApp.sharedCRM().getPassword());
+    }
+
+    // endregion
+
+    // region Notification
+    private volatile long notificationID;
+    public void setNotificationID(long id) {
+        notificationID = id;
+
+        if (user == null) {
+            return;
+        }
+
+        SharedPreferences pref = sharedPreferences(PreferenceKey);
+        SharedPreferences.Editor editor = pref.edit();
+        String key = user + "_notification_id";
+        try {
+
+            editor.putLong(key, notificationID);
+
+        } catch (Exception e) {
+            editor.putString(key, null);
+            e.printStackTrace();
+        }
+        editor.commit();
+    }
+
+    public long getNotificationID() {
+
+        if (notificationID == 0) {
+
+            SharedPreferences pref = sharedPreferences(PreferenceKey);
+            String key = user + "_notification_id";
+            long id = pref.getLong(key, 0);
+            notificationID = id;
+        }
+
+        return notificationID;
+    }
+
+    public void receiveNotificationOnMainThread(final JSONObject notification) {
+        new Handler(Looper.getMainLooper()).post(new Runnable() {
+            @Override
+            public void run() {
+                receiveNotification(notification);
+            }
+        });
+    }
+
+    private void receiveNotification(JSONObject notification) {
+
+//        Log.e("debug", "receiveNotification: "+notification.toString());
+        if (notification != null) {
+
+//            JSONObject aps = notification.optJSONObject("aps");
+//            if (aps != null)
+            {
+
+//                final int id = notification.optInt("id");
+
+                final int id = notification.optInt("notificationId");
+                boolean isActive = !isBackground(); // 程序是否在前台
+                if (isActive) {
+                   // 直接转发给网页处理
+                    readNotificationNow(notification.toString());
+
+                    // 弹窗提示
+//                    AlertDialog.Builder builder = new AlertDialog.Builder(getCurrentActivity());
+//                    builder.setTitle("Warning");
+//                    builder.setMessage("you have a message, read it now?");
+//                    builder.setNegativeButton("Cancel",null);
+//                    builder.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
+//                        @Override
+//                        public void onClick(DialogInterface dialog, int which) {
+//                            readNotificationNow(id);
+//                        }
+//                    });
+//                    builder.show();
+
+                } else {
+                    // 发通知
+
+//                    Log.e("debug", "not active send notification");
+                    JSONObject alert = notification.optJSONObject("alert");
+                    String title = null,body = null;
+                    if (alert != null) {
+
+                        title = alert.optString("title");
+                        body = alert.optString("body");
+                    }
+
+                    NotificationContent notificationContent = new NotificationContent(id, title, body, R.drawable.ic_action_bar_o, R.drawable.ic_notification_large , notification.toString());
+
+                    showNotification(notificationContent, CHANNEL_ID, CHANNEL_NAME, MainActivity.class);
+                }
+
+            }
+        }
+    }
+
+    private void readNotificationNow(String notificationstr) {
+
+        Activity activity = getCurrentActivity();
+
+        if (activity instanceof MainActivity) {
+
+            MainActivity mainActivity = (MainActivity)activity;
+            mainActivity.readNotificationNow(notificationstr);
+
+        } else {
+
+            MainActivity.startActivityForNotification(activity, notificationstr);
+        }
+    }
+
+    // endregion
+
+    // region Private
+
+    public String encryptString(String string) {
+        if (TextUtils.isEmpty(string)) {
+            return null;
+        }
+        return AESUtil.encrypt256(SecretKey,string);
+    }
+
+    public String decryptString(String string) {
+        if (TextUtils.isEmpty(string)) {
+            return null;
+        }
+        return AESUtil.decrypt256(SecretKey, string);
+    }
+
+    // endregion
+
+}

+ 12 - 12
ApexDrivers/apexcrm/src/main/java/com/usai/apex/apexcrm/dataProvider/DataProvider.java

@@ -3,7 +3,7 @@ package com.usai.apex.apexcrm.dataProvider;
 import android.os.Bundle;
 import android.text.TextUtils;
 
-import com.usai.apex.apexcrm.application.ApexCRMApp;
+import com.usai.apex.apexcrm.application.RACRMApp;
 import com.usai.redant.rautils.operationqueue.OperationQueue;
 import com.usai.redant.rautils.utils.Network;
 import com.usai.redant.rautils.utils.RAUtil;
@@ -106,20 +106,20 @@ public class DataProvider {
 
         String user = params.getString("name");
         if (user == null) {
-            user = ApexCRMApp.sharedCRM().getUser();
+            user = RACRMApp.sharedCRM().getUser();
             if (!TextUtils.isEmpty(user)) {
                 params.putString("name",user);
             }
         }
 
         if (password == null) {
-            password = ApexCRMApp.sharedCRM().getPassword();
+            password = RACRMApp.sharedCRM().getPassword();
             if (!TextUtils.isEmpty(password)) {
                 params.putString("password",password);
             }
         }
 
-        Locale curLocale = ApexCRMApp.sharedApplication().getResources().getConfiguration().locale;
+        Locale curLocale = RACRMApp.sharedApplication().getResources().getConfiguration().locale;
         String languageCode = curLocale.getLanguage();
         if (languageCode != null) {
             params.putString("language",languageCode);
@@ -171,8 +171,8 @@ public class DataProvider {
 
         params = prepareParams(params);
 
-        dbgUtil.fileLog(ApexCRMApp.sharedApplication(), "getJSON(String url, Bundle params, int timeout) params " + params.toString());
-        dbgUtil.fileLog(ApexCRMApp.sharedApplication(), "getJSON(String url, Bundle params, int timeout) network available:" + (isNetworkAvailable(ApexCRMApp.sharedApplication())));
+        dbgUtil.fileLog(RACRMApp.sharedApplication(), "getJSON(String url, Bundle params, int timeout) params " + params.toString());
+        dbgUtil.fileLog(RACRMApp.sharedApplication(), "getJSON(String url, Bundle params, int timeout) network available:" + (isNetworkAvailable(RACRMApp.sharedApplication())));
 
         return Network.getJson(url,params,timeout);
     }
@@ -185,7 +185,7 @@ public class DataProvider {
 
 //        if(1==1)
 //        return;
-        if (ApexCRMApp.sharedCRM().noAccount())
+        if (RACRMApp.sharedCRM().noAccount())
         {
             //如果没有账号密码,返回
             if (completion != null) {
@@ -202,8 +202,8 @@ public class DataProvider {
             return;
         }
 
-        final long notificationId = ApexCRMApp.sharedCRM().getNotificationID();
-        final String deviceId = RAUtil.getDeviceId(ApexCRMApp.sharedCRM().getApplicationContext());
+        final long notificationId = RACRMApp.sharedCRM().getNotificationID();
+        final String deviceId = RAUtil.getDeviceId(RACRMApp.sharedCRM().getApplicationContext());
 
 
         OperationQueue.sharedQueue().addOperationTask(new OperationQueue.OperationBackgroundCallBack() {
@@ -235,9 +235,9 @@ public class DataProvider {
 
     public static void uploadDeviceId() {
 
-        if (ApexCRMApp.sharedCRM().isLogin()) {
+        if (RACRMApp.sharedCRM().isLogin()) {
 
-            final String deviceId = RAUtil.getDeviceId(ApexCRMApp.sharedCRM().getApplicationContext());
+            final String deviceId = RAUtil.getDeviceId(RACRMApp.sharedCRM().getApplicationContext());
 
             OperationQueue.sharedQueue().addOperationTask(new OperationQueue.OperationBackgroundCallBack() {
                 @Override
@@ -261,7 +261,7 @@ public class DataProvider {
     }
     public static String getToken()
     {
-        final String deviceId = RAUtil.getDeviceId(ApexCRMApp.sharedCRM().getApplicationContext());
+        final String deviceId = RAUtil.getDeviceId(RACRMApp.sharedCRM().getApplicationContext());
         return deviceId;
     }
     // end region

+ 7 - 7
ApexDrivers/apexcrm/src/main/java/com/usai/apex/apexcrm/receiver/AlarmReceiver.java

@@ -8,7 +8,7 @@ import android.content.Intent;
 import android.os.Build;
 import android.os.SystemClock;
 
-import com.usai.apex.apexcrm.application.ApexCRMApp;
+import com.usai.apex.apexcrm.application.RACRMApp;
 import com.usai.apex.apexcrm.dataProvider.DataProvider;
 import com.usai.redant.rautils.receiver.RABroadcast;
 import com.usai.redant.rautils.utils.dbgUtil;
@@ -28,7 +28,7 @@ public class AlarmReceiver extends com.usai.redant.rautils.receiver.AlarmReceive
     protected void InitAlarm(Context context, Intent intent) {
 
         int alarm_timeInterval = aggressive_alarm_timeInterval;
-        if(ApexCRMApp.sharedApplication().isBackground()) {
+        if(RACRMApp.sharedApplication().isBackground()) {
             alarm_timeInterval = normal_alarm_timeInterval;
         }
         dbgUtil.fileLog(context, TAG + " InitAlarm ");
@@ -79,7 +79,7 @@ public class AlarmReceiver extends com.usai.redant.rautils.receiver.AlarmReceive
     protected void AlarmProc(Context context, Intent intent) {
 
         int alarm_timeInterval = aggressive_alarm_timeInterval;
-        if(ApexCRMApp.sharedApplication().isBackground()) {
+        if(RACRMApp.sharedApplication().isBackground()) {
             alarm_timeInterval = normal_alarm_timeInterval;
         }
 
@@ -155,12 +155,12 @@ public class AlarmReceiver extends com.usai.redant.rautils.receiver.AlarmReceive
                     if (result == RESULT_TRUE) {
 
                         long notificationId = json.optLong("notificationId");
-                        ApexCRMApp.sharedCRM().setNotificationID(notificationId);
+                        RACRMApp.sharedCRM().setNotificationID(notificationId);
 
                         JSONArray notifications = json.optJSONArray("notifications");
                         if (notifications != null) {
 
-                            if(ApexCRMApp.sharedApplication().isBackground())
+                            if(RACRMApp.sharedApplication().isBackground())
                             {
                                 for (int i = 0; i < notifications.length(); i++) {
                                     JSONObject notification = notifications.optJSONObject(i);
@@ -174,7 +174,7 @@ public class AlarmReceiver extends com.usai.redant.rautils.receiver.AlarmReceive
                                             } catch (JSONException e) {
                                                 e.printStackTrace();
                                             }
-                                            ApexCRMApp.sharedCRM().receiveNotificationOnMainThread(aps);
+                                            RACRMApp.sharedCRM().receiveNotificationOnMainThread(aps);
                                         }
                                     }
                                 }
@@ -196,7 +196,7 @@ public class AlarmReceiver extends com.usai.redant.rautils.receiver.AlarmReceive
                                         } catch (JSONException e) {
                                             e.printStackTrace();
                                         }
-                                        ApexCRMApp.sharedCRM().receiveNotificationOnMainThread(aps);
+                                        RACRMApp.sharedCRM().receiveNotificationOnMainThread(aps);
                                     }
 
                                 }

+ 4 - 3
ApexDrivers/apexcrm/src/main/java/com/usai/apex/apexcrm/receiver/BootReceiver.java

@@ -4,7 +4,8 @@ import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
 
-import com.usai.apex.apexcrm.service.CRMService;
+//import com.usai.apex.apexcrm.service.CRMService;
+import com.usai.apex.apexcrm.service.CRMService3;
 import com.usai.redant.rautils.receiver.BootCompleteBroadcastReceiver;
 import com.usai.redant.rautils.utils.dbgUtil;
 
@@ -14,14 +15,14 @@ public class BootReceiver extends BootCompleteBroadcastReceiver {
     protected void OnBootComplete(Context context, Intent intent) {
 
         dbgUtil.fileLog(context,"ApexCRM: OnBootComplete");
-        startService(context, intent, CRMService.class);
+        startService(context, intent, CRMService3.class);
     }
 
     @Override
     protected void OnLockedBootComplete(Context context, Intent intent) {
 
         dbgUtil.fileLog(context,"ApexCRM: OnLockedBootComplete");
-        startService(context, intent, CRMService.class);
+        startService(context, intent, CRMService3.class);
     }
 
 

+ 3 - 3
ApexDrivers/apexcrm/src/main/java/com/usai/apex/apexcrm/service/CRMService.java

@@ -4,7 +4,7 @@ import android.content.res.Configuration;
 import android.content.res.Resources;
 
 import com.usai.apex.apexcrm.R;
-import com.usai.apex.apexcrm.application.ApexCRMApp;
+import com.usai.apex.apexcrm.application.RACRMApp;
 import com.usai.redant.rautils.service.RAService;
 
 public class CRMService extends RAService {
@@ -14,8 +14,8 @@ public class CRMService extends RAService {
     @Override
     protected void Setup() {
 
-        CHANNEL_ID = ApexCRMApp.CHANNEL_ID;
-        CHANNEL_NAME = ApexCRMApp.CHANNEL_NAME;
+        CHANNEL_ID = RACRMApp.CHANNEL_ID;
+        CHANNEL_NAME = RACRMApp.CHANNEL_NAME;
 
         LAUNCH_MSG="Apex CRM is running.";
         FOREGROUND_ICON= R.drawable.ic_action_bar_o;;

+ 61 - 0
ApexDrivers/apexcrm/src/main/java/com/usai/apex/apexcrm/service/CRMService3.java

@@ -0,0 +1,61 @@
+package com.usai.apex.apexcrm.service;
+
+import android.content.Context;
+import android.content.res.Configuration;
+import android.content.res.Resources;
+
+import com.usai.apex.apexcrm.R;
+import com.usai.apex.apexcrm.application.RACRMApp;
+import com.usai.redant.rautils.service.RAService3;
+import com.usai.redant.rautils.service.RATask3Notifiacation;
+//import com.usai.redant.rautils.service.RATask3Upload;
+
+public class CRMService3 extends RAService3 {
+    String TAG="RAImageBackgroundService3";
+    public CRMService3() {
+        CHANNEL_ID = RACRMApp.CHANNEL_ID;
+        CHANNEL_NAME = RACRMApp.CHANNEL_NAME;
+        LAUNCH_MSG = "Apex CRM is running";
+        FOREGROUND_ICON= R.drawable.ic_action_bar_o;;
+    }
+
+    RATask3Notifiacation.ServicePushNotification notifycationCallback=null;
+    @Override
+    public void onCreate() {
+        super.onCreate();
+
+//        RATask3Notifiacation notifyTask = new RATask3Notifiacation();
+//
+//        Context c=this.getApplication();
+//
+//        notifyTask.Setup(c,notifycationCallback,"url");
+//
+////        tracingTask.Setup(this.getApplicationContext(), false, new RATask3Tracing.TracingTaskCallback() {
+////            @Override
+////            public void onLocationChanged(Location location) {
+////                Log.i(TAG, "onLocationChanged " + location);
+////            }
+////        });
+//
+//
+//        addTask(notifyTask);
+    }
+
+
+    @Override
+    public void onConfigurationChanged(Configuration newConfig) {
+        if (newConfig.fontScale != 1)//非默认值
+            getResources();
+        super.onConfigurationChanged(newConfig);
+    }
+    @Override
+    public Resources getResources() {
+        Resources res = super.getResources();
+        if (res.getConfiguration().fontScale != 1) {//非默认值
+            Configuration newConfig = new Configuration();
+            newConfig.setToDefaults();//设置默认
+            res.updateConfiguration(newConfig, res.getDisplayMetrics());
+        }
+        return res;
+    }
+}

BIN
ApexDrivers/apexcrm/src/main/res/mipmap-hdpi/ic_launcher.png


BIN
ApexDrivers/apexcrm/src/main/res/mipmap-hdpi/ic_launcher_foreground.png


BIN
ApexDrivers/apexcrm/src/main/res/mipmap-hdpi/ic_launcher_round.png


BIN
ApexDrivers/apexcrm/src/main/res/mipmap-mdpi/ic_launcher.png


BIN
ApexDrivers/apexcrm/src/main/res/mipmap-mdpi/ic_launcher_foreground.png


BIN
ApexDrivers/apexcrm/src/main/res/mipmap-mdpi/ic_launcher_round.png


BIN
ApexDrivers/apexcrm/src/main/res/mipmap-xhdpi/ic_launcher.png


BIN
ApexDrivers/apexcrm/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png


BIN
ApexDrivers/apexcrm/src/main/res/mipmap-xhdpi/ic_launcher_round.png


BIN
ApexDrivers/apexcrm/src/main/res/mipmap-xxhdpi/ic_launcher.png


BIN
ApexDrivers/apexcrm/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png


BIN
ApexDrivers/apexcrm/src/main/res/mipmap-xxhdpi/ic_launcher_round.png


BIN
ApexDrivers/apexcrm/src/main/res/mipmap-xxxhdpi/ic_launcher.png


BIN
ApexDrivers/apexcrm/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png


BIN
ApexDrivers/apexcrm/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png


+ 1 - 1
ApexDrivers/apexcrm/src/main/res/values/ic_launcher_background.xml

@@ -1,4 +1,4 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
-    <color name="ic_launcher_background">#FFFFFF</color>
+    <color name="ic_launcher_background">#3DDC84</color>
 </resources>