Browse Source

增加友盟远程日志

songw 8 months ago
parent
commit
5a9b04be00

+ 15 - 6
app/build.gradle

@@ -1,7 +1,10 @@
 plugins {
     id 'com.android.application'
+    id 'kotlin-android'
 }
 
+apply plugin: 'kotlin-android-extensions'
+
 android {
     signingConfigs {
         udapda {
@@ -51,7 +54,12 @@ android {
         sourceCompatibility JavaVersion.VERSION_1_8
         targetCompatibility JavaVersion.VERSION_1_8
     }
-
+//    buildFeatures {
+//        viewBinding true
+//    }
+//    kotlinOptions {
+//        jvmTarget = '1.8'
+//    }
     packagingOptions {
         exclude 'META-INF/LICENSE.txt'
         exclude 'META-INF/NOTICE.txt'
@@ -98,7 +106,6 @@ dependencies {
 //    implementation deps.appcompatV7
 //    implementation deps.recyclerview
 
-
     implementation deps.stetho
     implementation deps.fastjson
     implementation deps.xUtils
@@ -112,9 +119,6 @@ dependencies {
 //    implementation deps.permisson     //权限不在兼容
     implementation deps.basePopup
     implementation deps.smartTable
-    implementation 'com.umeng.umsdk:common:9.4.0'// 必选
-    implementation 'com.umeng.umsdk:asms:1.2.3'// 必选
-    implementation 'com.umeng.umsdk:apm:1.4.0' // 错误分析升级为独立SDK,看crash数据请一定集成,可选
 
 
 //    implementation "io.github.cymchad:BaseRecyclerViewAdapterHelper:3.0.14"
@@ -133,8 +137,13 @@ dependencies {
     implementation  'io.github.scwang90:refresh-layout-kernel:3.0.0-alpha'      //列表核心必须依赖
     implementation  'io.github.scwang90:refresh-header-classics:3.0.0-alpha'    //列表经典刷新头
 
+    // 友盟基础组件库(所有友盟业务SDK都依赖基础组件库)
+    implementation 'com.umeng.umsdk:common:9.4.4' //(必选)
+    implementation 'com.umeng.umsdk:asms:1.4.1' // asms包依赖(必选)
+    implementation 'com.umeng.umsdk:apm:1.5.2' // U-APM包依赖(必选) 错误分析升级为独立SDK,看crash数据请一定集成
+
     //权限工具
     implementation 'com.permissionx.guolindev:permissionx:1.3.0'
 
-
+    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
 }

+ 13 - 1
app/proguard-rules.pro

@@ -18,4 +18,16 @@
 
 # If you keep the line number information, uncomment this to
 # hide the original source file name.
-#-renamesourcefileattribute SourceFile
+#-renamesourcefileattribute SourceFile
+
+#友盟混淆
+-keep class com.umeng.** {*;}
+-keep class org.repackage.** {*;}
+-keep class com.uyumao.** { *; }
+-keepclassmembers class * {
+   public <init> (org.json.JSONObject);
+}
+-keepclassmembers enum * {
+    public static **[] values();
+    public static ** valueOf(java.lang.String);
+}

+ 0 - 2
app/src/main/java/uas/erp/general_wms/activity/MainActivity.java

@@ -63,12 +63,10 @@ public class MainActivity extends BaseActivity implements BackHandlerInterface {
                     .commitAllowingStateLoss();
         } else {
             Fragment fragment = new ConnectServerFragment();
-
             getSupportFragmentManager().beginTransaction()
                     .add(R.id.container_login_fragment, fragment)
                     .commit();
         }
-
     }
 
     @Override

+ 2 - 2
app/src/main/java/uas/erp/general_wms/application/PdaApplication.java

@@ -140,12 +140,12 @@ public class PdaApplication extends Application {
 
     private void initUmeng() {
         //2.在Application.oncreate()中调用预初始化函数
-        UMConfigure.preInit(this, "6170b8b61c91e0671bb0da5a","umeng");
+        UMConfigure.preInit(this, "682306f2bc47b67d83645171","umeng");
         UMConfigure.setLogEnabled(true);
         //3.客户端用户同意隐私政策后,正式初始化友盟+SDK
         UMConfigure.init(
                 this,
-                "6170b8b61c91e0671bb0da5a",
+                "682306f2bc47b67d83645171",
                 "umeng",
                 UMConfigure.DEVICE_TYPE_PHONE, ""
         );

+ 2 - 2
build.gradle

@@ -1,5 +1,6 @@
 // Top-level build file where you can add configuration options common to all sub-projects/modules.
 buildscript {
+    ext.kotlin_version = "1.5.0"
     repositories {
         maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
         maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
@@ -19,8 +20,7 @@ buildscript {
         classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
         classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
 
-        // NOTE: Do not place your application dependencies here; they belong
-        // in the individual module build.gradle files
+        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
     }
 }
 

+ 3 - 1
gradle.properties

@@ -15,4 +15,6 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
 # 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
-android.enableJetifier=true
+android.enableJetifier=true
+# Kotlin code style for this project: "official" or "obsolete":
+kotlin.code.style=official