From d3a759374cbe7672f42a5b3a00392ccba5b38ea2 Mon Sep 17 00:00:00 2001 From: Jenly Date: Mon, 1 Mar 2021 09:43:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/king/app/updater/AppUpdater.java | 2 +- app/src/main/java/com/king/appupdater/MainActivity.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app-updater/src/main/java/com/king/app/updater/AppUpdater.java b/app-updater/src/main/java/com/king/app/updater/AppUpdater.java index f854dec..489f972 100644 --- a/app-updater/src/main/java/com/king/app/updater/AppUpdater.java +++ b/app-updater/src/main/java/com/king/app/updater/AppUpdater.java @@ -159,7 +159,7 @@ public class AppUpdater { * @param url 下载地址 * @return */ - public Builder serUrl(@NonNull String url){ + public Builder setUrl(@NonNull String url){ mConfig.setUrl(url); return this; } diff --git a/app/src/main/java/com/king/appupdater/MainActivity.java b/app/src/main/java/com/king/appupdater/MainActivity.java index 5142992..5d6c410 100644 --- a/app/src/main/java/com/king/appupdater/MainActivity.java +++ b/app/src/main/java/com/king/appupdater/MainActivity.java @@ -137,7 +137,7 @@ public class MainActivity extends AppCompatActivity { @Override public void onClick(DialogInterface dialog, int which) { mAppUpdater = new AppUpdater.Builder() - .serUrl(mUrl) + .setUrl(mUrl) .build(getContext()) .setUpdateCallback(new AppUpdateCallback() { @Override @@ -188,7 +188,7 @@ public class MainActivity extends AppCompatActivity { @Override public void onClick(View v) { mAppUpdater = new AppUpdater.Builder() - .serUrl(mUrl) + .setUrl(mUrl) .build(getContext()); mAppUpdater.start(); AppDialog.INSTANCE.dismissDialog(); @@ -221,7 +221,7 @@ public class MainActivity extends AppCompatActivity { @Override public void onClick(View v) { mAppUpdater = new AppUpdater.Builder() - .serUrl(mUrl) + .setUrl(mUrl) // .setPath(Environment.getExternalStorageDirectory() + "/.AppUpdater")//如果适配Android Q,则Environment.getExternalStorageDirectory()将废弃 // .setPath(getExternalFilesDir(Constants.DEFAULT_DIR).getAbsolutePath())//自定义路径,推荐使用默认 // .setApkMD5("3df5b1c1d2bbd01b4a7ddb3f2722ccca")//支持MD5校验,如果缓存APK的MD5与此MD5相同,则直接取本地缓存安装,推荐使用MD5校验的方式 @@ -249,7 +249,7 @@ public class MainActivity extends AppCompatActivity { @Override public void onClick(View v) { mAppUpdater = new AppUpdater.Builder() - .serUrl(mUrl) + .setUrl(mUrl) .setVibrate(true) .setSound(true) .build(getContext());