From 0516d72c1083a22655d80fcb12503eda947e0ec7 Mon Sep 17 00:00:00 2001
From: 18034727885 <973609879@qq.com>
Date: 星期四, 19 三月 2026 18:32:14 +0800
Subject: [PATCH] 去掉极光推送相关功能代码

---
 app/src/main/java/com/driver/igotrip/base/MyApplication.kt         |   70 +++++++++++-----------
 easyfloat/build.gradle                                             |    2 
 app/build.gradle                                                   |    8 +-
 app/src/main/java/com/driver/igotrip/ui/push/JCommonByService.java |   15 ++++
 app/src/main/java/com/driver/igotrip/ui/push/JPushReceiver.java    |   57 ++++++++++--------
 5 files changed, 85 insertions(+), 67 deletions(-)

diff --git a/app/build.gradle b/app/build.gradle
index bd9eba9..6fe963c 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -29,8 +29,8 @@
         applicationId "com.driver.goposttrip"
         minSdkVersion 23
         targetSdkVersion 35
-        versionCode 34
-        versionName "1.5.5"
+        versionCode 36
+        versionName "1.5.7"
         multiDexEnabled true
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
 
@@ -211,8 +211,8 @@
     implementation project(path: ':rxnetty')
     implementation 'com.wang.avi:library:2.1.3'
     implementation 'com.google.zxing:core:3.3.0'
-    implementation 'cn.jiguang.sdk:jpush:6.0.2'  // 此处以JPush 3.6.6 版本为例。
-    implementation 'cn.jiguang.sdk:jcore:5.3.1'  // 此处以JCore 2.3.8 版本为例。
+//    implementation 'cn.jiguang.sdk:jpush:6.0.2'  // 此处以JPush 3.6.6 版本为例。
+//    implementation 'cn.jiguang.sdk:jcore:5.3.1'  // 此处以JCore 2.3.8 版本为例。
     implementation 'com.tencent.bugly:crashreport:latest.release'
 //    implementation ('com.google.android.gms:play-services-maps:18.0.2')
 //    {
diff --git a/app/src/main/java/com/driver/igotrip/base/MyApplication.kt b/app/src/main/java/com/driver/igotrip/base/MyApplication.kt
index f5495fc..d856c18 100644
--- a/app/src/main/java/com/driver/igotrip/base/MyApplication.kt
+++ b/app/src/main/java/com/driver/igotrip/base/MyApplication.kt
@@ -9,8 +9,8 @@
 import android.util.Log
 import androidx.fragment.app.Fragment
 import androidx.fragment.app.FragmentManager
-import cn.jpush.android.api.JPushInterface
-import cn.jpush.android.api.TagAliasCallback
+//import cn.jpush.android.api.JPushInterface
+//import cn.jpush.android.api.TagAliasCallback
 import cn.sinata.rxnetty.LogHelper.initLogs
 import cn.sinata.rxnetty.LogHelper.logRecord
 import cn.sinata.rxnetty.NettyClient
@@ -88,8 +88,8 @@
         LogUtils.OpenLog(true)
         initLogs()
         initSocket()
-        JPushInterface.setDebugMode(true)
-        JPushInterface.init(this)
+//        JPushInterface.setDebugMode(true)
+//        JPushInterface.init(this)
         setAlisa()
     }
 
@@ -121,12 +121,12 @@
                 MSG_SET_ALIAS -> {
                     Log.d(TAG, "Set alias in handler.")
                     // 调用 JPush 接口来设置别名。
-                    JPushInterface.setAliasAndTags(
-                        applicationContext,
-                        msg.obj as String,
-                        null,
-                        mAliasCallback
-                    )
+//                    JPushInterface.setAliasAndTags(
+//                        applicationContext,
+//                        msg.obj as String,
+//                        null,
+//                        mAliasCallback
+//                    )
                 }
 
                 MSG_ORDER_CANCEL -> {
@@ -178,31 +178,31 @@
         }
     }
 
