Commit 565dc81df4cf4a05785b9a8703f173f4864664ce
1 parent
c0b426ae
更新SDK ,添加混淆代码
Showing
8 changed files
with
24 additions
and
18 deletions
.idea/misc.xml
| ... | ... | @@ -37,7 +37,7 @@ |
| 37 | 37 | <ConfirmationsSetting value="0" id="Add" /> |
| 38 | 38 | <ConfirmationsSetting value="0" id="Remove" /> |
| 39 | 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 | 41 | <output url="file://$PROJECT_DIR$/build/classes" /> |
| 42 | 42 | </component> |
| 43 | 43 | <component name="ProjectType"> | ... | ... |
app/build.gradle
| ... | ... | @@ -11,10 +11,19 @@ android { |
| 11 | 11 | versionName "1.0" |
| 12 | 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 | 22 | buildTypes { |
| 15 | 23 | release { |
| 16 | - minifyEnabled false | |
| 24 | + minifyEnabled true | |
| 17 | 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 | 2 | <manifest xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | 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 | 11 | <application |
| 12 | + android:name=".CNLiveApplication" | |
| 6 | 13 | android:allowBackup="true" |
| 7 | 14 | android:icon="@mipmap/ic_launcher" |
| 8 | 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 | 11 | protected void onCreate(Bundle savedInstanceState) { |
| 12 | 12 | super.onCreate(savedInstanceState); |
| 13 | 13 | setContentView(R.layout.activity_main); |
| 14 | + //统计次数 | |
| 14 | 15 | CNLiveProbe.onEvent("playVideo"); |
| 15 | 16 | } |
| 16 | 17 | |
| 17 | 18 | @Override |
| 18 | 19 | protected void onStart() { |
| 19 | 20 | super.onStart(); |
| 21 | + //统计时长 开始 | |
| 20 | 22 | CNLiveProbe.onEventBegin("playVideo"); |
| 21 | 23 | } |
| 22 | 24 | |
| 23 | 25 | @Override |
| 24 | 26 | protected void onPause() { |
| 25 | 27 | super.onPause(); |
| 28 | + //统计时长 结束 | |
| 26 | 29 | CNLiveProbe.onEventEnd("playVideo"); |
| 27 | 30 | } |
| 28 | 31 | } | ... | ... |