From 963c6d135d4092ff45b592c56a9ec03e0eb2ce73 Mon Sep 17 00:00:00 2001 From: Lihongda <963140097@qq.com> Date: Wed, 21 Feb 2024 17:28:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89bugly=E5=BA=93=EF=BC=8C?= =?UTF-8?q?=E4=BD=BF=E7=94=A8jdk=5F1.8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit fbcc8ad36c2ebadedc52a84797eb8d5202123555) --- gradle.properties | 9 +++++++-- iFish7/build.gradle | 17 ++++++++++------- .../com/ifish/baseclass/BaseApplication.java | 4 ++-- .../java/com/ifish/esptouch/EspNetUtil.java | 4 ++-- .../java/com/ifish/fragment/DeviceFragment.java | 10 +++++++++- .../main/java/com/ifish/utils/CrashHandler.java | 4 ++-- 6 files changed, 32 insertions(+), 16 deletions(-) diff --git a/gradle.properties b/gradle.properties index e1c4e18ba..76f220158 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,7 +14,7 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 # AndroidX package structure to make it clearer which packages are bundled with the # Android operating system, and which are packaged with your app"s APK # https://developer.android.com/topic/libraries/support-library/androidx-rn -android.useAndroidX=true + # Kotlin code style for this project: "official" or "obsolete": kotlin.code.style=official # Enables namespacing of each library's R class so that its R class includes only the @@ -22,4 +22,9 @@ kotlin.code.style=official # thereby reducing the size of the R class for that library android.nonTransitiveRClass=true -android.enableJetifier=true \ No newline at end of file +android.enableJetifier=true +android.useAndroidX=true +android.useDeprecatedNdk=true + +versionCode=40 +versionName=4.11.0 \ No newline at end of file diff --git a/iFish7/build.gradle b/iFish7/build.gradle index 10688ebb0..b0909178c 100644 --- a/iFish7/build.gradle +++ b/iFish7/build.gradle @@ -37,17 +37,16 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion applicationId "com.ifish.activity" -// versionCode project.versionCode.toInteger() -// versionName project.versionName + versionCode project.versionCode.toInteger() + versionName project.versionName multiDexEnabled true ndk { abiFilters 'armeabi', 'arm64-v8a' } } allprojects { - sourceCompatibility = 1.7 - targetCompatibility = 1.7 - + sourceCompatibility = 1.8 + targetCompatibility = 1.8 } buildTypes { debug { @@ -61,6 +60,10 @@ android { dexOptions { javaMaxHeapSize '4g' } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } } repositories { @@ -116,8 +119,8 @@ dependencies { implementation files('libs/httpcore-4.4.13.jar') implementation files('libs/httpclient-4.5.12.jar') implementation 'com.zhy:autolayout:1.4.5' - implementation 'com.tencent.bugly:crashreport:latest.release' - implementation 'com.tencent.bugly:nativecrashreport:latest.release' +// implementation 'com.tencent.bugly:crashreport:latest.release' +// implementation 'com.tencent.bugly:nativecrashreport:latest.release' //UDP功能模块库 //UDP基础库(不可少) diff --git a/iFish7/src/main/java/com/ifish/baseclass/BaseApplication.java b/iFish7/src/main/java/com/ifish/baseclass/BaseApplication.java index f6c2c4802..0159b2d8e 100644 --- a/iFish7/src/main/java/com/ifish/baseclass/BaseApplication.java +++ b/iFish7/src/main/java/com/ifish/baseclass/BaseApplication.java @@ -26,7 +26,7 @@ import com.alibaba.sdk.android.push.noonesdk.PushServiceFactory; import com.alibaba.sdk.android.push.register.MiPushRegister; import com.ifish.utils.SystemUtil; import com.p2p.core.P2PSpecial.P2PSpecial; -import com.tencent.bugly.crashreport.CrashReport; +//import com.tencent.bugly.crashreport.CrashReport; import com.tendcloud.tenddata.TCAgent; import com.umeng.commonsdk.UMConfigure; import com.umeng.socialize.PlatformConfig; @@ -183,7 +183,7 @@ public class BaseApplication extends MultiDexApplication { //初始化腾讯bugly SDK&全局捕获Crash private void initCrashSDK() { - CrashReport.initCrashReport(getApplicationContext(), "4c8cf75014", true);//注册bugly上报 +// CrashReport.initCrashReport(getApplicationContext(), "4c8cf75014", true);//注册bugly上报 } //初始化友盟社会化分享 diff --git a/iFish7/src/main/java/com/ifish/esptouch/EspNetUtil.java b/iFish7/src/main/java/com/ifish/esptouch/EspNetUtil.java index 2b0282035..ea6017aad 100644 --- a/iFish7/src/main/java/com/ifish/esptouch/EspNetUtil.java +++ b/iFish7/src/main/java/com/ifish/esptouch/EspNetUtil.java @@ -9,7 +9,7 @@ import com.ifish.utils.Commons; import com.ifish.utils.HttpListener; import com.ifish.utils.HttpManager; import com.ifish.utils.Commons.NetWork; -import com.tencent.bugly.crashreport.CrashReport; +//import com.tencent.bugly.crashreport.CrashReport; import android.content.Context; import android.net.wifi.WifiInfo; @@ -98,7 +98,7 @@ public class EspNetUtil { try { result[i] = (byte) Integer.parseInt(bssidSplits[i], 16); } catch (Exception e) { - CrashReport.postCatchedException(e); // bugly会将这个throwable上报 +// CrashReport.postCatchedException(e); // bugly会将这个throwable上报 } } return result; diff --git a/iFish7/src/main/java/com/ifish/fragment/DeviceFragment.java b/iFish7/src/main/java/com/ifish/fragment/DeviceFragment.java index 199011d9a..cc7a4f22c 100644 --- a/iFish7/src/main/java/com/ifish/fragment/DeviceFragment.java +++ b/iFish7/src/main/java/com/ifish/fragment/DeviceFragment.java @@ -485,7 +485,7 @@ public class DeviceFragment extends BaseV4Fragment implements ObservableScrollVi sp.putString(LoginSPKey.P2PVerifyCode1, baseBean.P2PVerifyCode1); sp.putString(LoginSPKey.P2PVerifyCode2, baseBean.P2PVerifyCode2); P2PHandler.getInstance().p2pInit(getActivity(), new P2PListener(), new SettingListener());//初始化技威 - boolean p2pConnect = P2PHandler.getInstance().p2pConnect(baseBean.UserID, Integer.parseInt(baseBean.sessionId), Integer.parseInt(baseBean.sessionId2), Integer.parseInt(baseBean.P2PVerifyCode1), Integer.parseInt(baseBean.P2PVerifyCode2), 0);//p2p连接 + boolean p2pConnect = P2PHandler.getInstance().p2pConnect(baseBean.UserID, parseInt(baseBean.sessionId), parseInt(baseBean.sessionId2), parseInt(baseBean.P2PVerifyCode1), parseInt(baseBean.P2PVerifyCode2), 0);//p2p连接 String[] cameras = new String[Commons.CAMERA.size()]; for (int i = 0; i < Commons.CAMERA.size(); i++) { cameras[i] = Commons.CAMERA.get(i).cameraId; @@ -540,6 +540,14 @@ public class DeviceFragment extends BaseV4Fragment implements ObservableScrollVi } } + public static int parseInt(String str) { + try { + return Integer.parseInt(str); + } catch (Exception e) { + Log.i("parseInt error", "Exception e---" + e.getMessage()); + return -1; + } + } private void gradeRuleInfo() { if (Commons.USER == null) { diff --git a/iFish7/src/main/java/com/ifish/utils/CrashHandler.java b/iFish7/src/main/java/com/ifish/utils/CrashHandler.java index c7288c729..dfc61f2b0 100644 --- a/iFish7/src/main/java/com/ifish/utils/CrashHandler.java +++ b/iFish7/src/main/java/com/ifish/utils/CrashHandler.java @@ -29,7 +29,7 @@ import android.widget.Toast; import com.ifish.activity.LoadingActivity; import com.ifish.baseclass.UriForFile; -import com.tencent.bugly.crashreport.CrashReport; +//import com.tencent.bugly.crashreport.CrashReport; /** * @author Jacky dada @@ -93,7 +93,7 @@ public class CrashHandler implements UncaughtExceptionHandler { // PendingIntent restartIntent = PendingIntent.getActivity(mContext, 0, intent,Intent.FLAG_ACTIVITY_NEW_TASK); // AlarmManager mgr = (AlarmManager)mContext.getSystemService(Context.ALARM_SERVICE); // mgr.set(AlarmManager.RTC, System.currentTimeMillis(),restartIntent); //马上重启应用 - CrashReport.postCatchedException(ex); // bugly会将这个throwable上报 +// CrashReport.postCatchedException(ex); // bugly会将这个throwable上报 L.i("========上报Exception=========="); } catch (Exception e) { }