Skip to content

Commit

Permalink
change 2 to 12 word validation, ui fixes, 255
Browse files Browse the repository at this point in the history
  • Loading branch information
MIPPL committed Feb 4, 2020
1 parent f487de9 commit ec79657
Show file tree
Hide file tree
Showing 17 changed files with 207 additions and 82 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
Binary file modified .idea/caches/gradle_models.ser
Binary file not shown.
134 changes: 109 additions & 25 deletions .idea/codeStyles/Project.xml

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

6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId = 'com.wagerrwallet'
minSdkVersion 23
targetSdkVersion 28
versionCode 253
versionName "253"
versionCode 255
versionName "255"
multiDexEnabled true

// Similar to other properties in the defaultConfig block,
Expand Down Expand Up @@ -50,7 +50,7 @@ android {
wagerr {
applicationId = "com.wagerrwallet"
dimension "mode"
resValue "string", "app_name", "Wagerr Bet"
resValue "string", "app_name", "Wagerr Pro"
buildConfigField "boolean", "BITCOIN_TESTNET", "false"
externalNativeBuild {
cmake {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ public void updateSports() {
BetMappingEntity bmeS = (BetMappingEntity)mSpinnerSport.getSelectedItem();

// add item 0
sports.add(0, new BetMappingEntity("",0, BetMappingEntity.MappingNamespaceType.SPORT, -1, "<Sport>",0,0,"wgr"));
sports.add(0, new BetMappingEntity("",0, BetMappingEntity.MappingNamespaceType.SPORT, -1, "Sport",0,0,"wgr"));
currPosition = findItemIndex( bmeS, sports);

ArrayAdapter<BetMappingEntity> dataAdapter = getDataAdapter(sports);
Expand All @@ -353,11 +353,11 @@ public void updateTournaments() {
sportID = bmeS.getMappingID();
tournaments = bmds.getAllTournaments(this, "wgr", sportID, timeStamp );
// add item 0
tournaments.add(0, new BetMappingEntity("",0, BetMappingEntity.MappingNamespaceType.TOURNAMENT, -1, "<Tournament>",0,0,"wgr"));
tournaments.add(0, new BetMappingEntity("",0, BetMappingEntity.MappingNamespaceType.TOURNAMENT, -1, "League",0,0,"wgr"));
currPosition = findItemIndex( bmeT, tournaments);
}
else {
tournaments.add(0, new BetMappingEntity("",0, BetMappingEntity.MappingNamespaceType.TOURNAMENT, -1, "<Tournament>",0,0,"wgr"));
tournaments.add(0, new BetMappingEntity("",0, BetMappingEntity.MappingNamespaceType.TOURNAMENT, -1, "League",0,0,"wgr"));
}

ArrayAdapter<BetMappingEntity> dataAdapter = getDataAdapter(tournaments);
Expand Down Expand Up @@ -563,7 +563,7 @@ private void setPriceTags(final boolean cryptoPreferred, boolean animate) {

// Align crypto balance to the right parent
set.connect(R.id.balance_secondary, ConstraintSet.END, ConstraintSet.PARENT_ID, ConstraintSet.END, px8);
set.connect(R.id.balance_secondary, ConstraintSet.BOTTOM, ConstraintSet.PARENT_ID, ConstraintSet.BOTTOM, -px8);
set.connect(R.id.balance_secondary, ConstraintSet.TOP, R.id.currency_usd_price, ConstraintSet.BOTTOM, -px8);

// Align swap icon to left of crypto balance
set.connect(R.id.swap, ConstraintSet.END, R.id.balance_secondary, ConstraintSet.START, px8);
Expand All @@ -572,7 +572,7 @@ private void setPriceTags(final boolean cryptoPreferred, boolean animate) {
set.connect(R.id.balance_primary, ConstraintSet.END, R.id.swap, ConstraintSet.START, px8);

mBalancePrimary.setPadding(0, 0, 0, Utils.getPixelsFromDps(this, 6));
mBalanceSecondary.setPadding(0, 0, 0, Utils.getPixelsFromDps(this, 4));
mBalanceSecondary.setPadding(0, Utils.getPixelsFromDps(this, 6), 0, Utils.getPixelsFromDps(this, 4));
mSwap.setPadding(0, 0, 0, Utils.getPixelsFromDps(this, 2));

Log.d(TAG, "CryptoPreferred " + cryptoPreferred);
Expand All @@ -598,7 +598,7 @@ private void setPriceTags(final boolean cryptoPreferred, boolean animate) {
set.connect(R.id.balance_secondary, ConstraintSet.END, R.id.swap, ConstraintSet.START, px8);

mBalancePrimary.setPadding(0, 0, 0, Utils.getPixelsFromDps(this, 2));
mBalanceSecondary.setPadding(0, 0, 0, Utils.getPixelsFromDps(this, 4));
mBalanceSecondary.setPadding(0, Utils.getPixelsFromDps(this, 6), 0, Utils.getPixelsFromDps(this, 4));
mSwap.setPadding(0, 0, 0, Utils.getPixelsFromDps(this, 2));

//mBalancePrimary.setPadding(0,0, 0, Utils.getPixelsFromDps(this, -4));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.wagerrwallet.presenter.activities.intro.IntroActivity;
import com.wagerrwallet.presenter.activities.util.BRActivity;
import com.wagerrwallet.presenter.customviews.BRDialogView;
import com.wagerrwallet.presenter.interfaces.BROnSignalCompletion;
import com.wagerrwallet.tools.animation.BRAnimator;
import com.wagerrwallet.tools.animation.BRDialog;
import com.wagerrwallet.tools.animation.SpringAnimator;
Expand Down Expand Up @@ -58,6 +59,7 @@ public static InputWordsActivity getApp() {
//will be true if this screen was called from the restore screen
private boolean restore = false;
private boolean resetPin = false;
private boolean validateSeed = false;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand Down Expand Up @@ -134,6 +136,7 @@ public void onClick(View v) {

restore = getIntent().getExtras() != null && getIntent().getExtras().getBoolean("restore");
resetPin = getIntent().getExtras() != null && getIntent().getExtras().getBoolean("resetPin");
validateSeed = getIntent().getExtras() != null && getIntent().getExtras().getBoolean("validateSeed");

if (restore) {
//change the labels
Expand All @@ -143,6 +146,10 @@ public void onClick(View v) {
//change the labels
title.setText(getString(R.string.RecoverWallet_header_reset_pin));
description.setText(getString(R.string.RecoverWallet_subheader_reset_pin));
} else if (validateSeed) {
//change the labels
title.setText(getString(R.string.SecurityCenter_paperKeyTitle));
description.setText(getString(R.string.ConfirmPaperPhrase_label12));
}

word12.setOnEditorActionListener(new TextView.OnEditorActionListener() {
Expand Down Expand Up @@ -173,7 +180,7 @@ public void onClick(View v) {
}
if (SmartValidator.isPaperKeyValid(app, cleanPhrase)) {

if (restore || resetPin) {
if (restore || resetPin || validateSeed) {
if (SmartValidator.isPaperKeyCorrect(cleanPhrase, app)) {
Utils.hideKeyboard(app);
clearWords();
Expand All @@ -196,11 +203,21 @@ public void onClick(BRDialogView brDialogView) {
}
}, null, 0);

} else {
} else if (resetPin) {
AuthManager.getInstance().setPinCode("", InputWordsActivity.this);
Intent intent = new Intent(app, SetPinActivity.class);
intent.putExtra("noPin", true);
finalizeIntent(intent);
} else if (validateSeed) {
BRSharedPrefs.putPhraseWroteDown(InputWordsActivity.this, true);
BRAnimator.showBreadSignal(InputWordsActivity.this, getString(R.string.Alerts_paperKeySet), getString(R.string.Alerts_paperKeySetSubheader), R.drawable.ic_check_mark_white, new BROnSignalCompletion() {
@Override
public void onComplete() {
BRAnimator.startBreadActivity(InputWordsActivity.this, false);
overridePendingTransition(R.anim.enter_from_right, R.anim.exit_to_left);
finishAffinity();
}
});
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public void checkLatestVersion(final Activity app) {
Log.d("MyApp", "Version Name : "+version + "\n Version Code : "+versionCode);
if (versionCode < tag) {
//BRDialog.showSimpleDialog(app, "New version available", "A new version of Wagerr Bet app is available");
BRDialog.showCustomDialog(app, "New version available", "A new version of Wagerr Bet app is available", app.getString(R.string.Button_ok), null, new BRDialogView.BROnClickListener() {
BRDialog.showCustomDialog(app, "New version available", "A new version of Wagerr Pro app is available", app.getString(R.string.Button_ok), null, new BRDialogView.BROnClickListener() {
@Override
public void onClick(BRDialogView brDialogView) {
brDialogView.dismiss();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -724,9 +724,9 @@ public void run() {
});

// Set the transaction block number
mConfirmedInBlock.setText(String.valueOf(mTransaction.getBlockheight()));


String confirmedBlock = String.valueOf(mTransaction.getBlockheight());
if ( confirmedBlock.equals(BRConstants.INT23_MAX)) confirmedBlock = "Unconfirmed";
mConfirmedInBlock.setText(confirmedBlock);
/*
mToFrom.setText(sent ? "To " : "Via ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,9 @@ public void onClick(View v) {
});

// Set the transaction block number
mConfirmedInBlock.setText(String.valueOf(mTransaction.getBlockHeight()));
String confirmedBlock = String.valueOf(mTransaction.getBlockHeight());
if ( confirmedBlock.equals(BRConstants.INT23_MAX)) confirmedBlock = "Unconfirmed";
mConfirmedInBlock.setText(confirmedBlock);

} else {
Toast.makeText(getContext(), "Error getting transaction data", Toast.LENGTH_SHORT).show();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ public void onClick(BRDialogView brDialogView) {
}
}, null, null, 0);
}
BRAnimator.showEventDetails(app, item, position);
else {
BRAnimator.showEventDetails(app, item, position);
}
}
catch (ArrayIndexOutOfBoundsException e) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.wagerrwallet.core.BRCoreKey;
import com.wagerrwallet.core.BRCoreMasterPubKey;
import com.wagerrwallet.core.BRCoreTransaction;
import com.wagerrwallet.presenter.activities.InputWordsActivity;
import com.wagerrwallet.presenter.activities.SetPinActivity;
import com.wagerrwallet.presenter.activities.PaperKeyActivity;
import com.wagerrwallet.presenter.activities.PaperKeyProveActivity;
Expand Down Expand Up @@ -130,8 +131,10 @@ public void onPhraseProveAuth(Activity app, boolean authAsked) {
}
return;
}
Intent intent = new Intent(app, PaperKeyProveActivity.class);
intent.putExtra("phrase", cleanPhrase);
//Intent intent = new Intent(app, PaperKeyProveActivity.class);
//intent.putExtra("phrase", cleanPhrase);
Intent intent = new Intent(app, InputWordsActivity.class);
intent.putExtra("validateSeed", true);
app.startActivity(intent);
app.overridePendingTransition(R.anim.enter_from_right, R.anim.exit_to_left);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public class BRConstants {
public static boolean PLATFORM_ON = true;
public static final RoundingMode ROUNDING_MODE = RoundingMode.HALF_EVEN;
public static final boolean WAL = true;
public static final String INT23_MAX = "2147483647";

/**
* Support Center article ids.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ protected void CleanChainBugs(Context app) {
BetMappingTxDataStore.getInstance(app).deleteTxByHash(app,"wgr", "cc89779e8e57d49e5e6d3e16ad57e648b19d86fb8f4714bc7df5abd3f92daa1d");
BetMappingTxDataStore.getInstance(app).deleteTxByHash(app,"wgr", "d8e1e8389bbcffe1c79cf11e2206281377e54b99219ec6ccec296c2adb8ad65f");
BetMappingTxDataStore.getInstance(app).deleteTxByHash(app,"wgr", "929972a7b2fdf55f6da7488ccaf7312fd5d22c4bca003ca089293c93f1c32917");
BetMappingTxDataStore.getInstance(app).deleteTxByHash(app,"wgr", "e4e3a4f782569fa3bf0135297942c8a1c791ec869ca036bf530ab95633d17815");
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/jni/breadwallet-core
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_betsettings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
android:layout_marginStart="@dimen/bread_margin"
android:layout_marginTop="32dp"
android:lineSpacingMultiplier="1.3"
android:text="Wagerr Bet Display Settings"
android:text="Wagerr Pro Display Settings"
android:textColor="@color/almost_black"
android:textSize="@dimen/header"
app:customTFont="CircularPro-Bold.otf"
Expand Down
Loading

0 comments on commit ec79657

Please sign in to comment.