|
|
@ -137,7 +137,7 @@ public class MainActivity extends AppCompatActivity { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void onClick(DialogInterface dialog, int which) { |
|
|
|
public void onClick(DialogInterface dialog, int which) { |
|
|
|
mAppUpdater = new AppUpdater.Builder() |
|
|
|
mAppUpdater = new AppUpdater.Builder() |
|
|
|
.serUrl(mUrl) |
|
|
|
.setUrl(mUrl) |
|
|
|
.build(getContext()) |
|
|
|
.build(getContext()) |
|
|
|
.setUpdateCallback(new AppUpdateCallback() { |
|
|
|
.setUpdateCallback(new AppUpdateCallback() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -188,7 +188,7 @@ public class MainActivity extends AppCompatActivity { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void onClick(View v) { |
|
|
|
public void onClick(View v) { |
|
|
|
mAppUpdater = new AppUpdater.Builder() |
|
|
|
mAppUpdater = new AppUpdater.Builder() |
|
|
|
.serUrl(mUrl) |
|
|
|
.setUrl(mUrl) |
|
|
|
.build(getContext()); |
|
|
|
.build(getContext()); |
|
|
|
mAppUpdater.start(); |
|
|
|
mAppUpdater.start(); |
|
|
|
AppDialog.INSTANCE.dismissDialog(); |
|
|
|
AppDialog.INSTANCE.dismissDialog(); |
|
|
@ -221,7 +221,7 @@ public class MainActivity extends AppCompatActivity { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void onClick(View v) { |
|
|
|
public void onClick(View v) { |
|
|
|
mAppUpdater = new AppUpdater.Builder() |
|
|
|
mAppUpdater = new AppUpdater.Builder() |
|
|
|
.serUrl(mUrl) |
|
|
|
.setUrl(mUrl) |
|
|
|
// .setPath(Environment.getExternalStorageDirectory() + "/.AppUpdater")//如果适配Android Q,则Environment.getExternalStorageDirectory()将废弃
|
|
|
|
// .setPath(Environment.getExternalStorageDirectory() + "/.AppUpdater")//如果适配Android Q,则Environment.getExternalStorageDirectory()将废弃
|
|
|
|
// .setPath(getExternalFilesDir(Constants.DEFAULT_DIR).getAbsolutePath())//自定义路径,推荐使用默认
|
|
|
|
// .setPath(getExternalFilesDir(Constants.DEFAULT_DIR).getAbsolutePath())//自定义路径,推荐使用默认
|
|
|
|
// .setApkMD5("3df5b1c1d2bbd01b4a7ddb3f2722ccca")//支持MD5校验,如果缓存APK的MD5与此MD5相同,则直接取本地缓存安装,推荐使用MD5校验的方式
|
|
|
|
// .setApkMD5("3df5b1c1d2bbd01b4a7ddb3f2722ccca")//支持MD5校验,如果缓存APK的MD5与此MD5相同,则直接取本地缓存安装,推荐使用MD5校验的方式
|
|
|
@ -249,7 +249,7 @@ public class MainActivity extends AppCompatActivity { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void onClick(View v) { |
|
|
|
public void onClick(View v) { |
|
|
|
mAppUpdater = new AppUpdater.Builder() |
|
|
|
mAppUpdater = new AppUpdater.Builder() |
|
|
|
.serUrl(mUrl) |
|
|
|
.setUrl(mUrl) |
|
|
|
.setVibrate(true) |
|
|
|
.setVibrate(true) |
|
|
|
.setSound(true) |
|
|
|
.setSound(true) |
|
|
|
.build(getContext()); |
|
|
|
.build(getContext()); |
|
|
|