Skip to content

Commit

Permalink
增加了升级功能
Browse files Browse the repository at this point in the history
  • Loading branch information
jikun2008 committed Aug 8, 2017
1 parent 7b5f98f commit 828bc5e
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 9 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "com.yisingle.app"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
versionCode 2
versionName "1.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
jackOptions {
Expand Down
2 changes: 2 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,7 @@
# hide the original source file name.
#-renamesourcefileattribute SourceFile

#腾讯升级框架
-dontwarn com.tencent.bugly.**
-keep public class com.tencent.bugly.**{*;}
-keep class android.support.**{*;}
20 changes: 19 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_CONFIGURATION" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.READ_LOGS" />
<uses-permission android:name="android.permission.CALL_PHONE" />

<!-- 不是sdk需要的权限,是示例中NotiService$NotiInnerService需要的权限 -->
Expand All @@ -34,7 +35,6 @@
<application
android:name=".MainApplication"
android:allowBackup="true"
android:fullBackupContent="@xml/backup_descriptor"
android:icon="@mipmap/ic_product_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
Expand Down Expand Up @@ -67,6 +67,8 @@

</activity>



<!-- 定位需要的服务 使用2.0的定位需要加上这个 -->
<service android:name="com.amap.api.location.APSService" />
<service android:name=".service.OrderService"></service>
Expand Down Expand Up @@ -98,6 +100,22 @@
</receiver>


<!---bugly升级-->
<activity
android:name="com.tencent.bugly.beta.ui.BetaActivity"
android:configChanges="keyboardHidden|orientation|screenSize|locale"
android:theme="@android:style/Theme.Translucent" />

<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="com.yisingle.app.fileProvider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths"/>
</provider>

</application>

</manifest>
6 changes: 4 additions & 2 deletions app/src/main/java/com/yisingle/app/MainApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import com.orhanobut.logger.FormatStrategy;
import com.orhanobut.logger.Logger;
import com.orhanobut.logger.PrettyFormatStrategy;
import com.tencent.bugly.crashreport.CrashReport;
import com.tencent.bugly.Bugly;

/**
* Created by jikun on 17/5/12.
Expand All @@ -33,7 +33,9 @@ public void onCreate() {
initLogger();

Utils.init(getApplicationContext());//初始化AndroidUtilCode
CrashReport.initCrashReport(getApplicationContext(), "8856cf1479", false);


Bugly.init(getApplicationContext(), "8856cf1479", false);//使用腾讯Bugly 开进行升级 保存bug

}

Expand Down
4 changes: 0 additions & 4 deletions app/src/main/res/xml/backup_descriptor.xml

This file was deleted.

7 changes: 7 additions & 0 deletions app/src/main/res/xml/provider_paths.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<!-- /storage/emulated/0/Download/${applicationId}/.beta/apk-->
<external-path name="beta_external_path" path="Download/"/>
<!--/storage/emulated/0/Android/data/${applicationId}/files/apk/-->
<external-path name="beta_external_files_path" path="Android/data/"/>
</paths>

0 comments on commit 828bc5e

Please sign in to comment.