Skip to content

Commit

Permalink
revert n prepare for koala
Browse files Browse the repository at this point in the history
  • Loading branch information
justinvforvendetta committed Jul 25, 2024
1 parent 7c4d093 commit c33127b
Show file tree
Hide file tree
Showing 166 changed files with 1,104 additions and 214 deletions.
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
Verge Tor Wallet for Android
============================

<p align="left"><img src="https://image.pngaaa.com/864/15864-small.png" alt="android logo"></p>

## Building the app

Install [Android Studio](https://developer.android.com/sdk/installing/studio.html). Once it is
running, import tordroid by navigating to where you cloned or downloaded it and selecting
settings.gradle. When it is finished importing, click on the SDK Manager ![SDK Manager](https://developer.android.com/images/tools/sdk-manager-studio.png).
You will want to install Android 15, SDK version 35 (API 35).
You will want to install Android 13, SDK version 33 (API 33).
<br/><br/>
Make sure that you have JDK 17 installed before building.
You can get it [here from Oracle (login required)](https://www.oracle.com/java/technologies/downloads/?er=221886#java17).
Make sure that you have JDK 11 installed before building.
You can get it [here from Oracle (login required)](https://www.oracle.com/pk/java/technologies/javase/jdk11-archive-downloads.html).
Once you have that installed, navigate to File > Project Structure > SDK Location and change the path of your current JDK to
the path of the new JDK.
<br/><br/>
Expand All @@ -24,4 +26,7 @@ and enable USB Debugging.
Then plug your phone into your computer and hit the green play button at the top of
Android Studio. It will load for a moment before prompting you to select which device to install
it on. Select your device from the list, and hit continue.
<br/>
<br/><br/>
**NOTE**
If you are attempting to build on a Lollipop emulator, please ensure that you are using *Android 5.*.* armeabi-v7*.
It will not build on an x86/x86_64 emulator.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.5.1'
classpath 'com.android.tools.build:gradle:8.0.2'
// classpath 'org.robolectric:robolectric-gradle-plugin:0.11.+'

// NOTE: Do not place your application dependencies here; they belong
Expand Down
8 changes: 4 additions & 4 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ dependencies {
api 'com.google.code.findbugs:jsr305:3.0.2' //latest as of 10/2023
api 'com.madgag.spongycastle:core:1.58.0.0' //latest as of 10/2023
api 'com.lambdaworks:scrypt:1.4.0' //latest as of 10/2023
api 'com.google.protobuf:protobuf-java:3.25.3' // updated on 7/22/2024
api 'org.slf4j:slf4j-jdk14:2.0.13' //latest release ver as of 7/22/2024
api 'org.json:json:20240303' //latest as of 7/22/2024
api 'com.google.protobuf:protobuf-java:3.24.3' //latest as of 9/23
api 'org.slf4j:slf4j-jdk14:2.0.9' //latest release ver as of 10/23
api 'org.json:json:20231013' //latest as of 10/23
api 'com.squareup.okhttp:okhttp:2.7.5' //latest as of 10/23

testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-all:1.10.19'
testImplementation 'org.mockito:mockito-all:1.9.5'
testImplementation 'com.squareup.okhttp:mockwebserver:2.7.5'
}

Expand Down
23 changes: 23 additions & 0 deletions core/src/main/java/com/verge/core/coins/families/ClamsFamily.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.vergepay.core.coins.families;

import com.vergepay.core.messages.MessageFactory;
import com.vergepay.core.wallet.families.clams.ClamsTxMessage;

import javax.annotation.Nullable;

/**
* @author John L. Jegutanis
*
* This family contains Clams
*/
public class ClamsFamily extends BitFamily {
{
family = Families.CLAMS;
}

@Override
@Nullable
public MessageFactory getMessagesFactory() {
return ClamsTxMessage.getFactory();
}
}
12 changes: 12 additions & 0 deletions core/src/main/java/com/verge/core/coins/families/NuFamily.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.vergepay.core.coins.families;

/**
* @author John L. Jegutanis
*
* This family contains NuBits, NuShares, BlockShares, etc
*/
public abstract class NuFamily extends BitFamily {
{
family = Families.NUBITS;
}
}
12 changes: 12 additions & 0 deletions core/src/main/java/com/verge/core/coins/families/ReddFamily.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.vergepay.core.coins.families;

/**
* @author John L. Jegutanis
*
* This family contains Reddcoin, Cannacoin, etc
*/
public abstract class ReddFamily extends BitFamily {
{
family = Families.REDDCOIN;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.vergepay.core.coins.families;

import com.vergepay.core.messages.MessageFactory;
import com.vergepay.core.wallet.families.vpncoin.VpncoinTxMessage;

import javax.annotation.Nullable;

/**
* @author John L. Jegutanis
*
* This family contains Vpncoin
*/
public abstract class VpncoinFamily extends BitFamily {
{
family = Families.VPNCOIN;
}

@Override
@Nullable
public MessageFactory getMessagesFactory() {
return VpncoinTxMessage.getFactory();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.vergepay.core.coins.CoinType;
import com.vergepay.core.coins.families.BitFamily;
import com.vergepay.core.coins.families.NxtFamily;
import com.vergepay.core.exceptions.UnsupportedCoinTypeException;
import com.vergepay.core.network.interfaces.BlockchainConnection;
import com.vergepay.core.wallet.WalletAccount;
Expand Down Expand Up @@ -75,6 +76,11 @@ private BlockchainConnection getConnection(CoinType type) {
client.setCacheDir(cacheDir, cacheSize);
connections.put(type, client);
return client;
} else if (type instanceof NxtFamily) {
NxtServerClient client = new NxtServerClient(addresses.get(type), connectivityHelper);
client.setCacheDir(cacheDir, cacheSize);
connections.put(type, client);
return client;
} else {
throw new UnsupportedCoinTypeException(type);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

/*
* Copyright 2012, 2014 the original author or authors.
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
Expand All @@ -14,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
*/

package com.vergepay.core.uri;
Expand Down Expand Up @@ -81,7 +80,7 @@
* <li>{@code label} any URL encoded alphanumeric</li>
* <li>{@code message} any URL encoded alphanumeric</li>
* </ul>
*
*
* @author Andreas Schildbach (initial code)
* @author Jim Burton (enhancements for MultiBit)
* @author Gary Rowe (BIP21 support)
Expand Down Expand Up @@ -149,7 +148,7 @@ public CoinURI(@Nullable CoinType uriType, String input) throws CoinURIParseExce
// URI is formed as bitcoin:<address>?<query parameters>
// blockchain.info generates URIs of non-BIP compliant form bitcoin://address?....
// We support both until Ben fixes his code.

// Remove the bitcoin scheme.
// (Note: getSchemeSpecificPart() is not used as it unescapes the label and parse then fails.
// For instance with : bitcoin:129mVqKUmJ9uwPxKJBnNdABbuaaNfho4Ha?amount=0.06&label=Tom%20%26%20Jerry
Expand Down Expand Up @@ -370,7 +369,7 @@ private void parseParameters(String[] nameValuePairTokens, List<CoinType> possib

/**
* Put the value against the key in the map checking for duplication. This avoids address field overwrite etc.
*
*
* @param key The key for the map
* @param value The value to store
*/
Expand Down Expand Up @@ -480,7 +479,7 @@ public URI getAddressRequestUriResponse(String address) {
}
return null;
}

/**
* @param name The name of the parameter
* @return The parameter value, or null if not present
Expand Down Expand Up @@ -552,30 +551,30 @@ public static String convertToCoinURI(AbstractAddress address, @Nullable Value a
if (amount != null && amount.signum() < 0) {
throw new IllegalArgumentException("Coin must be positive");
}

StringBuilder builder = new StringBuilder();
// Removing appending verge: to all data
// builder.append(type.getUriScheme()).append(":").append(addressStr);
builder.append(addressStr);

boolean questionMarkHasBeenOutput = false;

if (amount != null) {
builder.append(QUESTION_MARK_SEPARATOR).append(FIELD_AMOUNT).append("=");
builder.append(GenericUtils.formatCoinValue(type, amount, true));
questionMarkHasBeenOutput = true;
}

if (label != null && !"".equals(label)) {
if (questionMarkHasBeenOutput) {
builder.append(AMPERSAND_SEPARATOR);
} else {
builder.append(QUESTION_MARK_SEPARATOR);
builder.append(QUESTION_MARK_SEPARATOR);
questionMarkHasBeenOutput = true;
}
builder.append(FIELD_LABEL).append("=").append(encodeURLString(label));
}

if (message != null && !"".equals(message)) {
if (questionMarkHasBeenOutput) {
builder.append(AMPERSAND_SEPARATOR);
Expand All @@ -593,13 +592,13 @@ public static String convertToCoinURI(AbstractAddress address, @Nullable Value a
}
builder.append(FIELD_PUBKEY).append("=").append(encodeURLString(pubkey));
}

return builder.toString();
}

/**
* Encode a string using URL encoding
*
*
* @param stringToEncode The string to URL encode
*/
static String encodeURLString(String stringToEncode) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
import com.vergepay.core.coins.CoinType;
import com.vergepay.core.coins.Value;
import com.vergepay.core.coins.families.BitFamily;
import com.vergepay.core.coins.families.NxtFamily;
import com.vergepay.core.exceptions.UnsupportedCoinTypeException;
import com.vergepay.core.protos.Protos;
import com.vergepay.core.wallet.families.nxt.NxtFamilyWallet;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Splitter;
import com.google.common.collect.ImmutableList;
Expand Down Expand Up @@ -288,6 +290,8 @@ private WalletAccount createAndAddAccount(CoinType coinType, @Nullable KeyParame

if (coinType instanceof BitFamily) {
newPocket = new WalletPocketHD(rootKey, coinType, getKeyCrypter(), key);
} else if (coinType instanceof NxtFamily) {
newPocket = new NxtFamilyWallet(rootKey, coinType, getKeyCrypter(), key);
} else {
throw new UnsupportedCoinTypeException(coinType);
}
Expand Down
Loading

0 comments on commit c33127b

Please sign in to comment.