Skip to content

Commit

Permalink
Merge pull request #12 from SmajeNz0/master
Browse files Browse the repository at this point in the history
Update to 0.6.1 and androidx
  • Loading branch information
ArqTras authored Jan 4, 2021
2 parents 19a1a8c + e00ea50 commit e580ce7
Show file tree
Hide file tree
Showing 162 changed files with 1,312 additions and 1,225 deletions.
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.cxx
.externalNativeBuild
build
app.iml
Expand Down
40 changes: 35 additions & 5 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ add_library(ssl STATIC IMPORTED)
set_target_properties(ssl PROPERTIES IMPORTED_LOCATION
${EXTERNAL_LIBS_DIR}/openssl/lib/${ANDROID_ABI}/libssl.a)

############
# ZMQ
############
add_library(libzmq STATIC IMPORTED)
set_target_properties(libzmq PROPERTIES IMPORTED_LOCATION
${EXTERNAL_LIBS_DIR}/libzmq/lib/${ANDROID_ABI}/libzmq.a)

############
# Boost
############
Expand Down Expand Up @@ -126,6 +133,10 @@ set_target_properties(unbound PROPERTIES IMPORTED_LOCATION
add_library(epee STATIC IMPORTED)
set_target_properties(epee PROPERTIES IMPORTED_LOCATION
${EXTERNAL_LIBS_DIR}/arqma/lib/${ANDROID_ABI}/libepee.a)





add_library(checkpoints STATIC IMPORTED)
set_target_properties(checkpoints PROPERTIES IMPORTED_LOCATION
Expand All @@ -135,6 +146,10 @@ add_library(device STATIC IMPORTED)
set_target_properties(device PROPERTIES IMPORTED_LOCATION
${EXTERNAL_LIBS_DIR}/arqma/lib/${ANDROID_ABI}/libdevice.a)





add_library(multisig STATIC IMPORTED)
set_target_properties(multisig PROPERTIES IMPORTED_LOCATION
${EXTERNAL_LIBS_DIR}/arqma/lib/${ANDROID_ABI}/libmultisig.a)
Expand All @@ -147,9 +162,19 @@ add_library(net STATIC IMPORTED)
set_target_properties(net PROPERTIES IMPORTED_LOCATION
${EXTERNAL_LIBS_DIR}/arqma/lib/${ANDROID_ABI}/libnet.a)

add_library(librpc_base STATIC IMPORTED)
set_target_properties(librpc_base PROPERTIES IMPORTED_LOCATION
${EXTERNAL_LIBS_DIR}/arqma/lib/${ANDROID_ABI}/librpc_base.a)


add_library(randomx STATIC IMPORTED)
set_target_properties(randomx PROPERTIES IMPORTED_LOCATION
${EXTERNAL_LIBS_DIR}/arqma/lib/${ANDROID_ABI}/librandomx.a)

#add_library(librpc_base STATIC IMPORTED)
#set_target_properties(librpc_base PROPERTIES IMPORTED_LOCATION
# ${EXTERNAL_LIBS_DIR}/arqma/lib/${ANDROID_ABI}/librpc_base.a)

add_library(rpc_sig STATIC IMPORTED)
set_target_properties(rpc_sig PROPERTIES IMPORTED_LOCATION
${EXTERNAL_LIBS_DIR}/arqma/lib/${ANDROID_ABI}/librpc_sig.a)

#############
# System
Expand All @@ -171,19 +196,24 @@ target_link_libraries( monerujo
ringct
ringct_basic
net
librpc_base
libzmq
common
cncrypto
blockchain_db
lmdb
easylogging
unbound
epee

checkpoints
device

multisig
version

randomx

rpc_sig

boost_chrono
boost_date_time
boost_filesystem
Expand Down
71 changes: 48 additions & 23 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
compileSdkVersion 29
buildToolsVersion '29.0.2'
defaultConfig {
applicationId "com.arqma.Droid"
minSdkVersion 21
minSdkVersion 23
targetSdkVersion 28
versionCode 22
versionName "v0.5 'Arq-Droid Legion'"

versionCode 30
versionName "v0.6.1 'Arq-Droid Devil's Randomness"

//testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
Expand Down Expand Up @@ -56,6 +55,10 @@ android {

// Enumerate translated locales
def availableLocales = ["en"]
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
new File("app/src/main/res/").eachFileMatch(~/^values-.*/) { file ->
def languageTag = file.name.substring(7).replace("-r", "-")
availableLocales.add(languageTag)
Expand All @@ -82,27 +85,49 @@ android {
}
}

configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == "com.android.support") {
if (!requested.name.startsWith("multidex")) {
details.useVersion "26.+"
}
}
if (requested.group == "androidx.appcompat") {
if (!requested.name.startsWith("multidex")) {
details.useVersion "1.+"
}
}
}
}


dependencies {
implementation "com.android.support:appcompat-v7:$rootProject.ext.supportVersion"
implementation "com.android.support:design:$rootProject.ext.supportVersion"
implementation "com.android.support:support-v4:$rootProject.ext.supportVersion"
implementation "com.android.support:recyclerview-v7:$rootProject.ext.supportVersion"
implementation "com.android.support:cardview-v7:$rootProject.ext.supportVersion"
implementation 'me.dm7.barcodescanner:zxing:1.9.8'
implementation "androidx.appcompat:appcompat:1.2.0"
implementation 'androidx.cardview:cardview:1.0.0'
implementation "androidx.core:core:1.3.2"
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation "androidx.preference:preference:1.1.1"
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation "androidx.viewpager2:viewpager2:1.0.0"

implementation 'com.google.android.material:material:1.2.1'
implementation "com.jakewharton.timber:timber:4.7.1"
implementation 'com.nulab-inc:zxcvbn:1.3.1'
implementation 'com.squareup.okhttp3:okhttp:4.9.0'

implementation "com.squareup.okhttp3:okhttp:$rootProject.ext.okHttpVersion"
implementation "com.jakewharton.timber:timber:$rootProject.ext.timberVersion"
implementation 'dnsjava:dnsjava:3.3.1'

implementation 'com.nulab-inc:zxcvbn:1.2.3'
implementation "junit:junit:4.13.1"

implementation 'dnsjava:dnsjava:2.1.8'
implementation 'org.jitsi:dnssecjava:1.1.3'
implementation 'org.slf4j:slf4j-nop:1.7.25'
implementation 'me.dm7.barcodescanner:zxing:1.9.8'

implementation "junit:junit:$rootProject.ext.junitVersion"
implementation 'org.jitsi:dnssecjava:2.0.0'
implementation 'org.slf4j:slf4j-nop:1.7.30'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'

testImplementation "org.mockito:mockito-all:$rootProject.ext.mockitoVersion"
testImplementation "com.squareup.okhttp3:mockwebserver:$rootProject.ext.okHttpVersion"
testImplementation 'org.json:json:20180813'
testImplementation 'net.jodah:concurrentunit:0.4.4'
testImplementation 'com.squareup.okhttp3:mockwebserver:4.9.0'
testImplementation 'net.jodah:concurrentunit:0.4.6'
testImplementation "org.mockito:mockito-all:1.10.19"
testImplementation 'org.json:json:20201115'
}
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.USE_BIOMETRIC" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-permission android:name="android.permission.NFC" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

Expand All @@ -18,7 +17,8 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/MyMaterialTheme">
android:theme="@style/MyMaterialTheme"
android:requestLegacyExternalStorage="true" >

<activity
android:name=".WalletActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import android.hardware.usb.UsbInterface;
import android.hardware.usb.UsbManager;
import android.hardware.usb.UsbRequest;
import android.os.Build;

import com.btchip.BTChipException;
import com.btchip.comm.BTChipTransport;
Expand Down Expand Up @@ -105,7 +106,11 @@ public byte[] exchange(byte[] command) {
while (offset != command.length) {
int blockSize = (command.length - offset > HID_BUFFER_SIZE ? HID_BUFFER_SIZE : command.length - offset);
System.arraycopy(command, offset, transferBuffer, 0, blockSize);
requestOut.queue(ByteBuffer.wrap(transferBuffer), HID_BUFFER_SIZE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
requestOut.queue(ByteBuffer.wrap(transferBuffer));
} else {
requestOut.queue(ByteBuffer.wrap(transferBuffer), HID_BUFFER_SIZE);
}
connection.requestWait();
offset += blockSize;
}
Expand All @@ -115,7 +120,11 @@ public byte[] exchange(byte[] command) {
requestIn.initialize(connection, in);
while ((responseData = LedgerHelper.unwrapResponseAPDU(LEDGER_DEFAULT_CHANNEL, response.toByteArray(), HID_BUFFER_SIZE)) == null) {
responseBuffer.clear();
requestIn.queue(responseBuffer, HID_BUFFER_SIZE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
requestIn.queue(responseBuffer);
} else {
requestIn.queue(responseBuffer, HID_BUFFER_SIZE);
}
connection.requestWait();
responseBuffer.rewind();
responseBuffer.get(transferBuffer, 0, HID_BUFFER_SIZE);
Expand Down
9 changes: 5 additions & 4 deletions app/src/main/java/com/m2049r/xmrwallet/BaseActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
import android.os.Handler;
import android.os.Looper;
import android.os.PowerManager;
import android.support.annotation.CallSuper;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.WindowManager.LayoutParams;
import android.widget.Toast;

import com.m2049r.xmrwallet.data.BarcodeData;
Expand All @@ -28,6 +26,9 @@

import java.io.IOException;

import androidx.annotation.CallSuper;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import timber.log.Timber;

public class BaseActivity extends SecureActivity implements GenerateReviewFragment.ProgressListener {
Expand Down Expand Up @@ -95,7 +96,7 @@ public void dismissProgressDialog() {
void acquireWakeLock() {
if ((wl != null) && wl.isHeld()) return;
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
this.wl = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, getString(R.string.app_name));
this.wl = pm.newWakeLock(LayoutParams.FLAG_KEEP_SCREEN_ON, getString(R.string.app_name));
try {
wl.acquire();
Timber.d("WakeLock acquired");
Expand Down
Loading

0 comments on commit e580ce7

Please sign in to comment.