Skip to content

Commit

Permalink
update abcore to core 0.17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
greenaddress committed Oct 2, 2018
1 parent 0c44eb7 commit 6dcab58
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
9 changes: 7 additions & 2 deletions app/src/main/java/com/greenaddress/abcore/ABCoreService.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Build;
import android.os.IBinder;
import android.preference.PreferenceManager;
import android.text.TextUtils;
import android.util.Log;

Expand Down Expand Up @@ -44,19 +46,22 @@ private void setupNotification() {
final PendingIntent pI;
pI = PendingIntent.getActivity(this, 0, i, PendingIntent.FLAG_ONE_SHOT);
final NotificationManager nM = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);

final String version = prefs.getBoolean("useknots", false) ? Packages.BITCOIN_KNOTS_NDK : Packages.BITCOIN_NDK;

final Notification.Builder b = new Notification.Builder(this)
.setContentTitle("ABCore is running")
.setContentIntent(pI)
.setContentText(String.format("Version %s", Packages.BITCOIN_NDK))
.setContentText(String.format("Version %s", version))
.setSmallIcon(R.drawable.ic_info_black_24dp)
.setOngoing(true);

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
final int importance = NotificationManager.IMPORTANCE_LOW;

final NotificationChannel mChannel = new NotificationChannel("channel_00", "ABCore", importance);
mChannel.setDescription(String.format("Version %s", Packages.BITCOIN_NDK));
mChannel.setDescription(String.format("Version %s", version));
mChannel.enableLights(true);
mChannel.enableVibration(true);
mChannel.setVibrationPattern(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@ private void sendUpdate(final String upd, final Integer bytesPerSec, final Integ
if (bytesPerSec != null)
broadcastIntent.putExtra("ABCOREUPDATESPEED", bytesPerSec);

broadcastIntent.putExtra("ABCOREUPDATETXT", String.format("%s %s %s", upd, fileExtracted, Packages.BITCOIN_NDK));


broadcastIntent.putExtra("ABCOREUPDATETXT", String.format("%s %s %s", upd, fileExtracted, fileExtracted.equals("knots") ? Packages.BITCOIN_KNOTS_NDK : Packages.BITCOIN_NDK));


sendBroadcast(broadcastIntent);
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/greenaddress/abcore/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ private void postStart() {
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);

final String useDistribution = prefs.getString("usedistribution", prefs.getBoolean("useknots", false) ? "knots" : "core");
mTvStatus.setText(getString(R.string.runningturnoff, useDistribution, Packages.BITCOIN_NDK));
mTvStatus.setText(getString(R.string.runningturnoff, useDistribution, useDistribution.equals("knots") ? Packages.BITCOIN_KNOTS_NDK : Packages.BITCOIN_NDK));
if (!mSwitchCore.isChecked())
mSwitchCore.setChecked(true);
mSwitchCore.setText(R.string.switchcoreoff);
Expand All @@ -56,7 +56,7 @@ private void postConfigure() {
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);

final String useDistribution = prefs.getString("usedistribution", prefs.getBoolean("useknots", false) ? "knots" : "core");
mTvStatus.setText(getString(R.string.stoppedturnon, useDistribution, Packages.BITCOIN_NDK));
mTvStatus.setText(getString(R.string.stoppedturnon, useDistribution, useDistribution.equals("knots") ? Packages.BITCOIN_KNOTS_NDK : Packages.BITCOIN_NDK));
if (mSwitchCore.isChecked())
mSwitchCore.setChecked(false);
mSwitchCore.setText(R.string.switchcoreon);
Expand Down
14 changes: 8 additions & 6 deletions app/src/main/java/com/greenaddress/abcore/Packages.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@

class Packages {

final static String BITCOIN_NDK = "0.16.3";
final static String BITCOIN_NDK = "0.17.0";
final static String BITCOIN_KNOTS_NDK = "0.16.3";

private final static String URL = "https://github.com/greenaddress/bitcoin_ndk/releases/download/v0.16.3/%s_bitcoin%s.tar.gz";

private final static String URL = "https://github.com/greenaddress/bitcoin_ndk/releases/download/v0.17.0/%s_bitcoin%s.tar.gz";
private final static String URL_KNOTS = "https://github.com/greenaddress/bitcoin_ndk/releases/download/v0.16.3/%s_bitcoin%s.tar.gz";


final static List<String> NATIVE_CORE = Arrays.asList(
"3820644arm-linux-androideabi0c9988853f1c4d37912cd8787f385df61cda0e3150655c74db9573c6838f93ed",
"3818557aarch64-linux-androidd52dbc4078dfdd41f75be08a97968e8ef7d1c0810a0ff85890a042cf5d6b246d",
"4176548x86_64-linux-androidbb37ad7e63792e15c75f225ccaf1d5b73b4acd881653d4780e933e8d771cb030",
"4088035i686-linux-androidc585a3293cbc968eab684b1a1c76b6ee854d710402c17304eb9848c75c826425"
"3825885arm-linux-androideabib4b3be79c859c83ca02ac12b70fceb3e800eb15580addd7b48bb1b896a32c302",
"3903585aarch64-linux-android51c129708b2ae4a4bc223fff1b486d6a62cabbfaaf6b8b7a9ef3aa71ac8f1ab8",
"4250511x86_64-linux-androide688b8592e660c52c39aba98ec141d1799f501bdd23af2f9e3fdb60541b3b466",
"4127210i686-linux-android5ae74105f98e0e0737ef40950f0078d3b504c50b34348bfb93a76f7cc37379da"
);


Expand Down

0 comments on commit 6dcab58

Please sign in to comment.