Skip to content

Commit

Permalink
try to show updated dialog if device is udpated
Browse files Browse the repository at this point in the history
  • Loading branch information
androidlover5842 committed Dec 21, 2016
1 parent aa6ed67 commit 20a7d86
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Updater.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<RomUpdater>
<update>
<RomLatestVersion>20161230</RomLatestVersion>
<RomLatestVersion>20161220</RomLatestVersion>
<URL>https://github.com/Arubadel/Arubadel/releases/download/untagged-71b60b7351492a2477d1/app-release.apk</URL>
<Changelog>
- Test Updater
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import io.github.otaupdater.otalibary.objects.Update;
import io.github.otaupdater.otaupdater.R;

import static io.github.otaupdater.otalibary.UtilsLibrary.getRomInstalledVersion;
import static io.github.otaupdater.otaupdater.util.Config.Showlog;
import static io.github.otaupdater.otaupdater.util.Config.UpdaterUri;

Expand Down Expand Up @@ -104,6 +105,25 @@ public void onClick(View view) {
{
Log.d("Found", String.valueOf(update.getUrlToDownload()));
}
if(getRomInstalledVersion().equals(true)){
mProgressBar.setVisibility(View.GONE);
if(Showlog().equals(true));
{
Log.i(Tag, "Device is up to date "+String.valueOf(isUpdateAvailable));
}
mNoUpdate.setTitle("Device is updated already");
mNoUpdate.setDialogType(PromptDialog.DIALOG_TYPE_SUCCESS)
.setAnimationEnable(true)
.setTitleText("Your device is updated already")
.setPositiveListener("Ok", new PromptDialog.OnPositiveListener() {
@Override
public void onClick(PromptDialog dialog) {
mNoUpdate.dismiss();
finish();
}
}).show();

}
}
}
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import okhttp3.Response;
import okhttp3.ResponseBody;

class UtilsLibrary {
public class UtilsLibrary {

static String getRomName(Context context) {
return context.getString(context.getApplicationInfo().labelRes);
Expand All @@ -35,7 +35,7 @@ static String getRomPackageName(Context context) {
return context.getPackageName();
}

static String getRomInstalledVersion() {
public static String getRomInstalledVersion() {
String version;
ShellExecuter.command="getprop ro.rom.version";
version=ShellExecuter.runAsRoot();
Expand Down

0 comments on commit 20a7d86

Please sign in to comment.