18034727885
2026-03-19 0516d72c1083a22655d80fcb12503eda947e0ec7
去掉极光推送相关功能代码
5个文件已修改
152 ■■■■■ 已修改文件
app/build.gradle 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/driver/igotrip/base/MyApplication.kt 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/driver/igotrip/ui/push/JCommonByService.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/driver/igotrip/ui/push/JPushReceiver.java 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
easyfloat/build.gradle 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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')
//    {
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: ", "开始链接")
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;
    }
}
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);
//    }
}
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()