Skip to content

xinpengfei520/pgyer-android-app-update

Repository files navigation

pgyer-android-app-update

A light-weighted library which can update android app by pgyer App Store.

Download Demo

1.Usage

step 1:

add maven repo supported:

    repositories {
        // ...
        mavenCentral()
    }

add dependency to your build.gradle:

implementation 'io.github.xinpengfei520:PgyerAndroidAppUpdate:<latest-version>'

Lastest version click to here.

then, sync your project, it can download dependency automatically.

if you use AndroidX, you need paste below configuration to your

android.useAndroidX = true
android.enableJetifier = true

step 2:

add below code in your app AndroidManifest.xml file.

    <!-- 蒲公英 apiKey -->
    <meta-data
        android:name="PGYER_API_KEY"
        android:value="your app pgyer apiKey" />
    <!-- 蒲公英 appKey -->
    <meta-data
        android:name="PGYER_APP_KEY"
        android:value="your app pgyer apiKey" />

step 3:

In your Activity or other places, such as MainActivity onCreate() method call method:

PgyerApi.checkUpdate(this);

2.Update Log

v2.0.1

  • 迁移到 Maven Central

v0.9.4

  • 自定义 FileProvider 防止和集成 app 的 FileProvider 冲突;
  • 保证 FileProvider authorities 的唯一性;
  • 抽取几个常量类和工具类;

v0.9.6

  • fix bug;
  • 不能使用固定的 authority,否则通一个手机上无法安装 2 个使用了本库的 APP;

v1.0.0

  • 使用 okhttp3 作为网络请求;
  • 修复请求动态权限有时会出现状态栏白屏的 bug;
  • 其他优化;

v1.0.1

  • 修复bug,不判断响应信息判断 message;

FAQ

okhttp3 依赖库冲突;

内部依赖了 okhttp4.9.0,如果你们的项目也依赖不同版本的 okhttp 可能会导致依赖冲突,可以将你们项目中 okhttp 的版本修改一致或者 使用 exclude 将其剔除即可:

implementation('io.github.xinpengfei520:PgyerAndroidAppUpdate:2.0.1', {
    exclude group: 'com.squareup.okhttp3'
})

LICENSE

Apache2.0