Commit 565dc81df4cf4a05785b9a8703f173f4864664ce

Authored by 朱显松
1 parent c0b426ae

更新SDK ,添加混淆代码

.idea/misc.xml
@@ -37,7 +37,7 @@ @@ -37,7 +37,7 @@
37 <ConfirmationsSetting value="0" id="Add" /> 37 <ConfirmationsSetting value="0" id="Add" />
38 <ConfirmationsSetting value="0" id="Remove" /> 38 <ConfirmationsSetting value="0" id="Remove" />
39 </component> 39 </component>
40 - <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK"> 40 + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
41 <output url="file://$PROJECT_DIR$/build/classes" /> 41 <output url="file://$PROJECT_DIR$/build/classes" />
42 </component> 42 </component>
43 <component name="ProjectType"> 43 <component name="ProjectType">
app/build.gradle
@@ -11,10 +11,19 @@ android { @@ -11,10 +11,19 @@ android {
11 versionName "1.0" 11 versionName "1.0"
12 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 12 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
13 } 13 }
  14 + signingConfigs {
  15 + myConfig {
  16 + storeFile file("key_cnprobe.jks")
  17 + storePassword "cnlive"
  18 + keyAlias "cnlive"
  19 + keyPassword "cnlive"
  20 + }
  21 + }
14 buildTypes { 22 buildTypes {
15 release { 23 release {
16 - minifyEnabled false 24 + minifyEnabled true
17 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 25 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  26 + signingConfig signingConfigs.myConfig
18 } 27 }
19 } 28 }
20 } 29 }
app/key_cnprobe.jks 0 → 100644
No preview for this file type
app/libs/libcnliveanalytics.jar
No preview for this file type
app/libs/libcnliveutil.jar
No preview for this file type
app/proguard-rules.pro
1 -# Add project specific ProGuard rules here.  
2 -# By default, the flags in this file are appended to flags specified  
3 -# in D:\AndroidSDK/tools/proguard/proguard-android.txt  
4 -# You can edit the include path and order by changing the proguardFiles  
5 -# directive in build.gradle.  
6 -#  
7 -# For more details, see  
8 -# http://developer.android.com/guide/developing/tools/proguard.html 1 +-keepattributes Signature
9 2
10 -# Add any project specific keep options here:  
11 -  
12 -# If your project uses WebView with JS, uncomment the following  
13 -# and specify the fully qualified class name to the JavaScript interface  
14 -# class:  
15 -#-keepclassmembers class fqcn.of.javascript.interface.for.webview {  
16 -# public *;  
17 -#} 3 +-dontwarn com.cnlive.**
  4 +-keep class com.cnlive.** {*;}
app/src/main/AndroidManifest.xml
@@ -2,7 +2,14 @@ @@ -2,7 +2,14 @@
2 <manifest xmlns:android="http://schemas.android.com/apk/res/android" 2 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3 package="com.cnlive.demo.probe"> 3 package="com.cnlive.demo.probe">
4 4
  5 + <uses-permission android:name="android.permission.INTERNET" />
  6 + <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  7 + <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
  8 + <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
  9 + <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  10 +
5 <application 11 <application
  12 + android:name=".CNLiveApplication"
6 android:allowBackup="true" 13 android:allowBackup="true"
7 android:icon="@mipmap/ic_launcher" 14 android:icon="@mipmap/ic_launcher"
8 android:label="@string/app_name" 15 android:label="@string/app_name"
app/src/main/java/com/cnlive/demo/probe/MainActivity.java
@@ -11,18 +11,21 @@ public class MainActivity extends AppCompatActivity { @@ -11,18 +11,21 @@ public class MainActivity extends AppCompatActivity {
11 protected void onCreate(Bundle savedInstanceState) { 11 protected void onCreate(Bundle savedInstanceState) {
12 super.onCreate(savedInstanceState); 12 super.onCreate(savedInstanceState);
13 setContentView(R.layout.activity_main); 13 setContentView(R.layout.activity_main);
  14 + //统计次数
14 CNLiveProbe.onEvent("playVideo"); 15 CNLiveProbe.onEvent("playVideo");
15 } 16 }
16 17
17 @Override 18 @Override
18 protected void onStart() { 19 protected void onStart() {
19 super.onStart(); 20 super.onStart();
  21 + //统计时长 开始
20 CNLiveProbe.onEventBegin("playVideo"); 22 CNLiveProbe.onEventBegin("playVideo");
21 } 23 }
22 24
23 @Override 25 @Override
24 protected void onPause() { 26 protected void onPause() {
25 super.onPause(); 27 super.onPause();
  28 + //统计时长 结束
26 CNLiveProbe.onEventEnd("playVideo"); 29 CNLiveProbe.onEventEnd("playVideo");
27 } 30 }
28 } 31 }