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 9e34716..841f59d 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 @@ -158,7 +158,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 b9473d1..80caae0 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());