diff --git a/.gitignore b/.gitignore index 6d5672336..b982f2b7d 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ build/ /captures .idea/ *.iml +repo/ +apk/ diff --git a/.travis.yml b/.travis.yml index 784724989..5513db549 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,43 +1,45 @@ language: android android: components: - - platform-tools - - tools - - # The BuildTools version used by your project - - build-tools-25.0.1 - - android-25 - - extra-android-m2repository - - extra-google-m2repository - - extra-android-support - - extra-google-google_play_services - + - build-tools-27.0.2 + - android-27 + - extra-android-m2repository + - extra-google-m2repository + - extra-android-support licenses: - - android-sdk-license-.+ - - '.+' - -jdk: - - oraclejdk8 - -before_script: - - chmod +x gradlew - + - android-sdk-license-.+ before_install: - - mkdir "$ANDROID_HOME/licenses" || true - - echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license" - - echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license" - -#Build, and run tests -script: "./gradlew clean assembleDebug" -sudo: false - +- yes | sdkmanager "platforms;android-27" # workaround for accepting the license +- openssl aes-256-cbc -K $encrypted_5ba4ee4c096f_key -iv $encrypted_5ba4ee4c096f_iv -in "$PWD/.travis/secrets.tar.enc" -out secrets.tar -d +- tar xf secrets.tar +- mkdir "$ANDROID_HOME/licenses" || true +- echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license" +- echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license" +script: + - .travis/build.sh && .travis/create-repo.sh before_cache: - - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock - +- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock +- rm -fr $HOME/.gradle/caches/*/plugin-resolution/ cache: directories: - - $HOME/.gradle/caches/ - - $HOME/.gradle/wrapper/ - + - $HOME/.gradle/caches/ + - $HOME/.gradle/wrapper/ + - $HOME/.android/build-cache + - repo +deploy: +- provider: pages + local-dir: repo + target-branch: repo + skip-cleanup: true + keep-history: true + github-token: + secure: "SCzQyavQM/bfOjEF+eKp9l0DxiAgsB3v64hYQNb2s/sql4WiL8Mjv9HEAyxBWDfGwUg1cNELWR7s2Y1j/8lCLFaZ5doy7222ZSaRP48MGhpGJQi22jGOqavMNCIcS5EZCjo3OJ9+VWLcx67OIJUQK3KHmnxgeM00luPjzC0a3FiED7/7joU4y9fkQhizfnV6AEZjEma0wUH4+wQxUC+5H71nNDZuz77BO3slZ4TX2YKg9O+QIr5jIjv4GT7dqh+UDQUoMvPXVtORUTI3yOzziwEawc64uMUr+0NtSr9ww+9lg4fs7IeVwkTlDEDbVDFdwvLYAvKlZCqboKygG7NX5Pi11grLYYCrqynXXIsyyBtEyV/fkGt2UcQrMOJRxxI6RkZFuUwozP/DVVO9XiebEfoKKZaQ/ehljveu8+B5S+qsKTO/sFMQJhvi2muhXkUvXeduSjHfqgAxEzrnh6sTR4laI05ICVJVw5j38iUfqOEo4rF+cX11ywgHFzp9RJjYCYhndvobv5vtwk77hrndzVcLlKKlKO4tJDfwg+czRRD7oSX9pT0NeL7tRyD86sNryPMG5pBAfJ4D7knnM9+YmRNJmnsmnu/FGeYlBygUK5IiG05LQ7TfkXiF0wQt7nvlixAiB3ULrso18lqP9U2bGHdjLNaRip3dVxHbrCmP9xY=" + on: + branch: master + repo: inorichi/tachiyomi-extensions env: - - GRADLE_OPTS="-XX:MaxPermSize=1024m -XX:+CMSClassUnloadingEnabled -XX:+HeapDumpOnOutOfMemoryError -Xmx2048m" + global: + - secure: "VvCw9E2eOPoExCKjs4jbGEUJ8hYS6Hw8YzJ4VPqtLa0YJSMKhdwNAcW2ldy47tJklTYKv6djehjh7oivTMFOR4m5jhG5MNrAbCprPtTeiK7KU3o8vCK8CyCYgRS/+LfmryNdXTB4N5B8VQzx26jl3+aJE8g5uJacSOYnv1bc+i89ZLAVW9Xwy4EGK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B6Qa1R8B8/vNE12iHPMCGF5eQFWe5yy07lOwrt5Np3gVbg8cLocv9L+dUKuG+qXnLS8UlEtiFj01MImG/1qS+TNY323S1sPD/zmQrKCRj77qtxwC2mmZ3PONpkqEwx/wlyk4up93F9jDZWrHPDxw7kbvIP5AiNPR5ZQG7U++ClcFzAxhKNMGFaJV2W3XKFjOwZbMy7bwIKOHXxQQrQsb8kdFnZ1G4Y+WersYolf4/1PItHmhCM1KaXL8qu5JuwQCiOUsRrip+a3AB3T2+yfYY3m0xH73X4SoMUWWAgBJqTSghgCxtxTqMaeI1psMq2k1IWq42wPYlDlEqRNoyR1q4Hh3CW4Q6Sz3k5lktLoUUsQREJ5/5d/mNOr76gOUDO4C+QJKYBLojZnfHiY66RjHIqjs=" diff --git a/.travis/build.sh b/.travis/build.sh new file mode 100755 index 000000000..d1970c2db --- /dev/null +++ b/.travis/build.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +set -e + +./gradlew --no-daemon clean assembleRelease + +TOOLS="$(ls -d ${ANDROID_HOME}/build-tools/* | tail -1)" + +shopt -s globstar nullglob extglob +APKS=( **/*"-unsigned.apk"* ) + +DEST=$PWD/apk + +rm -rf $DEST && mkdir -p $DEST + +for APK in ${APKS[@]}; do + BASENAME=$(basename $APK) + APKNAME="${BASENAME%%+(-release*)}.apk" + APKDEST="$DEST/$APKNAME" + + ${TOOLS}/zipalign -v -p 4 $APK $APKDEST + ${TOOLS}/apksigner sign --ks $STORE_PATH --ks-key-alias $STORE_ALIAS --ks-pass env:STORE_PASS --key-pass env:KEY_PASS $APKDEST +done diff --git a/.travis/create-repo.sh b/.travis/create-repo.sh new file mode 100755 index 000000000..4e1d6fde9 --- /dev/null +++ b/.travis/create-repo.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +set -e + +TOOLS="$(ls -d ${ANDROID_HOME}/build-tools/* | tail -1)" + +mkdir -p repo/apk +mkdir -p repo/icon + +cp -f apk/* repo/apk || true + +cd repo + +APKS=( apk/*".apk"* ) + +for APK in ${APKS[@]}; do + FILENAME=$(basename ${APK}) + BADGING="$(${TOOLS}/aapt dump badging $APK)" + + PACKAGE=$(echo "$BADGING" | grep package:) + PKGNAME=$(echo $PACKAGE | grep -Po "name='\K[^']+") + VCODE=$(echo $PACKAGE | grep -Po "versionCode='\K[^']+") + VNAME=$(echo $PACKAGE | grep -Po "versionName='\K[^']+") + + APPLICATION=$(echo "$BADGING" | grep application:) + LABEL=$(echo $APPLICATION | grep -Po "label='\K[^']+") + + LANG=$(echo $APK | grep -Po "tachiyomi-\K[^\.]+") + + ICON=$(echo "$BADGING" | grep -Po "application-icon-320.*'\K[^']+") + unzip -p $APK $ICON > icon/${FILENAME%.*}.png + + jq -n \ + --arg name "$LABEL" \ + --arg pkg "$PKGNAME" \ + --arg apk "$FILENAME" \ + --arg lang "$LANG" \ + --argjson code $VCODE \ + --arg version "$VNAME" \ + '{name:$name, pkg:$pkg, apk:$apk, lang:$lang, code:$code, version:$version}' + +done | jq -sr '[.[]]' > index.json diff --git a/.travis/secrets.tar.enc b/.travis/secrets.tar.enc new file mode 100644 index 000000000..5af16e093 Binary files /dev/null and b/.travis/secrets.tar.enc differ diff --git a/build.gradle b/build.gradle index 0566460c9..da7ff9338 100644 --- a/build.gradle +++ b/build.gradle @@ -1,10 +1,11 @@ buildscript { - ext.kotlin_version = '1.1.2' + ext.kotlin_version = '1.2.21' repositories { jcenter() + google() } dependencies { - classpath 'com.android.tools.build:gradle:2.3.1' + classpath 'com.android.tools.build:gradle:3.0.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -12,6 +13,7 @@ buildscript { allprojects { repositories { jcenter() + google() maven { url 'https://dl.bintray.com/inorichi/tachiyomi' } } } diff --git a/common.gradle b/common.gradle index 8516ddf44..9483e701d 100644 --- a/common.gradle +++ b/common.gradle @@ -1,6 +1,6 @@ android { - compileSdkVersion 25 - buildToolsVersion "25.0.2" + compileSdkVersion 27 + buildToolsVersion "27.0.2" buildTypes { release { @@ -28,7 +28,7 @@ android { defaultConfig { minSdkVersion 16 - targetSdkVersion 25 + targetSdkVersion 27 applicationIdSuffix pkgNameSuffix versionCode extVersionCode versionName "$libVersion.$extVersionSuffix" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f7660310d..b5b623fac 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Thu Jun 01 17:09:13 CEST 2017 +#Sun Feb 04 00:22:22 CET 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip