Android 阿里云热修复
生活随笔
收集整理的這篇文章主要介紹了
Android 阿里云热修复
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
2.AndroidManinifest.xml里application中加入以下,在AS中打開在第五步下載的文件
App ID:"hotfix.idSecret"
App Secret:"emas.appSecret"
RSA密鑰:"hotfix.rsaSecret"
3、在app的build.gradle中加入依賴等
plugins { id 'com.android.application'} //加載文件 apply plugin: 'com.aliyun.ams.emas-services'android {compileSdkVersion 30buildToolsVersion '30.0.3'defaultConfig {applicationId "com.wb.hotfixdemo"minSdkVersion 16targetSdkVersion 30versionCode 1versionName "1.0"testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"}buildTypes {release {minifyEnabled falseproguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'}debug {minifyEnabled falseproguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'}}compileOptions {sourceCompatibility JavaVersion.VERSION_1_8targetCompatibility JavaVersion.VERSION_1_8} }dependencies {implementation 'androidx.appcompat:appcompat:1.1.0'implementation 'com.google.android.material:material:1.1.0'implementation 'androidx.constraintlayout:constraintlayout:1.1.3'testImplementation 'junit:junit:4.+'androidTestImplementation 'androidx.test.ext:junit:1.1.1'androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'//阿里云依賴api 'com.aliyun.ams:alicloud-android-hotfix:3.3.0' }4、SophixStubApplication
目前集成已經完畢了,下面就是代碼的實現,新建一個類SophixStubApplication繼承SophixApplication
5、MyRealApplication
public class MyRealApplication extends Application {}6、AndroidManinifest.xml里加入SophixStubApplication
<applicationandroid:name=".SophixStubApplication" //加入此項android:allowBackup="true"android:icon="@mipmap/ic_launcher"android:label="@string/app_name"android:roundIcon="@mipmap/ic_launcher_round"android:supportsRtl="true"android:theme="@style/Theme.HotFixDemo">到這已經完成阿里云熱修復的百分之八十,后面就是下載工具實現發布補丁
總結
以上是生活随笔為你收集整理的Android 阿里云热修复的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 001. Ansible简介
- 下一篇: LeetCode:204. 计数质数