-    private val mAliasCallback =
-        TagAliasCallback { code, alias, tags ->
-            val logs: String
-            when (code) {
-                0 -> {
-                    logs = "Set tag and alias success"
-                    Log.i("TAG", logs)
-                }
-
-                6002 -> {
-                    logs = "Failed to set alias and tags due to timeout. Try again after 60s."
-                    Log.i("TAG", logs)
-                    // 延迟 60 秒来调用 Handler 设置别名
-                    var alisa = "DRIVER" + CacheKey.getUserId()
-                    Handler().postDelayed({
-                        JPushInterface.setAliasAndTags(this, alisa, null, null)
-                    }, 60 * 1000)
-                }
-
-                else -> {
-                    logs = "Failed with errorCode = $code"
-                    Log.e("TAG", logs)
-                }
-            }
-        }
+//    private val mAliasCallback =
+//        TagAliasCallback { code, alias, tags ->
+//            val logs: String
+//            when (code) {
+//                0 -> {
+//                    logs = "Set tag and alias success"
+//                    Log.i("TAG", logs)
+//                }
+//
+//                6002 -> {
+//                    logs = "Failed to set alias and tags due to timeout. Try again after 60s."
+//                    Log.i("TAG", logs)
+//                    // 延迟 60 秒来调用 Handler 设置别名
+//                    var alisa = "DRIVER" + CacheKey.getUserId()
+//                    Handler().postDelayed({
+//                        JPushInterface.setAliasAndTags(this, alisa, null, null)
+//                    }, 60 * 1000)
+//                }
+//
+//                else -> {
+//                    logs = "Failed with errorCode = $code"
+//                    Log.e("TAG", logs)
+//                }
+//            }
+//        }
 
     private fun initSocket() {
         Log.e("sendLocation: ", "开始链接")
diff --git a/app/src/main/java/com/driver/igotrip/ui/push/JCommonByService.java b/app/src/main/java/com/driver/igotrip/ui/push/JCommonByService.java
index f7c5d47..e41ab9b 100644
--- a/app/src/main/java/com/driver/igotrip/ui/push/JCommonByService.java
+++ b/app/src/main/java/com/driver/igotrip/ui/push/JCommonByService.java
@@ -1,6 +1,17 @@
 package com.driver.igotrip.ui.push;
 
-import cn.jpush.android.service.JCommonService;
+import android.app.Service;
+import android.content.Intent;
+import android.os.IBinder;
 
-public class JCommonByService extends JCommonService {
+import androidx.annotation.Nullable;
+
+//import cn.jpush.android.service.JCommonService;
+
+public class JCommonByService extends Service/*JCommonService*/ {
+    @Nullable
+    @Override
+    public IBinder onBind(Intent intent) {
+        return null;
+    }
 }
diff --git a/app/src/main/java/com/driver/igotrip/ui/push/JPushReceiver.java b/app/src/main/java/com/driver/igotrip/ui/push/JPushReceiver.java
index be56e1a..46c7792 100644
--- a/app/src/main/java/com/driver/igotrip/ui/push/JPushReceiver.java
+++ b/app/src/main/java/com/driver/igotrip/ui/push/JPushReceiver.java
@@ -1,39 +1,46 @@
 package com.driver.igotrip.ui.push;
 
+import android.content.BroadcastReceiver;
 import android.content.Context;
+import android.content.Intent;
 import android.util.Log;
 
 import com.driver.igotrip.base.MyApplication;
 
-import cn.jpush.android.api.CustomMessage;
-import cn.jpush.android.api.NotificationMessage;
-import cn.jpush.android.service.JPushMessageReceiver;
+//import cn.jpush.android.api.CustomMessage;
+//import cn.jpush.android.api.NotificationMessage;
+//import cn.jpush.android.service.JPushMessageReceiver;
 
-public class JPushReceiver extends JPushMessageReceiver {
+public class JPushReceiver extends BroadcastReceiver /*JPushMessageReceiver*/ {
     private static final String TAG = "JPushReceiver";
 
     @Override
-    public void onConnected(Context context, boolean b) {
-        super.onConnected(context, b);
-        Log.i(TAG, "onConnected: ");
+    public void onReceive(Context context, Intent intent) {
+
     }
 
-    @Override
-    public void onMessage(Context context, CustomMessage customMessage) {
-        super.onMessage(context, customMessage);
-        Log.i(TAG, "onMessage: ");
-    }
-
-
-    @Override
-    public void onNotifyMessageOpened(Context context, NotificationMessage notificationMessage) {
-        super.onNotifyMessageOpened(context, notificationMessage);
-        Log.i(TAG, "onNotifyMessageOpened: ");
-    }
-
-    @Override
-    public void onNotifyMessageArrived(Context context, NotificationMessage notificationMessage) {
-        super.onNotifyMessageArrived(context, notificationMessage);
-//        MyApplication.Companion.getTTsManager().setVideoText(notificationMessage.notificationContent);
-    }
+//    @Override
+//    public void onConnected(Context context, boolean b) {
+//        super.onConnected(context, b);
+//        Log.i(TAG, "onConnected: ");
+//    }
+//
+//    @Override
+//    public void onMessage(Context context, CustomMessage customMessage) {
+//        super.onMessage(context, customMessage);
+//        Log.i(TAG, "onMessage: ");
+//    }
+//
+//
+//    @Override
+//    public void onNotifyMessageOpened(Context context, NotificationMessage notificationMessage) {
+//        super.onNotifyMessageOpened(context, notificationMessage);
+//        Log.i(TAG, "onNotifyMessageOpened: ");
+//    }
+//
+//    @Override
+//    public void onNotifyMessageArrived(Context context, NotificationMessage notificationMessage) {
+//        super.onNotifyMessageArrived(context, notificationMessage);
+////        MyApplication.Companion.getTTsManager().setVideoText(notificationMessage.notificationContent);
+//    }
 }
diff --git a/easyfloat/build.gradle b/easyfloat/build.gradle
index e573dd2..a4c2bb1 100644
--- a/easyfloat/build.gradle
+++ b/easyfloat/build.gradle
@@ -38,7 +38,7 @@
 
 dependencies {
     implementation "org.jetbrains.kotlin:kotlin-stdlib:1.9.0"
-    //api 'org.greenrobot:eventbus:3.1.1'
+    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
 }
 repositories {
     mavenCentral()

--
Gitblit v1.7.1