Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyPavlenko committed Sep 15, 2021
1 parent f998d29 commit d7748a1
Show file tree
Hide file tree
Showing 13 changed files with 425 additions and 400 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
.project
.classpath
build/
dist/
*.iml
gradle/
gradlew
Expand Down
18 changes: 13 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
def version = '1.3.7'
def versionNum = 9000015
def version = '1.3.8'
def versionNum = 9000017
def webInstallDir = "${project.buildDir}/web"

buildscript {
Expand All @@ -9,7 +9,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
classpath 'com.android.tools.build:gradle:4.2.2'
}
}

Expand All @@ -26,7 +26,7 @@ android {

defaultConfig {
applicationId 'com.ap.transmission.btc'
minSdkVersion 21
minSdkVersion 19
targetSdkVersion 30
compileSdkVersion 30
versionCode versionNum
Expand All @@ -38,8 +38,10 @@ android {
}

ndk {
def abi = project.properties['ABI']
def filters = (abi != null) ? abi.split(",") : ['arm64-v8a', 'armeabi-v7a', 'x86', 'x86_64']
debugSymbolLevel 'FULL'
abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86', 'x86_64'
abiFilters = filters
}
}

Expand Down Expand Up @@ -120,6 +122,12 @@ task mergeWebAssets() {
url.withInputStream { i -> arch.withOutputStream { it << i } }
}

def md = java.security.MessageDigest.getInstance("SHA1")
arch.eachByte(1024 * 1024) { byte[] buf, int n -> md.update(buf, 0, n) }
def sha1 = new BigInteger(1, md.digest()).toString(16).padLeft( 40, '0' )
new File(webDir).mkdirs()
new File(webDir, 'checksum.sha1').write(sha1)

copy {
from "${webInstallDir}/usr/local/share/transmission/public_html"
into webDir
Expand Down
41 changes: 41 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/sh
set -e

VERSION="$(grep 'def version = ' build.gradle | awk '{print $4}' | tr -d "'")"
DEST_DIR="$1"
[ -z "$DEST_DIR" ] && DEST_DIR="dist"

mkdir -p "$DEST_DIR"

bundletool_universal() {
local AAB="$1"
local ADD_SFX="$2"
local CUT_SFX="$3"
local AAB_FILE="$(basename "$AAB")"
local AAB_DIR="$(dirname "$AAB")"
local BASENAME="${AAB_FILE%${CUT_SFX}.*}"
local APKS="$AAB_DIR/$BASENAME.apks"

bundletool build-apks --bundle="$AAB" --output="$APKS" --mode=universal --overwrite
unzip -o "$APKS" universal.apk -d "$AAB_DIR"
mv "$AAB_DIR/universal.apk" "$AAB_DIR/$BASENAME${ADD_SFX}.apk"
rm "$APKS"
}

./gradlew cleanAll

./gradlew bundleRelease -PABI=arm64-v8a
bundletool_universal ./build/outputs/bundle/release/transmissionbtc-*-release.aab -universal-arm64 -release
mv ./build/outputs/bundle/release/transmissionbtc-*.apk "$DEST_DIR/transmissionbtc-$VERSION-arm64-v8a.apk"

./gradlew bundleRelease -PABI=armeabi-v7a
bundletool_universal ./build/outputs/bundle/release/transmissionbtc-*-release.aab -universal-arm64 -release
mv ./build/outputs/bundle/release/transmissionbtc-*.apk "$DEST_DIR/transmissionbtc-$VERSION-armeabi-v7a.apk"

./gradlew bundleRelease -PABI=x86_64
bundletool_universal ./build/outputs/bundle/release/transmissionbtc-*-release.aab -universal-arm64 -release
mv ./build/outputs/bundle/release/transmissionbtc-*.apk "$DEST_DIR/transmissionbtc-$VERSION-x86_64.apk"

./gradlew bundleRelease -PABI=x86
bundletool_universal ./build/outputs/bundle/release/transmissionbtc-*-release.aab -universal-arm64 -release
mv ./build/outputs/bundle/release/transmissionbtc-*.apk "$DEST_DIR/transmissionbtc-$VERSION-x86.apk"
3 changes: 1 addition & 2 deletions cmake/OpenSSL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ set(OPENSSL_INCLUDE_DIR "${OPENSSL_ROOT_DIR}/include")
message(STATUS "OpenSSL config: ${OPENSSL_CONFIGURE_OPTS}")

ExternalProject_Add(openssl
URL "https://www.openssl.org/source/openssl-1.1.1j.tar.gz"
URL "https://www.openssl.org/source/openssl-1.1.1l.tar.gz"
PREFIX openssl
BUILD_IN_SOURCE 1
PATCH_COMMAND patch -p1 -i ${CMAKE_SOURCE_DIR}/patches/openssl_ndk22.patch
CONFIGURE_COMMAND ${OPENSSL_CONFIGURE_CMD} ${OPENSSL_CONFIGURE_OPTS}
BUILD_COMMAND ${OPENSSL_BUILD_CMD}
INSTALL_COMMAND ${MAKE_EXE} install_sw DESTDIR=${OPENSSL_INSTALL_DIR}
Expand Down
2 changes: 1 addition & 1 deletion cmake/cURL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ProcessorCount(NCPU)
find_program(MAKE_EXE NAMES make gmake nmake)

ExternalProject_Add(curl
URL "https://curl.se/download/curl-7.76.1.tar.xz"
URL "https://curl.se/download/curl-7.78.0.tar.xz"
PREFIX curl
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ${CMAKE_COMMAND} ${CURL_CMAKE_ARGS}
Expand Down
Empty file added gradle.properties
Empty file.
1 change: 1 addition & 0 deletions src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/ap/transmission/btc/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ public static int toPx(int dp) {

public static void runWithDelay(Runnable run, int delay) {
final Handler handler = new Handler();
handler.postDelayed(run, delay * 1000);
handler.postDelayed(run, delay * 1000L);
}

public static String getFileExtension(String fileName) {
Expand Down
Loading

0 comments on commit d7748a1

Please sign in to comment.