Skip to content

Commit

Permalink
try to get url from build.prop
Browse files Browse the repository at this point in the history
  • Loading branch information
androidlover5842 committed Dec 20, 2016
1 parent 35771fc commit 3b53428
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import io.github.otaupdater.otalibary.enums.UpdateFrom;
import io.github.otaupdater.otalibary.objects.Update;

import static io.github.otaupdater.otaupdater.Config.UpdaterUri;

/**
* Created by sumit on 18/12/16.
*/
Expand All @@ -36,7 +38,7 @@ public int onStartCommand(Intent intent, int flags, int startId) {
checkPermission();
RomUpdaterUtils romUpdaterUtils = new RomUpdaterUtils(this)
.setUpdateFrom(UpdateFrom.XML)
.setUpdateXML("https://raw.githubusercontent.com/Grace5921/OtaUpdater/master/Updater.xml")
.setUpdateXML(UpdaterUri())
.withListener(new RomUpdaterUtils.UpdateListener() {
@Override
public void onSuccess(final Update update, Boolean isUpdateAvailable) {
Expand Down
22 changes: 22 additions & 0 deletions app/src/main/java/io/github/otaupdater/otaupdater/Config.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package io.github.otaupdater.otaupdater;

import android.util.Log;

import io.github.otaupdater.otalibary.util.ShellExecuter;

/**
* Created by sumit on 20/12/16.
*/

public class Config {
public static String UpdaterUri(){
ShellExecuter.command="getprop ro.updater.uri";
String Output=ShellExecuter.runAsRoot();
if(Output==null)
{
Log.d("RomUpdater","Try to add Custom Url in Config.java");
Output="";
}
return Output;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import io.github.otaupdater.otalibary.enums.UpdateFrom;
import io.github.otaupdater.otalibary.objects.Update;

;
;import static io.github.otaupdater.otaupdater.Config.UpdaterUri;

public class MainActivity extends AppCompatActivity {
private PanterDialog UpdaterDialog;
Expand All @@ -30,7 +30,7 @@ protected void onCreate(Bundle savedInstanceState) {
ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 100);
RomUpdaterUtils romUpdaterUtils = new RomUpdaterUtils(this)
.setUpdateFrom(UpdateFrom.XML)
.setUpdateXML("https://raw.githubusercontent.com/Grace5921/OtaUpdater/master/Updater.xml")
.setUpdateXML(UpdaterUri())
.withListener(new RomUpdaterUtils.UpdateListener() {
@Override
public void onSuccess(final Update update, Boolean isUpdateAvailable) {
Expand Down

0 comments on commit 3b53428

Please sign in to comment.