Compare commits
17 commits
master
...
test-deplo
Author | SHA1 | Date | |
---|---|---|---|
|
ba46dda760 | ||
|
f5daaee820 | ||
|
e5ed4443f7 | ||
|
564f1a3193 | ||
|
c8799d5a20 | ||
|
889960ffdd | ||
|
e24bb03424 | ||
|
2053dbc909 | ||
|
f9a4463750 | ||
|
5bb7d6b607 | ||
|
732d2ce78c | ||
|
2f0d159c2f | ||
|
c465a75186 | ||
|
641b1585b6 | ||
|
57a5706fe7 | ||
|
9ec26cabcf | ||
|
a85b8d66d7 |
9 changed files with 119 additions and 129 deletions
157
.github/workflows/deploy.yml
vendored
157
.github/workflows/deploy.yml
vendored
|
@ -1,8 +1,11 @@
|
||||||
|
|
||||||
name: Publish Assets
|
name: Publish Assets
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [master]
|
branches: [master]
|
||||||
|
pull_request:
|
||||||
|
branches: [master]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_arm64_aar:
|
build_arm64_aar:
|
||||||
|
@ -14,12 +17,17 @@ jobs:
|
||||||
- name: hacky copy # docker image runs ~ as /root, but github actions uses ~=/github/home
|
- name: hacky copy # docker image runs ~ as /root, but github actions uses ~=/github/home
|
||||||
run: |
|
run: |
|
||||||
cp -r /root/.buildozer ~/.buildozer/
|
cp -r /root/.buildozer ~/.buildozer/
|
||||||
|
- name: Log the buildozer version
|
||||||
|
run: |
|
||||||
|
pwd
|
||||||
|
ls -al /
|
||||||
|
- name: export build version
|
||||||
|
run: export BUILD_VERSION=$(cat $GITHUB_WORKSPACE/src/main/python/main.py | grep --color=never -oP '([0-9]+\.?)+')
|
||||||
- name: setup
|
- name: setup
|
||||||
run: |
|
run: |
|
||||||
export B_VERSION=$(cat $GITHUB_WORKSPACE/src/main/python/main.py | grep --color=never -oP '([0-9]+\.?)+')
|
|
||||||
echo "NEXUS_SIGNING_KEYRING_FILE=$GITHUB_WORKSPACE/signing2.pgp" >> $GITHUB_ENV
|
echo "NEXUS_SIGNING_KEYRING_FILE=$GITHUB_WORKSPACE/signing2.pgp" >> $GITHUB_ENV
|
||||||
echo "BUILD_VERSION=${B_VERSION}" >> $GITHUB_ENV
|
|
||||||
export PATH=/usr/bin:$PATH
|
export PATH=/usr/bin:$PATH
|
||||||
|
|
||||||
wget -q 'https://eu.crystax.net/download/crystax-ndk-10.3.2-linux-x86_64.tar.xz' -P ~/.buildozer/android/
|
wget -q 'https://eu.crystax.net/download/crystax-ndk-10.3.2-linux-x86_64.tar.xz' -P ~/.buildozer/android/
|
||||||
tar -xf ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz -C ~/.buildozer/android/
|
tar -xf ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz -C ~/.buildozer/android/
|
||||||
rm -rf ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
|
rm -rf ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
|
||||||
|
@ -40,78 +48,77 @@ jobs:
|
||||||
NEXUS_SIGNING_KEY_PASSWORD: ${{ secrets.NEXUS_SIGNING_KEY_PASSWORD }}
|
NEXUS_SIGNING_KEY_PASSWORD: ${{ secrets.NEXUS_SIGNING_KEY_PASSWORD }}
|
||||||
NEXUS_SIGNING_KEY_ID: ${{ secrets.NEXUS_SIGNING_KEY_ID }}
|
NEXUS_SIGNING_KEY_ID: ${{ secrets.NEXUS_SIGNING_KEY_ID }}
|
||||||
run: ./build-release.sh
|
run: ./build-release.sh
|
||||||
# - name: debug bin
|
# - name: build arm64 aar
|
||||||
# run : ls -al ./bin
|
|
||||||
# - name: upload to build_lbry_io
|
|
||||||
# run : |
|
|
||||||
# pip install awscli
|
|
||||||
# export PR_NUMBER=${{ github.event.number }}
|
|
||||||
|
|
||||||
# export BUILD_APK_FILENAME__64=lbrysdk-${{ env.BUILD_VERSION }}-arm64-v8a-release.aar
|
|
||||||
# aws s3 cp ./bin/${BUILD_APK_FILENAME__64} s3://build.lbry.io/android/sdk-build-${PR_NUMBER}_commit-${{ github.sha }}/${BUILD_APK_FILENAME__64}
|
|
||||||
# env:
|
|
||||||
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
||||||
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
||||||
# AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
|
|
||||||
# - name: github release
|
|
||||||
# if: startsWith(github.ref, 'refs/tags/v')
|
|
||||||
# run: |
|
# run: |
|
||||||
# pip install githubrelease
|
# echo "NEXUS_SIGNING_KEYRING_FILE=$GITHUB_WORKSPACE/signing2.pgp" >> $GITHUB_ENV
|
||||||
# export GITHUB_TOKEN=${{ github.token }}
|
# export PATH=/usr/bin:$PATH
|
||||||
# githubrelease release lbryio/lbry-android-sdk create ${{ github.ref_name }} --publish bin/${BUILD_APK_FILENAME__64}
|
|
||||||
|
|
||||||
build_arm_aar:
|
# wget -q 'https://eu.crystax.net/download/crystax-ndk-10.3.2-linux-x86_64.tar.xz' -P ~/.buildozer/android/
|
||||||
runs-on: ubuntu-latest
|
# tar -xf ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz -C ~/.buildozer/android/
|
||||||
container: lbry/android-base:python39
|
# rm -rf ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
|
||||||
needs: [build_arm64_aar]
|
# ln -s ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21 ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
|
||||||
steps:
|
# cp -f $GITHUB_WORKSPACE/scripts/build-target-python.sh ~/.buildozer/android/crystax-ndk-10.3.2/build/tools/build-target-python.sh
|
||||||
- name: checkout
|
# cp -f $GITHUB_WORKSPACE/scripts/mangled-glibc-syscalls__arm64.h ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21/arch-arm64/usr/include/crystax/bionic/libc/include/sys/mangled-glibc-syscalls.h
|
||||||
uses: actions/checkout@v3
|
# cp -f $GITHUB_WORKSPACE/scripts/build-binary.mk ~/.buildozer/android/crystax-ndk-10.3.2/build/core/build-binary.mk
|
||||||
- name: hacky copy # docker image runs ~ as /root, but github actions uses ~=/github/home
|
# rm -rf ~/.buildozer/android/crystax-ndk-10.3.2/sources/sqlite
|
||||||
run: |
|
# cp -Rf $GITHUB_WORKSPACE/scripts/crystax-sources/sqlite ~/.buildozer/android/crystax-ndk-10.3.2/sources/sqlite
|
||||||
cp -r /root/.buildozer ~/.buildozer/
|
# rm ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz
|
||||||
- name: setup
|
# mv buildozer.spec.arm64.ci buildozer.spec
|
||||||
run: |
|
# chmod u+x ./build-release.sh
|
||||||
export B_VERSION=$(cat $GITHUB_WORKSPACE/src/main/python/main.py | grep --color=never -oP '([0-9]+\.?)+')
|
# ./build-release.sh
|
||||||
echo "BUILD_VERSION=${B_VERSION}" >> $GITHUB_ENV
|
# cp $GITHUB_WORKSPACE/bin/lbrysdk-${{ env.BUILD_VERSION }}-arm64-v8a-release.aar /dev/null
|
||||||
echo "NEXUS_SIGNING_KEYRING_FILE=$GITHUB_WORKSPACE/signing2.pgp" >> $GITHUB_ENV
|
# build_arm_aar:
|
||||||
export PATH=/usr/bin:$PATH
|
# runs-on: ubuntu-latest
|
||||||
wget -q 'https://eu.crystax.net/download/crystax-ndk-10.3.2-linux-x86_64.tar.xz' -P ~/.buildozer/android/
|
# container: lbry/android-base:python39
|
||||||
tar -xf ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz -C ~/.buildozer/android/
|
# steps:
|
||||||
rm -rf ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
|
# - name: checkout
|
||||||
ln -s ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21 ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
|
# uses: actions/checkout@v3
|
||||||
cp -f $GITHUB_WORKSPACE/p4a/pythonforandroid/bootstraps/lbry/build/templates/build.tmpl.gradle.arm $GITHUB_WORKSPACE/p4a/pythonforandroid/bootstraps/lbry/build/templates/build.tmpl.gradle
|
# - name: export build version
|
||||||
cp -f $GITHUB_WORKSPACE/scripts/build-target-python.sh ~/.buildozer/android/crystax-ndk-10.3.2/build/tools/build-target-python.sh
|
# run: export BUILD_VERSION=$(cat $GITHUB_WORKSPACE/src/main/python/main.py | grep --color=never -oP '([0-9]+\.?)+')
|
||||||
cp -f $GITHUB_WORKSPACE/scripts/mangled-glibc-syscalls.h ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21/arch-arm/usr/include/crystax/bionic/libc/include/sys/mangled-glibc-syscalls.h
|
# - name: build arm aar
|
||||||
cp -f $GITHUB_WORKSPACE/scripts/build-binary.mk ~/.buildozer/android/crystax-ndk-10.3.2/build/core/build-binary.mk
|
# run: |
|
||||||
rm -rf ~/.buildozer/android/crystax-ndk-10.3.2/sources/sqlite
|
# export NEXUS_SIGNING_KEYRING_FILE=$GITHUB_WORKSPACE/signing2.pgp
|
||||||
cp -Rf $GITHUB_WORKSPACE/scripts/crystax-sources/sqlite ~/.buildozer/android/crystax-ndk-10.3.2/sources/sqlite
|
# export PATH=/usr/bin:$PATH
|
||||||
rm ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz
|
# wget -q 'https://eu.crystax.net/download/crystax-ndk-10.3.2-linux-x86_64.tar.xz' -P ~/.buildozer/android/
|
||||||
mv buildozer.spec.arm64.ci buildozer.spec
|
# tar -xf ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz -C ~/.buildozer/android/
|
||||||
chmod u+x ./build-release.sh
|
# rm -rf ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
|
||||||
- name: build release
|
# ln -s ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21 ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
|
||||||
env:
|
# cp -f $GITHUB_WORKSPACE/p4a/pythonforandroid/bootstraps/lbry/build/templates/build.tmpl.gradle.arm $GITHUB_WORKSPACE/p4a/pythonforandroid/bootstraps/lbry/build/templates/build.tmpl.gradle
|
||||||
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
|
# cp -f $GITHUB_WORKSPACE/scripts/build-target-python.sh ~/.buildozer/android/crystax-ndk-10.3.2/build/tools/build-target-python.sh
|
||||||
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
|
# cp -f $GITHUB_WORKSPACE/scripts/mangled-glibc-syscalls.h ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21/arch-arm/usr/include/crystax/bionic/libc/include/sys/mangled-glibc-syscalls.h
|
||||||
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
|
# cp -f $GITHUB_WORKSPACE/scripts/build-binary.mk ~/.buildozer/android/crystax-ndk-10.3.2/build/core/build-binary.mk
|
||||||
NEXUS_SIGNING_KEY_PASSWORD: ${{ secrets.NEXUS_SIGNING_KEY_PASSWORD }}
|
# rm -rf ~/.buildozer/android/crystax-ndk-10.3.2/sources/sqlite
|
||||||
NEXUS_SIGNING_KEY_ID: ${{ secrets.NEXUS_SIGNING_KEY_ID }}
|
# cp -Rf $GITHUB_WORKSPACE/scripts/crystax-sources/sqlite ~/.buildozer/android/crystax-ndk-10.3.2/sources/sqlite
|
||||||
run: ./build-release.sh
|
# rm ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz
|
||||||
# - name: upload to build_lbry_io
|
# mv buildozer.spec.arm.ci buildozer.spec
|
||||||
# run : |
|
# chmod u+x ./build-release.sh
|
||||||
# pip install awscli
|
# ./build-release.sh
|
||||||
# export PR_NUMBER=${{ github.event.number }}
|
# cp $GITHUB_WORKSPACE/bin/lbrysdk-${{ env.BUILD_VERSION }}-armeabi-v7a-release.aar /dev/null
|
||||||
# export BUILD_APK_FILENAME__32=lbrysdk-${{ env.BUILD_VERSION }}-armeabi-v7a-release.aar
|
# deploy_build_lbry_io:
|
||||||
# aws s3 cp bin/${BUILD_APK_FILENAME__32} s3://build.lbry.io/android/sdk-build-{$PR_NUMBER}_commit-${{ github.sha }}/${BUILD_APK_FILENAME__32}
|
# runs-on: ubuntu-latest
|
||||||
# env:
|
# container: lbry/android-base:python39
|
||||||
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
# needs: [build_arm64_aar, build_arm_aar]
|
||||||
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
# steps:
|
||||||
# AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
|
# - name: dependencies
|
||||||
# - name: github upload binary
|
# run: |
|
||||||
# if: startsWith(github.ref, 'refs/tags/v')
|
# pip install awscli
|
||||||
# uses: skx/github-action-publish-binaries@release-1.3
|
# export BUILD_VERSION=$(cat $GITHUB_WORKSPACE/src/main/python/main.py | grep --color=never -oP '([0-9]+\.?)+')
|
||||||
# env:
|
# export BUILD_APK_FILENAME__32=lbrysdk-$BUILD_VERSION-armeabi-v7a-release.aar
|
||||||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
# export BUILD_APK_FILENAME__64=lbrysdk-$BUILD_VERSION-arm64-v8a-release.aar
|
||||||
# BUILD_VERSION: ${{ env.BUILD_VERSION }}
|
# - name: upload
|
||||||
# with:
|
# run: |
|
||||||
# args: bin/${BUILD_APK_FILENAME__32}
|
# aws s3 cp bin/$BUILD_APK_FILENAME__64 s3://build.lbry.io/android/sdk-build-${CI_PIPELINE_IID}_commit-${CI_COMMIT_SHA:0:7}/$BUILD_APK_FILENAME__64
|
||||||
|
# aws s3 cp bin/$BUILD_APK_FILENAME__32 s3://build.lbry.io/android/sdk-build-${CI_PIPELINE_IID}_commit-${CI_COMMIT_SHA:0:7}/$BUILD_APK_FILENAME__32
|
||||||
|
# release_aar:
|
||||||
|
# runs-on: ubuntu-latest
|
||||||
|
# container: python:latest
|
||||||
|
# needs: [build_arm64_aar, build_arm_aar]
|
||||||
|
# steps:
|
||||||
|
# - name: dependencies
|
||||||
|
# run: |
|
||||||
|
# pip install awscli githubrelease
|
||||||
|
# export BUILD_VERSION=$(cat $GITHUB_WORKSPACE/src/main/python/main.py | grep --color=never -oP '([0-9]+\.?)+')
|
||||||
|
# export BUILD_APK_FILENAME__32=lbrysdk-$BUILD_VERSION-armeabi-v7a-release.aar
|
||||||
|
# export BUILD_APK_FILENAME__64=lbrysdk-$BUILD_VERSION-arm64-v8a-release.aar
|
||||||
|
# - name: release
|
||||||
|
# run: githubrelease release lbryio/lbry-android-sdk create $CI_COMMIT_TAG --publish bin/$BUILD_APK_FILENAME__64 bin/$BUILD_APK_FILENAME__32
|
||||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -11,7 +11,6 @@ src/main/assets/index.android.bundle
|
||||||
src/main/assets/index.android.bundle.meta
|
src/main/assets/index.android.bundle.meta
|
||||||
*.log
|
*.log
|
||||||
.vagrant
|
.vagrant
|
||||||
.vscode
|
|
||||||
|
|
||||||
lbry-android.keystore
|
lbry-android.keystore
|
||||||
p4a/pythonforandroid/bootstraps/lbry/build/templates/google-services.json
|
p4a/pythonforandroid/bootstraps/lbry/build/templates/google-services.json
|
||||||
|
|
14
BUILD.md
14
BUILD.md
|
@ -135,17 +135,3 @@ If you already installed `Android SDK` and `adb`
|
||||||
Note: You need to have your device connected with USB debugging.
|
Note: You need to have your device connected with USB debugging.
|
||||||
|
|
||||||
Once the bundler is ready, run the LBRY Browser app on your device and then shake the device violently until you see the React Native dev menu. You can enable "Live Reloading" and "Hot Reloading" from this menu, so any changes you make to the React Native code will be visible as you save. This will only reload React Native Javascript files. Native Java code needs to be redeployed by running the command `./deploy.sh`
|
Once the bundler is ready, run the LBRY Browser app on your device and then shake the device violently until you see the React Native dev menu. You can enable "Live Reloading" and "Hot Reloading" from this menu, so any changes you make to the React Native code will be visible as you save. This will only reload React Native Javascript files. Native Java code needs to be redeployed by running the command `./deploy.sh`
|
||||||
|
|
||||||
## Update LBRY SDK Version
|
|
||||||
|
|
||||||
### Update the `requirements` section following files
|
|
||||||
* buildozer.spec.arm.ci
|
|
||||||
* buildozer.spec.arm64.ci
|
|
||||||
* buildozer.spec.sample
|
|
||||||
* buildozer.spec.vagrant
|
|
||||||
|
|
||||||
### Update LBRY_SDK_VERSION in `src/main/java/io/lbry/lbrysdk/LbrynetService.java`
|
|
||||||
|
|
||||||
### Update the version in `src/main/python/main.py`
|
|
||||||
|
|
||||||
## Github Actions CI
|
|
|
@ -39,7 +39,7 @@ version.filename = %(source.dir)s/main.py
|
||||||
|
|
||||||
# (list) Application requirements
|
# (list) Application requirements
|
||||||
# comma seperated e.g. requirements = sqlite3,kivy
|
# comma seperated e.g. requirements = sqlite3,kivy
|
||||||
requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2021.5.30, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13.3, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==21.0.0, defusedxml, netifaces, aioupnp==0.0.17, asn1crypto, mock, cryptography, aiohttp==3.6.0, multidict==4.5.2, idna, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir, prometheus_client==0.8.0, "git+https://github.com/lbryio/lbry-sdk@v0.112.0#egg=lbry"
|
requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2021.5.30, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13.3, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==21.0.0, defusedxml, netifaces, aioupnp==0.0.17, asn1crypto, mock, cryptography, aiohttp==3.6.0, multidict==4.5.2, idna, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir, prometheus_client==0.8.0, "git+https://github.com/lbryio/lbry-sdk@v0.102.0#egg=lbry"
|
||||||
|
|
||||||
# (str) Custom source folders for requirements
|
# (str) Custom source folders for requirements
|
||||||
# Sets custom source for any requirements with recipes
|
# Sets custom source for any requirements with recipes
|
||||||
|
@ -101,7 +101,7 @@ android.minapi = 21
|
||||||
android.sdk = 23
|
android.sdk = 23
|
||||||
|
|
||||||
# (str) Android NDK version to use
|
# (str) Android NDK version to use
|
||||||
#android.ndk = 13b
|
#android.ndk = 17c
|
||||||
|
|
||||||
# (bool) Use --private data storage (True) or --dir public storage (False)
|
# (bool) Use --private data storage (True) or --dir public storage (False)
|
||||||
#android.private_storage = True
|
#android.private_storage = True
|
||||||
|
@ -275,3 +275,4 @@ warn_on_root = 1
|
||||||
# Then, invoke the command line with the "demo" profile:
|
# Then, invoke the command line with the "demo" profile:
|
||||||
#
|
#
|
||||||
#buildozer --profile demo android debug
|
#buildozer --profile demo android debug
|
||||||
|
android.accept_sdk_license = True
|
|
@ -39,7 +39,7 @@ version.filename = %(source.dir)s/main.py
|
||||||
|
|
||||||
# (list) Application requirements
|
# (list) Application requirements
|
||||||
# comma seperated e.g. requirements = sqlite3,kivy
|
# comma seperated e.g. requirements = sqlite3,kivy
|
||||||
requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2021.5.30, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13.3, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==21.0.0, defusedxml, netifaces, aioupnp==0.0.17, asn1crypto, mock, cryptography, aiohttp==3.6.0, multidict==4.5.2, idna, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir, prometheus_client==0.8.0, "git+https://github.com/lbryio/lbry-sdk@v0.112.0#egg=lbry"
|
requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2021.5.30, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13.3, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==21.0.0, defusedxml, netifaces, aioupnp==0.0.17, asn1crypto, mock, cryptography, aiohttp==3.6.0, multidict==4.5.2, idna, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir, prometheus_client==0.8.0, "git+https://github.com/lbryio/lbry-sdk@v0.102.0#egg=lbry"
|
||||||
|
|
||||||
# (str) Custom source folders for requirements
|
# (str) Custom source folders for requirements
|
||||||
# Sets custom source for any requirements with recipes
|
# Sets custom source for any requirements with recipes
|
||||||
|
|
|
@ -39,7 +39,7 @@ version.filename = %(source.dir)s/main.py
|
||||||
|
|
||||||
# (list) Application requirements
|
# (list) Application requirements
|
||||||
# comma seperated e.g. requirements = sqlite3,kivy
|
# comma seperated e.g. requirements = sqlite3,kivy
|
||||||
requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2021.5.30, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13.3, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==21.0.0, defusedxml, netifaces, aioupnp==0.0.17, asn1crypto, mock, cryptography, aiohttp==3.6.0, multidict==4.5.2, idna, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir, prometheus_client==0.8.0, "git+https://github.com/lbryio/lbry-sdk@v0.112.0#egg=lbry"
|
requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2021.5.30, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13.3, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==21.0.0, defusedxml, netifaces, aioupnp==0.0.17, asn1crypto, mock, cryptography, aiohttp==3.6.0, multidict==4.5.2, idna, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir, prometheus_client==0.8.0, "git+https://github.com/lbryio/lbry-sdk@v0.102.0#egg=lbry"
|
||||||
|
|
||||||
# (str) Custom source folders for requirements
|
# (str) Custom source folders for requirements
|
||||||
# Sets custom source for any requirements with recipes
|
# Sets custom source for any requirements with recipes
|
||||||
|
|
|
@ -275,4 +275,4 @@ warn_on_root = 1
|
||||||
# Then, invoke the command line with the "demo" profile:
|
# Then, invoke the command line with the "demo" profile:
|
||||||
#
|
#
|
||||||
#buildozer --profile demo android debug
|
#buildozer --profile demo android debug
|
||||||
requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2020.12.5, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13.3, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==21.0.0, defusedxml, aioupnp==0.0.17, asn1crypto, mock, cryptography, aiohttp==3.5.4, multidict==4.5.2, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir, prometheus_client==0.8.0, "git+https://github.com/lbryio/lbry-sdk@v0.112.0#egg=lbry"
|
requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2020.12.5, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13.3, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==21.0.0, defusedxml, aioupnp==0.0.17, asn1crypto, mock, cryptography, aiohttp==3.5.4, multidict==4.5.2, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir, prometheus_client==0.8.0, "git+https://github.com/lbryio/lbry-sdk@v0.102.0#egg=lbry"
|
|
@ -56,7 +56,7 @@ import org.renpy.android.ResourceManager;
|
||||||
*/
|
*/
|
||||||
public final class LbrynetService extends PythonService {
|
public final class LbrynetService extends PythonService {
|
||||||
|
|
||||||
public static final String LBRY_SDK_VERSION = "0.112.0";
|
public static final String LBRY_SDK_VERSION = "0.102.0";
|
||||||
|
|
||||||
public static final int SERVICE_NOTIFICATION_GROUP_ID = 5;
|
public static final int SERVICE_NOTIFICATION_GROUP_ID = 5;
|
||||||
public static final String ACTION_STOP_SERVICE = "io.lbry.browser.ACTION_STOP_SERVICE";
|
public static final String ACTION_STOP_SERVICE = "io.lbry.browser.ACTION_STOP_SERVICE";
|
||||||
|
@ -143,7 +143,8 @@ public final class LbrynetService extends PythonService {
|
||||||
|
|
||||||
// update the notification with the context intent
|
// update the notification with the context intent
|
||||||
Notification notification = buildNotification();
|
Notification notification = buildNotification();
|
||||||
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
NotificationManager notificationManager =
|
||||||
|
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
notificationManager.notify(1, notification);
|
notificationManager.notify(1, notification);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,13 +159,13 @@ public final class LbrynetService extends PythonService {
|
||||||
|
|
||||||
String serviceDescription = "The LBRY service is running in the background.";
|
String serviceDescription = "The LBRY service is running in the background.";
|
||||||
Notification notification = builder.setColor(ContextCompat.getColor(this, R.color.lbryGreen))
|
Notification notification = builder.setColor(ContextCompat.getColor(this, R.color.lbryGreen))
|
||||||
.setContentText(serviceDescription)
|
.setContentText(serviceDescription)
|
||||||
.setGroup(GROUP_SERVICE)
|
.setGroup(GROUP_SERVICE)
|
||||||
.setWhen(System.currentTimeMillis())
|
.setWhen(System.currentTimeMillis())
|
||||||
.setSmallIcon(R.drawable.ic_lbry)
|
.setSmallIcon(R.drawable.ic_lbry)
|
||||||
.setOngoing(true)
|
.setOngoing(true)
|
||||||
.addAction(android.R.drawable.ic_menu_close_clear_cancel, "Stop", stopPendingIntent)
|
.addAction(android.R.drawable.ic_menu_close_clear_cancel, "Stop", stopPendingIntent)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
return notification;
|
return notification;
|
||||||
}
|
}
|
||||||
|
@ -172,10 +173,11 @@ public final class LbrynetService extends PythonService {
|
||||||
@Override
|
@Override
|
||||||
protected void doStartForeground(Bundle extras) {
|
protected void doStartForeground(Bundle extras) {
|
||||||
downloadManager = new DownloadManager(this);
|
downloadManager = new DownloadManager(this);
|
||||||
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
NotificationManager notificationManager =
|
||||||
|
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
NotificationChannel channel = new NotificationChannel(
|
NotificationChannel channel = new NotificationChannel(
|
||||||
NOTIFICATION_CHANNEL_ID, "LBRY Browser", NotificationManager.IMPORTANCE_LOW);
|
NOTIFICATION_CHANNEL_ID, "LBRY Browser", NotificationManager.IMPORTANCE_LOW);
|
||||||
channel.setDescription("LBRY service notification channel");
|
channel.setDescription("LBRY service notification channel");
|
||||||
channel.setShowBadge(false);
|
channel.setShowBadge(false);
|
||||||
notificationManager.createNotificationChannel(channel);
|
notificationManager.createNotificationChannel(channel);
|
||||||
|
@ -184,11 +186,11 @@ public final class LbrynetService extends PythonService {
|
||||||
// Create the notification group
|
// Create the notification group
|
||||||
NotificationCompat.Builder groupBuilder = new NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID);
|
NotificationCompat.Builder groupBuilder = new NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID);
|
||||||
groupBuilder.setContentTitle("LBRY Browser")
|
groupBuilder.setContentTitle("LBRY Browser")
|
||||||
.setColor(ContextCompat.getColor(this, R.color.lbryGreen))
|
.setColor(ContextCompat.getColor(this, R.color.lbryGreen))
|
||||||
.setSmallIcon(R.drawable.ic_lbry)
|
.setSmallIcon(R.drawable.ic_lbry)
|
||||||
.setPriority(NotificationCompat.PRIORITY_LOW)
|
.setPriority(NotificationCompat.PRIORITY_LOW)
|
||||||
.setGroup(GROUP_SERVICE)
|
.setGroup(GROUP_SERVICE)
|
||||||
.setGroupSummary(true);
|
.setGroupSummary(true);
|
||||||
notificationManager.notify(SERVICE_NOTIFICATION_GROUP_ID, groupBuilder.build());
|
notificationManager.notify(SERVICE_NOTIFICATION_GROUP_ID, groupBuilder.build());
|
||||||
|
|
||||||
Notification notification = buildNotification();
|
Notification notification = buildNotification();
|
||||||
|
@ -219,8 +221,7 @@ public final class LbrynetService extends PythonService {
|
||||||
JSONObject result = status.getJSONObject("result");
|
JSONObject result = status.getJSONObject("result");
|
||||||
if (result.has("startup_status")) {
|
if (result.has("startup_status")) {
|
||||||
JSONObject startupStatus = result.getJSONObject("startup_status");
|
JSONObject startupStatus = result.getJSONObject("startup_status");
|
||||||
fileManagerReady = startupStatus.has("file_manager")
|
fileManagerReady = startupStatus.has("file_manager") && startupStatus.getBoolean("file_manager");
|
||||||
&& startupStatus.getBoolean("file_manager");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -231,10 +232,8 @@ public final class LbrynetService extends PythonService {
|
||||||
params.put("page_size", 100);
|
params.put("page_size", 100);
|
||||||
params.put("reverse", true);
|
params.put("reverse", true);
|
||||||
params.put("sort", "added_on");
|
params.put("sort", "added_on");
|
||||||
/*
|
/*params.put("status", "stopped");
|
||||||
* params.put("status", "stopped");
|
params.put("comparison", "ne");*/
|
||||||
* params.put("comparison", "ne");
|
|
||||||
*/
|
|
||||||
|
|
||||||
String fileList = Utils.sdkCall("file_list", params);
|
String fileList = Utils.sdkCall("file_list", params);
|
||||||
if (fileList != null) {
|
if (fileList != null) {
|
||||||
|
@ -274,8 +273,7 @@ public final class LbrynetService extends PythonService {
|
||||||
if (fileItems != null && fileItems.length() > 0) {
|
if (fileItems != null && fileItems.length() > 0) {
|
||||||
// TODO: Create Java FileItem class
|
// TODO: Create Java FileItem class
|
||||||
JSONObject item = fileItems.getJSONObject(0);
|
JSONObject item = fileItems.getJSONObject(0);
|
||||||
String downloadPath = item.isNull("download_path") ? null
|
String downloadPath = item.isNull("download_path") ? null : item.getString("download_path");
|
||||||
: item.getString("download_path");
|
|
||||||
if (downloadPath == null || downloadPath.trim().length() == 0) {
|
if (downloadPath == null || downloadPath.trim().length() == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -283,8 +281,7 @@ public final class LbrynetService extends PythonService {
|
||||||
String claimName = item.getString("claim_name");
|
String claimName = item.getString("claim_name");
|
||||||
String uri = String.format("lbry://%s#%s", claimName, claimId);
|
String uri = String.format("lbry://%s#%s", claimName, claimId);
|
||||||
|
|
||||||
if (!downloadManager.isDownloadActive(uri)
|
if (!downloadManager.isDownloadActive(uri) && !downloadManager.isDownloadCompleted(uri)) {
|
||||||
&& !downloadManager.isDownloadCompleted(uri)) {
|
|
||||||
downloadManager.clearWrittenBytesForDownload(uri);
|
downloadManager.clearWrittenBytesForDownload(uri);
|
||||||
File file = new File(downloadPath);
|
File file = new File(downloadPath);
|
||||||
Intent intent = createDownloadEventIntent(uri, outpoint, item.toString());
|
Intent intent = createDownloadEventIntent(uri, outpoint, item.toString());
|
||||||
|
@ -446,6 +443,7 @@ public final class LbrynetService extends PythonService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static Intent createDownloadEventIntent(String uri, String outpoint, String fileInfo) {
|
private static Intent createDownloadEventIntent(String uri, String outpoint, String fileInfo) {
|
||||||
Intent intent = new Intent();
|
Intent intent = new Intent();
|
||||||
intent.setAction(DownloadManager.ACTION_DOWNLOAD_EVENT);
|
intent.setAction(DownloadManager.ACTION_DOWNLOAD_EVENT);
|
||||||
|
@ -472,15 +470,14 @@ public final class LbrynetService extends PythonService {
|
||||||
|
|
||||||
if (intent == null) {
|
if (intent == null) {
|
||||||
intent = ServiceHelper.buildIntent(
|
intent = ServiceHelper.buildIntent(
|
||||||
getApplicationContext(), "", LbrynetService.class, "lbrynetservice");
|
getApplicationContext(), "", LbrynetService.class, "lbrynetservice");
|
||||||
}
|
}
|
||||||
|
|
||||||
// send a broadcast indicating that the service has started
|
// send a broadcast indicating that the service has started
|
||||||
Intent startedIntent = new Intent(LBRY_SDK_SERVICE_STARTED);
|
Intent startedIntent = new Intent(LBRY_SDK_SERVICE_STARTED);
|
||||||
sendBroadcast(startedIntent);
|
sendBroadcast(startedIntent);
|
||||||
|
|
||||||
// no need to iterate the checks repeatedly here, because this is service
|
// no need to iterate the checks repeatedly here, because this is service startup
|
||||||
// startup
|
|
||||||
checkDownloads();
|
checkDownloads();
|
||||||
|
|
||||||
return super.onStartCommand(intent, flags, startId);
|
return super.onStartCommand(intent, flags, startId);
|
||||||
|
@ -499,8 +496,8 @@ public final class LbrynetService extends PythonService {
|
||||||
}
|
}
|
||||||
|
|
||||||
Context context = getApplicationContext();
|
Context context = getApplicationContext();
|
||||||
NotificationManager notificationManager = (NotificationManager) context
|
NotificationManager notificationManager =
|
||||||
.getSystemService(Context.NOTIFICATION_SERVICE);
|
(NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
notificationManager.cancelAll();
|
notificationManager.cancelAll();
|
||||||
|
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
|
@ -553,7 +550,7 @@ public final class LbrynetService extends PythonService {
|
||||||
// If the disk data is out of date, extract it and write the
|
// If the disk data is out of date, extract it and write the
|
||||||
// version file.
|
// version file.
|
||||||
// if (! data_version.equals(disk_version)) {
|
// if (! data_version.equals(disk_version)) {
|
||||||
if (!data_version.equals(disk_version)) {
|
if (! data_version.equals(disk_version)) {
|
||||||
Log.v(TAG, "Extracting " + resource + " assets.");
|
Log.v(TAG, "Extracting " + resource + " assets.");
|
||||||
|
|
||||||
recursiveDelete(target);
|
recursiveDelete(target);
|
||||||
|
@ -561,7 +558,7 @@ public final class LbrynetService extends PythonService {
|
||||||
|
|
||||||
AssetExtract ae = new AssetExtract(getApplicationContext());
|
AssetExtract ae = new AssetExtract(getApplicationContext());
|
||||||
if (!ae.extractTar(resource + ".mp3", target.getAbsolutePath())) {
|
if (!ae.extractTar(resource + ".mp3", target.getAbsolutePath())) {
|
||||||
// toastError("Could not extract " + resource + " data.");
|
//toastError("Could not extract " + resource + " data.");
|
||||||
Log.e(TAG, "Could not extract " + resource + " data.");
|
Log.e(TAG, "Could not extract " + resource + " data.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# going forward, this should match sdk version
|
# going forward, this should match sdk version
|
||||||
__version__ = "0.112.0"
|
__version__ = "0.102.0"
|
||||||
|
|
||||||
class ServiceApp(App):
|
class ServiceApp(App):
|
||||||
def build(self):
|
def build(self):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue