Compare commits

..
159 Commits
Author SHA1 Message Date
Akinwale Ariwodola 116de67d4c app head: downgrade drawer navigator 2020-01-07 11:21:30 +01:00
Akinwale Ariwodola c6b8dfd539 app head: download and open file button fixes 2020-01-07 08:50:24 +01:00
Akinwale Ariwodola 37f33e9943 fix WebView package 2020-01-07 08:35:06 +01:00
Akinwale Ariwodola 4bae7fdf94 app head: fix tag search result 2020-01-06 23:02:06 +01:00
Akinwale Ariwodola c455bde154 app head: performance and fixes. disable hermes engine. 2020-01-06 21:55:59 +01:00
Akinwale Ariwodola 5aa4321787 app head: merge resolved search commits 2020-01-05 19:08:52 +01:00
Akinwale Ariwodola 27a2100c72 app head: resolved search updates 2020-01-05 18:12:49 +01:00
Akinwale Ariwodola 4fc82c6527 app head: resolved search 2020-01-05 13:58:12 +01:00
Akinwale Ariwodola 56486ad274 app head: storage permission checks 2020-01-04 07:11:50 +01:00
Akinwale Ariwodola 99a38e655b bumpversion 0.12.1 --> 0.12.2 2020-01-03 19:12:14 +01:00
Akinwale Ariwodola 262050147d sdk 0.51.2 2020-01-03 18:55:47 +01:00
Akinwale Ariwodola 5ff2e608c2 app head: reactotron and search improvements 2019-12-29 11:17:13 +01:00
Akinwale Ariwodola 4e305faf5b app head: remove console.log 2019-12-29 07:24:26 +01:00
Akinwale Ariwodola 0bdbb843fb add android:exported to activity definition in manifest 2019-12-29 07:20:48 +01:00
Akinwale Ariwodola c8736ad26e update gradle dependencies 2019-12-29 07:15:14 +01:00
Akinwale Ariwodola 57d6b72f5a First run changes (#809)
* don't request for storage permission on first startup
* app head: download button tweaks
* fix download manager
2019-12-28 16:06:14 +01:00
Akinwale Ariwodola d0117b14db React Native 0.61 (#808)
* support for RN 0.61.5
* update gradle_dependencies
2019-12-28 15:42:26 +01:00
Akinwale Ariwodola 6729842ed8 app head: channel name and follower background 2019-12-20 18:55:10 +01:00
Akinwale Ariwodola 723ade8ba6 bumpversion 0.12.0 --> 0.12.1 2019-12-20 09:03:00 +01:00
Akinwale Ariwodola 83066232b6 sdk 0.50.1 2019-12-20 09:02:10 +01:00
Akinwale Ariwodola 4dc0b19c5d Merge pull request #800 from lbryio/snackbars
snackbar support
2019-12-20 08:00:07 +01:00
Akinwale Ariwodola a58cc820ef app head: update master 2019-12-18 16:51:07 +01:00
Akinwale Ariwodola 2b3397bc85 snackbar support 2019-12-18 11:48:29 +01:00
Akinwale Ariwodola a519b5c0b1 app head: display balance on LBC input focus 2019-12-13 17:36:01 +01:00
Akinwale Ariwodola fb3a34c871 disable sound on download notifications 2019-12-13 15:10:02 +01:00
Akinwale Ariwodola a1bc3fcd7e fix notification icon 2019-12-13 14:51:44 +01:00
Akinwale Ariwodola 7daf3c6f55 add headers download to CI for 64-bit build 2019-12-11 17:06:28 +01:00
Akinwale Ariwodola 7d032179ef fix CI build 2019-12-11 16:20:45 +01:00
Akinwale Ariwodola 156507f8f7 remove headers file and dynamically download for build 2019-12-11 16:15:16 +01:00
Akinwale Ariwodola 032a1927db bumpversion 0.11.1 --> 0.12.0 2019-12-11 09:08:42 +01:00
Akinwale Ariwodola f24bf570ef app head: fixes before release 2019-12-11 09:08:26 +01:00
Akinwale Ariwodola 75c2ece016 add headers file to package (#792)
* latest headers
2019-12-11 08:46:34 +01:00
Akinwale Ariwodola 0c1c1a6c79 sdk 0.49.0 2019-12-10 16:30:18 +01:00
Akinwale Ariwodola 5af25a9d43 app head: update 2019-12-06 17:24:34 +01:00
Akinwale Ariwodola 55fec0f578 sdk 0.48.0 2019-12-05 13:42:42 +01:00
Akinwale Ariwodola b61fc3a148 Merge pull request #786 from lbryio/i18n
add language constant for app launch
2019-12-05 13:20:18 +01:00
Akinwale Ariwodola e3cd0fc2b1 add language constant for app launch 2019-12-05 13:19:22 +01:00
g1tman fe01f50c65 Perf: Use of sort and sorted functions optimized (#748)
* Update mixer.py
* Update graph.py
* Update mixer.py
* Update mixer.py
* Update bdistapk.py
* Update toolchain.py
* Update build.py
* Update build.py
2019-11-25 11:28:16 +01:00
Akinwale Ariwodola cd378d16e3 app head: fetching cost info fix 2019-11-12 21:10:57 +01:00
Akinwale Ariwodola e951fabf1c bumpversion 0.11.0 --> 0.11.1 2019-11-12 16:21:22 +01:00
Akinwale Ariwodola 48543a48fb log events for received and opened notifications (#760)
* log events for received and opened notifications
* app head: update to master
2019-11-12 15:50:47 +01:00
Akinwale Ariwodola 2699893581 bumpversion 0.10.2 --> 0.11.0 2019-11-04 08:49:41 +01:00
Akinwale Ariwodola 21914a0bd7 Merge pull request #752 from lbryio/fcm-data
handle FCM data-only messages
2019-11-04 08:48:50 +01:00
Akinwale Ariwodola d83667682d handle FCM data-only messages 2019-11-01 06:54:32 +01:00
Akinwale Ariwodola a5dc01f589 app head: hide notification settings 2019-10-31 17:35:18 +01:00
Akinwale Ariwodola fb497cebfe app head: fix launch urls and notification target urls 2019-10-31 07:55:36 +01:00
Akinwale Ariwodola 9ffaba4358 app head: normalise tag name from search result 2019-10-30 13:05:44 +01:00
Akinwale Ariwodola be85307fe8 sdk 0.43.4 2019-10-30 11:24:04 +01:00
Akinwale Ariwodola b55961bd83 bumpversion 0.10.1 --> 0.10.2 2019-10-30 11:21:26 +01:00
Akinwale Ariwodola f4911394ba app head: master 2019-10-30 10:36:10 +01:00
Akinwale Ariwodola 42cf11358e handle remote notification payloads (#737)
* handle remote notification payloads
* handle intent extras for background notifications
2019-10-30 10:34:57 +01:00
Akinwale Ariwodola 6e6ed07890 app head: rc 2019-10-30 10:33:09 +01:00
Thomas Zarebczan 22327bf33e Merge pull request #723 from mohatagarvit/master
Update google-services.json path in BUILD.md #722
2019-10-28 10:31:15 -04:00
Thomas Zarebczan 57d8bc3311 Merge pull request #721 from sidhyatikku/patch-1
Initialised a GitHub PR Template
2019-10-28 10:30:17 -04:00
Thomas Zarebczan 6589799a2a Update PULL_REQUEST_TEMPLATE.md 2019-10-28 10:29:43 -04:00
Thomas Zarebczan 7d6370163b Merge pull request #734 from Janith96/patch-1
Update QUICKSTART.md
2019-10-28 10:28:17 -04:00
Thomas Zarebczan 9a5d63b7fc Update QUICKSTART.md 2019-10-28 10:27:48 -04:00
Thomas Zarebczan 2d872a57ee Merge pull request #715 from StrikerRUS/patch-1
Delete .travis.yml
2019-10-28 10:25:53 -04:00
Thomas Zarebczan f9c0850acd Merge pull request #724 from EricBrianAnil/patch-1
Updated screenshots
2019-10-23 17:38:42 -04:00
Janith Udayanga 994ec732a4 Update QUICKSTART.md
Corrected Typos, Added Links to the mentioned Repos, Made Topics more clear & more readable.
2019-10-23 10:48:48 +05:30
Akinwale Ariwodola b44770c77f Navigation drawer fix (#729)
* app head: downgrade react-navigation-drawer package
* app head: adjust drawer width
2019-10-21 18:42:12 +01:00
Akinwale Ariwodola 7ea836e249 app head: fix blank password wallet state 2019-10-21 15:56:22 +01:00
Eric Brian Anil 16d2401e38 Added gif as requested
Updated the old image with the gif from https://lbry.com/android as requested
2019-10-21 11:00:33 +05:30
Akinwale Ariwodola 259dc4c7cc bumpversion 0.10.0 --> 0.10.1 2019-10-20 19:33:58 +01:00
Akinwale Ariwodola 3bcd67b8fb sdk 0.43.3 2019-10-20 19:33:22 +01:00
Eric Brian Anil 648d9103b7 Updated screenshots
Updated the file with the screenshots of the most recent version of the app. The  existing screenshot had been of a previous version .
2019-10-20 23:02:27 +05:30
Garvit Mohata faac434d33 Update google-services.json path in BUILD.md #722
Updates the google-services.json path as per the current directory structure
2019-10-20 16:28:06 +05:30
Sidhya Tikku f558cc49f7 Create PULL_REQUEST_TEMPLATE.md 2019-10-20 00:27:38 +05:30
Akinwale Ariwodola 5add227e55 sdk 0.43.2 2019-10-17 20:27:55 +01:00
Akinwale Ariwodola 4519a5d174 app head: fix for devices without Firebase support 2019-10-17 19:55:55 +01:00
Akinwale Ariwodola 095bed4482 app head: proceed from splash if Firebase doesn't work 2019-10-17 19:12:49 +01:00
Akinwale Ariwodola 07dc95b639 app head: remove getSync wait before navigation to main 2019-10-17 18:20:38 +01:00
Akinwale Ariwodola edc3ebcff1 bumpversion 0.9.3 --> 0.10.0 2019-10-17 16:04:56 +01:00
Akinwale Ariwodola 0f7055ca5b Revert "bumpversion 0.9.3 --> 0.9.4"
This reverts commit f426321e15.
2019-10-17 16:03:39 +01:00
Akinwale Ariwodola f426321e15 bumpversion 0.9.3 --> 0.9.4 2019-10-17 14:57:49 +01:00
Akinwale Ariwodola 70d5cb3e2b RC 0.9.4 (#712)
* sdk 0.43.1
2019-10-17 14:55:44 +01:00
Nikita Titov 15e4dca984 Delete .travis.yml 2019-10-16 02:10:12 +03:00
Thomas Zarebczan 3a7221d71b Merge pull request #705 from sumitkharche/master
Added license badge
2019-10-15 12:18:57 -04:00
Thomas Zarebczan e8cb3afb34 Update README.md 2019-10-15 12:18:40 -04:00
Thomas Zarebczan 2b7a580001 Merge pull request #708 from akshitsarin/patch-1
Fixed a typo in QUICKSTART.md
2019-10-13 17:58:47 -04:00
Akshit Sarin b5d327581b Fixed a typo in QUICKSTART.md
Signed-off-by: Akshit Sarin <akshitsarin99@gmail.com>

'*toolcahin* to toolchain'
2019-10-14 03:11:31 +05:30
Sumit Kharche c0ca45e949 Added license and build badges 2019-10-13 00:41:09 +05:30
Akinwale Ariwodola 4acc107d3a Share (#704)
* use native share interface for sharing LBRY URLs
2019-10-11 17:22:39 +01:00
Akinwale Ariwodola 1070dba0ae sdk 0.42.1 (#703)
* sdk 0.42.1
2019-10-11 17:15:26 +01:00
Akinwale Ariwodola 7ae5d48767 add Firebase Cloud Messaging support (#702)
* add Firebase Cloud Messaging support
* add default notification channel for FCM
2019-10-11 14:18:45 +01:00
Akinwale Ariwodola e5c05fac48 Merge pull request #700 from StrikerRUS/license
bump year in license
2019-10-11 13:58:37 +01:00
StrikerRUS f7c4b94546 bump year in license 2019-10-09 00:00:31 +03:00
Akinwale Ariwodola a58af97216 bumpversion 0.9.2 --> 0.9.3 2019-10-04 16:19:37 +01:00
Akinwale Ariwodola 3759a9703a app head: suggested subs and improvements 2019-10-03 16:50:02 +01:00
Akinwale Ariwodola 2d3ed191fd app head: fix channel creator edit mode 2019-09-27 00:50:12 +01:00
Akinwale Ariwodola 425817b896 bumpversion 0.9.1 --> 0.9.2 2019-09-27 00:04:23 +01:00
Akinwale Ariwodola aaf3be2f7b app head: code cleanup 2019-09-27 00:02:59 +01:00
Akinwale Ariwodola bc810c80d6 app head: fix publishing 2019-09-27 00:00:35 +01:00
Akinwale Ariwodola e7a6f6f921 app head: fix typo 2019-09-26 09:54:42 +01:00
Akinwale Ariwodola 26542abc4d app head: channel creator fixes. fix wallet sync disable / re-enable errors. 2019-09-26 07:26:22 +01:00
Akinwale Ariwodola 46fd7f40d4 bumpversion 0.9.0 --> 0.9.1 2019-09-26 00:13:45 +01:00
Akinwale Ariwodola 40eaa80f4b app head: fix channel creator canSave flag 2019-09-25 23:35:24 +01:00
Akinwale Ariwodola ea8f93061d app head: post-0.9.0 fixes 2019-09-25 23:22:12 +01:00
Akinwale Ariwodola 2ec2593704 app head: fix channel creator text input errors 2019-09-25 19:24:04 +01:00
Akinwale Ariwodola c4949c7794 app head: back navigation tweak 2019-09-25 17:57:24 +01:00
Akinwale Ariwodola 7572a0da5a app head: blank passwords 2019-09-25 16:37:54 +01:00
Akinwale Ariwodola 678b9c3184 app head: fix back navigation and channel name validation 2019-09-25 14:45:19 +01:00
Akinwale Ariwodola 2900b18cce bumpversion 0.8.4 --> 0.9.0 2019-09-24 19:03:43 +01:00
Akinwale Ariwodola 580e78afab app head: show delete button for owned claims 2019-09-24 18:59:34 +01:00
Akinwale Ariwodola ace430abe6 0.9.0 rc (#679)
* app head: sync user settings
* app head: fix errors and user shared state
* sdk 0.40.1
* app head: empty state views. fix publishing state.
2019-09-24 17:31:00 +01:00
Akinwale Ariwodola 54c6089bdc app head: better handling of pending form states 2019-09-15 12:47:38 +01:00
Akinwale Ariwodola 8b308abfb8 Merge pull request #676 from lbryio/publish-channel-selector
app head: fix channel selector issues on publish page
2019-09-15 12:06:23 +01:00
Akinwale Ariwodola 53696970a7 app head: fix channel selector issues on publish page 2019-09-13 08:50:45 +01:00
Akinwale Ariwodola 18e2d8ad5e app head: channel creator updates 2019-09-13 08:17:17 +01:00
Akinwale Ariwodola 46cf9ad4ad bumpversion 0.8.3 --> 0.8.4 2019-09-06 19:44:54 +01:00
Akinwale Ariwodola a11f560183 app head: 0.8.4 rc 2019-09-06 19:43:58 +01:00
Akinwale Ariwodola 23fbde6df4 app head: pin lbryinc commit 2019-09-06 16:24:34 +01:00
Akinwale Ariwodola 512e4988d2 app head: unlock after set default account 2019-09-06 16:13:39 +01:00
Akinwale Ariwodola eb41a5e529 app head: fix featured search item 2019-09-06 15:03:34 +01:00
Akinwale Ariwodola cefc126ffe app head: account unlock after sync apply 2019-09-06 14:52:27 +01:00
Akinwale Ariwodola 29286efbd4 sdk 0.40.0. fix merge conflicts. 2019-09-05 16:48:18 +01:00
Akinwale Ariwodola ea30ad5974 Channel creator (#663)
* app head: channel creator page
* remove react-native-document-picker
* app head: support optional parameters
* app head: channel creator updates. upload image assets.
2019-09-05 15:59:51 +01:00
Akinwale Ariwodola 5f30cca79b app head: channel creator page 2019-08-30 18:31:49 +01:00
Akinwale Ariwodola d76cf4457e app head: cleanup 2019-08-27 07:10:34 +01:00
Akinwale Ariwodola 88d58f4344 app head: fix all content filter selectors 2019-08-27 06:52:16 +01:00
Akinwale Ariwodola 93819b3afd app head: fix: pin react-native-gesture-handler version 2019-08-26 21:18:37 +01:00
Akinwale Ariwodola 7b438db34f app head: fix not_tags and npm packages 2019-08-26 21:02:09 +01:00
Akinwale Ariwodola f526d797f8 app head: fix buildURI calls 2019-08-26 20:46:29 +01:00
Akinwale Ariwodola 05f7b07449 bumpversion 0.8.2 --> 0.8.3 2019-08-26 09:41:34 +01:00
Akinwale Ariwodola ddf7c66933 app head: master 2019-08-26 09:00:44 +01:00
Akinwale Ariwodola 715a52b291 app head: edit published content (#653) 2019-08-26 08:58:10 +01:00
Akinwale Ariwodola 660adb4a6f setCurrentScreen tweaks 2019-08-25 16:36:25 +01:00
Akinwale Ariwodola e47a1e0bf2 add screen class override for setCurrentScreen 2019-08-23 14:39:08 +01:00
Akinwale Ariwodola 7b2044d2a4 sdk 0.39.0. app head: publish / featured search tweaks 2019-08-21 16:52:28 +01:00
Akinwale Ariwodola 1d3c961c3c app head: tweak video loading indicator 2019-08-21 07:06:09 +01:00
Akinwale Ariwodola dc59a1270f sdk 0.39.2 2019-08-21 05:18:56 +01:00
Akinwale Ariwodola 7452efa047 app head: tweak publish page grid 2019-08-21 05:15:24 +01:00
Akinwale Ariwodola 8517f74c6d fix githubrelease command 2019-08-20 19:57:47 +01:00
Akinwale Ariwodola 637a62ea21 app head: fix your tags and wallet route navigation 2019-08-20 18:49:55 +01:00
Akinwale Ariwodola 16f270fb9f bumpversion 0.8.1 --> 0.8.2 2019-08-20 17:54:40 +01:00
Akinwale Ariwodola c4f016c912 0.8.2 rc with sdk 0.39.0 update (#640)
* sdk 0.39.0
* update aioupnp commit hash
* add defusedxml dependency for aioupnp
2019-08-20 17:54:02 +01:00
Akinwale Ariwodola e63bc44055 tweak fresco gradle dependencies. fail build if the bundle doesn't build. 2019-08-17 02:23:17 +01:00
Akinwale Ariwodola 99c8e14773 Merge pull request #637 from lbryio/gallery-thumbnails
app head: gallery thumbnails and publish style tweaks
2019-08-15 19:06:40 +01:00
Akinwale Ariwodola d84fb51f6f app head: gallery thumbnails and publish style tweaks 2019-08-15 06:08:53 +01:00
Akinwale Ariwodola a8309ffaf5 add ReactMethod to call firebase setCurrentScreen 2019-08-14 16:15:20 +01:00
Akinwale Ariwodola fd97ba3ae9 Drawer menu stutter (#633)
* app head: fix drawer menu stuttering and getting stuck
* fix release script
* fix 32-bit gradle template
2019-08-13 12:32:38 +01:00
Akinwale Ariwodola 305e62746c different version codes for 32- and 64-bit 2019-08-12 16:43:51 +01:00
Akinwale Ariwodola bf57de9d96 only include arm64-v8a for arm64 2019-08-12 15:11:53 +01:00
Akinwale Ariwodola 07e52d2a83 remove arm64-v8a folder from 32-bit builds 2019-08-12 15:07:09 +01:00
Akinwale Ariwodola 36a0450c1d fix last step in release apk stage 2019-08-12 14:33:19 +01:00
Akinwale Ariwodola f49e8134dd app head: fix remaining publish bugs 2019-08-12 13:23:11 +01:00
Akinwale Ariwodola a54037270b app head: fix navigate back to trending and claim_search end detection 2019-08-11 18:38:16 +01:00
Akinwale Ariwodola 4a6b091496 app head: yet more fixes. 2019-08-11 17:16:17 +01:00
Akinwale Ariwodola 03addf41c7 app head: misc fixes 2019-08-11 08:53:26 +01:00
Akinwale Ariwodola 9440855bf2 app head: fix publishing bugs 2019-08-11 00:08:06 +01:00
Akinwale Ariwodola d53b1b94e5 Merge pull request #629 from lbryio/multi-arch-builds
build 32-bit and 64-bit APKs
2019-08-10 19:06:30 +01:00
Akinwale Ariwodola 16ebf7bb11 build 32-bit and 64-bit APKs 2019-08-10 12:25:57 +01:00
Akinwale Ariwodola c8e7194a94 app head: display remaining discover tags and fix publish cancel bug 2019-08-10 10:14:44 +01:00
Akinwale Ariwodola c6527fc57a app head: don't show anonymous while resolving file item 2019-08-10 08:13:23 +01:00
Akinwale Ariwodola bf906479d8 app head: Daemon (lbrynet) --> LBRY SDK 2019-08-10 08:02:14 +01:00
Akinwale Ariwodola 938512f826 bumpversion 0.8.0 --> 0.8.1 2019-08-10 07:58:00 +01:00
Akinwale Ariwodola bbc068b889 0.8.1 rc (#628)
* app head: fix first set of release blockers
* sdk 0.38.6
* app head: pin lbryinc version
* app head: fix error on tag page
* app head: update pinned lbry-redux version
* app head: fix tag page back navigation and routes
* app head: fix nsfw functionality. add GA events.
* app head: fix release blockers
2019-08-10 07:57:06 +01:00
Akinwale Ariwodola 0ae9fd44d2 app head: react navigation tweaks 2019-08-09 07:55:43 +01:00
Akinwale Ariwodola d266b9f55b Performance (#626) 2019-08-09 07:42:21 +01:00
69 changed files with 6719 additions and 368 deletions

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
## PR Checklist
<!-- For the checkbox formatting to work properly, make sure there are no spaces on either side of the "x" -->
Please check all that apply to this PR using "x":
- [ ] I have checked that this PR is not a duplicate of an existing PR (open, closed or merged)
- [ ] I have checked that this PR does not introduce a breaking change
- [ ] This PR introduces breaking changes and I have provided a detailed explanation below
## PR Type
What kind of change does this PR introduce?
- [ ] Bugfix
- [ ] Feature
- [ ] Code style update (formatting)
- [ ] Refactoring (no functional changes)
- [ ] Documentation changes
- [ ] Other - Please describe:
## Fixes
Issue Number:
## What is the current behavior?
## What is the new behavior?
## Other information
<!-- If this PR contains a breaking change, please describe the impact and solution strategy for existing applications below. -->
+1 -1
View File
@@ -6,6 +6,7 @@ bin
buildozer.spec
build.log
recipes/**/*.pyc
src/main/assets/blockchain/headers
src/main/assets/index.android.bundle
src/main/assets/index.android.bundle.meta
*.log
@@ -14,4 +15,3 @@ src/main/assets/index.android.bundle.meta
lbry-android.keystore
p4a/pythonforandroid/bootstraps/lbry/build/templates/google-services.json
.gitsecret/keys/random_seed
+53 -13
View File
@@ -1,9 +1,10 @@
stages:
- build
- build2
- deploy
- release
build apk:
build arm64 apk:
stage: build
image: lbry/android-base:latest
before_script:
@@ -12,7 +13,7 @@ build apk:
- git submodule update --init --force --recursive
artifacts:
paths:
- bin/browser-*-release.apk
- bin/browser-*-release__arm64.apk
expire_in: 1 week
script:
- export PATH=/usr/bin:$PATH
@@ -25,26 +26,62 @@ build apk:
- rm -rf ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
- ln -s ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21 ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
- cp -f $CI_PROJECT_DIR/scripts/build-target-python.sh ~/.buildozer/android/crystax-ndk-10.3.2/build/tools/build-target-python.sh
- cp -f $CI_PROJECT_DIR/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
- cp -f $CI_PROJECT_DIR/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
- rm ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz
- git secret reveal
- mv buildozer.spec.ci buildozer.spec
- mv buildozer.spec.arm64.ci buildozer.spec
- mkdir -p $CI_PROJECT_DIR/src/main/assets/blockchain && wget -q https://headers.lbry.io/blockchain_headers_latest -O $CI_PROJECT_DIR/src/main/assets/blockchain/headers
- "./release.sh | grep -Fv -e 'working:' -e 'copy' -e 'Compiling' --line-buffered"
- cp $CI_PROJECT_DIR/bin/browser-$BUILD_VERSION-release.apk $CI_PROJECT_DIR/bin/browser-$BUILD_VERSION-release__arm64.apk
- cp $CI_PROJECT_DIR/bin/browser-$BUILD_VERSION-release.apk /dev/null
build arm apk:
stage: build2
image: lbry/android-base:latest
before_script:
- export BUILD_VERSION=$(cat $CI_PROJECT_DIR/src/main/python/main.py | grep --color=never -oP '([0-9]+\.?)+')
- git submodule sync --recursive
- git submodule update --init --force --recursive
artifacts:
paths:
- bin/browser-*-release__arm.apk
expire_in: 1 week
script:
- export PATH=/usr/bin:$PATH
- echo "$PGP_PRIVATE_KEY" | gpg --batch --import
- cd app
- npm install
- cd ..
- 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/
- rm -rf ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
- ln -s ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21 ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
- cp -f $CI_PROJECT_DIR/p4a/pythonforandroid/bootstraps/lbry/build/templates/build.tmpl.gradle.arm $CI_PROJECT_DIR/p4a/pythonforandroid/bootstraps/lbry/build/templates/build.tmpl.gradle
- cp -f $CI_PROJECT_DIR/scripts/build-target-python.sh ~/.buildozer/android/crystax-ndk-10.3.2/build/tools/build-target-python.sh
- cp -f $CI_PROJECT_DIR/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
- rm ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz
- git secret reveal
- mv buildozer.spec.arm.ci buildozer.spec
- mkdir -p $CI_PROJECT_DIR/src/main/assets/blockchain && wget -q https://headers.lbry.io/blockchain_headers_latest -O $CI_PROJECT_DIR/src/main/assets/blockchain/headers
- "./release.sh | grep -Fv -e 'working:' -e 'copy' -e 'Compiling' --line-buffered"
- cp $CI_PROJECT_DIR/bin/browser-$BUILD_VERSION-release.apk $CI_PROJECT_DIR/bin/browser-$BUILD_VERSION-release__arm.apk
- cp $CI_PROJECT_DIR/bin/browser-$BUILD_VERSION-release.apk /dev/null
deploy build.lbry.io:
image: python:latest
stage: deploy
dependencies:
- build apk
- build arm apk
- build arm64 apk
before_script:
- pip install awscli
- export BUILD_VERSION=$(cat $CI_PROJECT_DIR/src/main/python/main.py | grep --color=never -oP '([0-9]+\.?)+')
- export BUILD_APK_FILENAME=browser-$BUILD_VERSION-release.apk
- export BUILD_APK_FILENAME__32=browser-$BUILD_VERSION-release__arm.apk
- export BUILD_APK_FILENAME__64=browser-$BUILD_VERSION-release__arm64.apk
script:
- aws s3 cp bin/$BUILD_APK_FILENAME s3://build.lbry.io/android/build-${CI_PIPELINE_IID}_commit-${CI_COMMIT_SHA:0:7}/$BUILD_APK_FILENAME
- aws s3 cp bin/$BUILD_APK_FILENAME s3://build.lbry.io/android/push.apk
- aws s3 cp bin/$BUILD_APK_FILENAME__64 s3://build.lbry.io/android/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/build-${CI_PIPELINE_IID}_commit-${CI_COMMIT_SHA:0:7}/$BUILD_APK_FILENAME__32
- aws s3 cp bin/$BUILD_APK_FILENAME__64 s3://build.lbry.io/android/push.apk
release apk:
image: python:latest
@@ -52,11 +89,14 @@ release apk:
only:
- tags
dependencies:
- build apk
- build arm apk
- build arm64 apk
before_script:
- pip install awscli githubrelease
- export BUILD_VERSION=$(cat $CI_PROJECT_DIR/src/main/python/main.py | grep --color=never -oP '([0-9]+\.?)+')
- export BUILD_APK_FILENAME=browser-$BUILD_VERSION-release.apk
- export BUILD_APK_FILENAME__32=browser-$BUILD_VERSION-release__arm.apk
- export BUILD_APK_FILENAME__64=browser-$BUILD_VERSION-release__arm64.apk
script:
- githubrelease release lbryio/lbry-android create $CI_COMMIT_TAG --publish bin/$BUILD_APK_FILENAME
- aws s3 cp bin/$BUILD_APK_FILENAME s3://build.lbry.io/android/latest.apk
- githubrelease release lbryio/lbry-android create $CI_COMMIT_TAG --publish bin/$BUILD_APK_FILENAME__64 bin/$BUILD_APK_FILENAME__32
- githubrelease release lbryio/lbry-android edit $CI_COMMIT_TAG --draft
- aws s3 cp bin/$BUILD_APK_FILENAME__64 s3://build.lbry.io/android/latest.apk
-95
View File
@@ -1,95 +0,0 @@
sudo: required
dist: xenial
language: python
python:
- '3.7'
install:
- deactivate
- export PATH=/usr/bin:$PATH
- export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
- sudo dpkg --add-architecture i386
- sudo add-apt-repository ppa:deadsnakes/ppa -y
- sudo apt-get -qq update
- sudo apt-get -qq install build-essential python3.7 python3.7-dev python3.7-venv python3-pip ccache git libncurses5:i386 libstdc++6:i386 libgtk2.0-0:i386 libpangox-1.0-0:i386 libpangoxft-1.0-0:i386 libidn11:i386 python2.7 python2.7-dev openjdk-8-jdk unzip zlib1g-dev zlib1g:i386 m4 libc6-dev-i386
- sudo pip install --upgrade cython==0.28.1 pip setuptools
- wget -q https://nodejs.org/dist/v8.11.1/node-v8.11.1-linux-x64.tar.xz
- tar -xf node-v8.11.1-linux-x64.tar.xz
- sudo ln -s $TRAVIS_BUILD_DIR/node-v8.11.1-linux-x64/bin/node /usr/bin/node
- sudo ln -s $TRAVIS_BUILD_DIR/node-v8.11.1-linux-x64/bin/npm /usr/bin/npm
- git clone https://github.com/lbryio/buildozer.git
- cd app
- npm config set registry="http://registry.npmjs.org/"
- npm install
- sudo npm install -g react-native-cli
- sudo ln -s $TRAVIS_BUILD_DIR/node-v8.11.1-linux-x64/bin/react-native /usr/bin/react-native
- cd ..
- cd buildozer
- sudo python setup.py install
- cd ..
- mv buildozer.spec.travis buildozer.spec
- mkdir -p cd ~/.buildozer/android/platform/
- wget -q 'https://dist.testnet.lbry.tech/crystax-ndk-10.3.2-linux-x86_64.tar.xz' -P ~/.buildozer/android/
- wget -q 'https://dl.google.com/android/android-sdk_r23-linux.tgz' -P ~/.buildozer/android/platform/
- wget -q 'https://dl.google.com/android/repository/platform-27_r01.zip' -P ~/.buildozer/android/platform/
- wget -q 'https://dl.google.com/android/repository/build-tools_r26.0.2-linux.zip' -P ~/.buildozer/android/platform/
- tar -xf ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz -C ~/.buildozer/android/
- cp -f $TRAVIS_BUILD_DIR/scripts/build-target-python.sh ~/.buildozer/android/crystax-ndk-10.3.2/build/tools/build-target-python.sh
- rm -rf ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
- ln -s ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21 ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
- tar -xf ~/.buildozer/android/platform/android-sdk_r23-linux.tgz -C ~/.buildozer/android/platform/
- mv ~/.buildozer/android/platform/android-sdk-linux ~/.buildozer/android/platform/android-sdk-23
- unzip -qq ~/.buildozer/android/platform/platform-27_r01.zip -d ~/.buildozer/android/platform/android-sdk-23/platforms
- mv ~/.buildozer/android/platform/android-sdk-23/platforms/android-8.1.0 ~/.buildozer/android/platform/android-sdk-23/platforms/android-27
- mkdir -p ~/.buildozer/android/platform/android-sdk-23/build-tools
- unzip -qq ~/.buildozer/android/platform/build-tools_r26.0.2-linux.zip -d ~/.buildozer/android/platform/android-sdk-23/build-tools
- mv ~/.buildozer/android/platform/android-sdk-23/build-tools/android-8.1.0 ~/.buildozer/android/platform/android-sdk-23/build-tools/26.0.2
- mkdir -p ~/.buildozer/android/platform/android-sdk-23/licenses
- echo $'\nd56f5187479451eabf01fb78af6dfcb131a6481e' > ~/.buildozer/android/platform/android-sdk-23/licenses/android-sdk-license
- echo $'\n84831b9409646a918e30573bab4c9c91346d8abd' > ~/.buildozer/android/platform/android-sdk-23/licenses/android-sdk-preview-license
script:
- "./release.sh | grep -Fv -e 'working:' -e 'copy' -e 'Compiling' --line-buffered"
- cp $TRAVIS_BUILD_DIR/bin/*.apk /dev/null
before_deploy:
- cd $TRAVIS_BUILD_DIR/bin
- export BUILD_VERSION=$(cat ../src/main/python/main.py | grep --color=never -oP '([0-9]+\.?)+')
- cp browser-$BUILD_VERSION-release.apk latest.apk
deploy:
- provider: releases
api_key:
secure: m+FYX7vHZoiLSHHiJ2d3y8Fm4qSRoIVjEei+5BV17awiow/U8UKvy/5J1n8qfBdq+dpst5z58pTHCKWPbJz84C3z/posJ5mwEcOAaD/kxSAMHbtlaPW90pRWHUu3aW86UM/ggqtljE9Qz8KS/9a0xNUDfcXLkLgxuxgwodMcacEulAAc9TIOCUeR3IFI+KN0ptTCVahCu2JN8DCHKomaR+yKZHdo/9v9XCAcvmImSDu9nUDLH3+A7xQeRpPJqSspk1dadgdXP76kU8t3OKsYuM7DS5AoKvMIc9lZot4UYYKAx7/zavbzeEmqnyskULgsmV8/UDI1AV9U7uFBdrR6dSjISA1k6EHnCgqzasF+lp0hz5iE/0yPxlE9Z1kLW9gZgxSJtjr6Kv2uqAjHYYmpkjtTwHPwBugRM7PWMTxHNcPwkIHpBSRkXjpyDjkWd/LY4X866Y1g2BdIhbGshjy/9Fb2vnYxNZW6drLHn+wWeHJ41Vfgtg1cn01yZGJqgIkcTkhzNL6Bi++y8EBJXDr4L870s336SpbqRuIrO/C16ZFB+XnOg4Ty50Fk5zkbySMHII58iWqSyDYWNvhqo9zU9jn1XQQeok12129Y4t9TUOcJRbxhQ+511lCmVcFIkWHsXDK2QSZ7TeMK5GQUA8OvcNe+WLCJaQ/YD7OZvwlPTvc=
file_glob: true
file: browser-*-release.apk
overwrite: true
skip_cleanup: true
on:
tags: true
- provider: s3
access_key_id:
secure: qEZZ73DWBn9+M2pS4VwsyX8YZjZOENIMP/eoU1A9Vbn155oZpbUaJ7k+4cAXqmBm0WBMKZDqpzCRSGehLAxHFH5rjkj9gLSgd8fY9cveABHkl50HeuxxNsQM+ytk9sCtP8bWOqf7rT/iCgM1soyF2pYmfHM3tU9l0fWK8oZ7pFRIg91hXxUvhvYY2u6B9D1NqSN9T3xtrwEkVjvmkmyKMLCtoIdyB7QdeQciFdGFhZC9DYJVRLxa3BlzZ1T8Qv4MCyIxPjxIugNvVR64VgGjdBdq0BEIyoRqbeIvtqQjlnne4DfJFeCmbDrSva1wDP1UyFoxsRhiWQ/jXXgIyN2CisI6QRD0J+a2LgmbmtkUzhRMuVQJmBrIauulOzcowwRV2J4TtUaAJK9iSHT9D3RLzpazCOnjvJZV9CK5w252Vs5eHnisCSCQk8Ozox96Sg6XW580NEXfkYoGzXLSGiy9zrZs813blUjssEY+jIQmJEby80C3guK7/G4lzthv57psqBWcYd0tFR+vTestS+EFlC02ToUngJhW7I7lPA2G2yrJ5319jFxUSniijb1n72TQthnbqTBahepvKvuG1iWZnCKxS5sWkutFoqEcpQyhXdf7QdR/VrOr8N5xrhK1B8dCYZM6h8eMZbBvOLH49+N6L9jiJz5x+Lk32wcssv1oOgI=
secret_access_key:
secure: lPygaaJdjFgWY4GcXUXC4Oc5op/TE85Md8lX2bzW19058lbcqYSdM0WySQCxoU/4rlM4Q0N8du0qQ3kZXDpP9XSqvFTVnTGTuB4yghUR1yXcpt6u3JOeOX+YAc3wyQ/pmod6VGO0n8pm8hBVsSFXufdBTjD2W+tNrDoa8RYnlWrt7BbICGltB7PcqYh1Qw6S1wDyZt8I4B5JHDhyJmX6FT5KfOb5cJyynpxlKUstUfy1rh81KuGkEcuEVOLg1s7HE1/IUkVIgezAuCrMHjc86qbNcHULJMFCVYntvvs07+tctrPxA/cfS24WkW7smyij+gdZAZWNNgkIDCuwqpex1v1nKn56mC8xXyUl4CnSCuubQtqUBzTmd4T5sF7trTtpVr9NInwy+4mUoCpz2UKZekTjZkqpzCAuC/cBVWE1/k3wsNat6dGyc9QnKXBqLVhuwYsCOteqLW50ToMMMW0ccDV6FXodwZmrunGd5wIX+UgZkf4l32vzKUxHtIupfYbsjylcPc3VO0OzMMKP/3sYLAN6QntVDFc30k1uqqpgJN4t0nV7vvjMI+b0Qr+o7GzUV2d+QulQXOySJgB2pH0kV1EoPAJ8KbqDOy8KgCJl0YIbOaz14+SiRQhotJ2hrLdtsvyVYXMX+d/CKHJSWa2MQq+jD7lMCwVaGg82PFN1gI4=
bucket: "build.lbry.io"
upload-dir: android
region: us-east-1
overwrite: true
skip_cleanup: true
on:
tags: true
- provider: s3
access_key_id:
secure: qEZZ73DWBn9+M2pS4VwsyX8YZjZOENIMP/eoU1A9Vbn155oZpbUaJ7k+4cAXqmBm0WBMKZDqpzCRSGehLAxHFH5rjkj9gLSgd8fY9cveABHkl50HeuxxNsQM+ytk9sCtP8bWOqf7rT/iCgM1soyF2pYmfHM3tU9l0fWK8oZ7pFRIg91hXxUvhvYY2u6B9D1NqSN9T3xtrwEkVjvmkmyKMLCtoIdyB7QdeQciFdGFhZC9DYJVRLxa3BlzZ1T8Qv4MCyIxPjxIugNvVR64VgGjdBdq0BEIyoRqbeIvtqQjlnne4DfJFeCmbDrSva1wDP1UyFoxsRhiWQ/jXXgIyN2CisI6QRD0J+a2LgmbmtkUzhRMuVQJmBrIauulOzcowwRV2J4TtUaAJK9iSHT9D3RLzpazCOnjvJZV9CK5w252Vs5eHnisCSCQk8Ozox96Sg6XW580NEXfkYoGzXLSGiy9zrZs813blUjssEY+jIQmJEby80C3guK7/G4lzthv57psqBWcYd0tFR+vTestS+EFlC02ToUngJhW7I7lPA2G2yrJ5319jFxUSniijb1n72TQthnbqTBahepvKvuG1iWZnCKxS5sWkutFoqEcpQyhXdf7QdR/VrOr8N5xrhK1B8dCYZM6h8eMZbBvOLH49+N6L9jiJz5x+Lk32wcssv1oOgI=
secret_access_key:
secure: lPygaaJdjFgWY4GcXUXC4Oc5op/TE85Md8lX2bzW19058lbcqYSdM0WySQCxoU/4rlM4Q0N8du0qQ3kZXDpP9XSqvFTVnTGTuB4yghUR1yXcpt6u3JOeOX+YAc3wyQ/pmod6VGO0n8pm8hBVsSFXufdBTjD2W+tNrDoa8RYnlWrt7BbICGltB7PcqYh1Qw6S1wDyZt8I4B5JHDhyJmX6FT5KfOb5cJyynpxlKUstUfy1rh81KuGkEcuEVOLg1s7HE1/IUkVIgezAuCrMHjc86qbNcHULJMFCVYntvvs07+tctrPxA/cfS24WkW7smyij+gdZAZWNNgkIDCuwqpex1v1nKn56mC8xXyUl4CnSCuubQtqUBzTmd4T5sF7trTtpVr9NInwy+4mUoCpz2UKZekTjZkqpzCAuC/cBVWE1/k3wsNat6dGyc9QnKXBqLVhuwYsCOteqLW50ToMMMW0ccDV6FXodwZmrunGd5wIX+UgZkf4l32vzKUxHtIupfYbsjylcPc3VO0OzMMKP/3sYLAN6QntVDFc30k1uqqpgJN4t0nV7vvjMI+b0Qr+o7GzUV2d+QulQXOySJgB2pH0kV1EoPAJ8KbqDOy8KgCJl0YIbOaz14+SiRQhotJ2hrLdtsvyVYXMX+d/CKHJSWa2MQq+jD7lMCwVaGg82PFN1gI4=
bucket: "build.lbry.io"
upload-dir: "android/build-${TRAVIS_BUILD_NUMBER}_commit-${TRAVIS_COMMIT:0:7}"
region: us-east-1
overwrite: true
skip_cleanup: true
on:
all_branches: true
env:
global:
- secure: GS3Cp1QXiX8UPye3kdk2A2f3iFRr02sHKpY+RE+Zvx3Q7GDmhDuepHKzx6Hq5Os5fZN9Y/Bdds+XH+vLIRtT6XsWR7AONPhSifVY3XB5/2F+lDcZ538W8P8GZvXejpY4VecMUWHoWbuyt0s3PpaGXZJcHp8ir+CUJ0NUmU3I9w449pqj9/de2LHtG3qKH1lG0Xz58iOC0mmEeH451cQv3dDw851ihA4ak9vCTV1KKuMJUcv+2u6PxXGVX0mrJLEssjL6ze6G5iZUB4PM1vUpe3HqcVw8CSOa8O79BQxoB00qyA3WD+LpZDPpI0wh6gmBsR/2nCFyMJndJr3CjyB6lHdK7PgBoK0CJjszKawiZqg74O9DOjzTJTO2v9bnkfPrNxu4/3D/tbDg+whY8k5oV1sgDue9KAo/2aEEO0LGlKP4W3Qqt/lzRKsfpMVrMTdCNKJ8rG/wUFWw8ehOCmAsJaQ1saDOZDMNPLLuYpxFgmXFqWV5ThbUHgEJVj+G7qt6CMEussKvuZJoJZx24Pdk5Prr7ENzTyPmE5gk4b8WNfVNleOEC09xu5tFk2yOdzF1dawKsa1Mog6gImirTQ/INC/3BANdKoG9/cLJEIt9boJaFDXE1dpqoLVzoez9znHKOGSAU/1PaH3thjVnbUyO5z24PpPZ12zM3+3P8DbI454=
before_install:
- openssl aes-256-cbc -K $encrypted_b4c9b905b12e_key -iv $encrypted_b4c9b905b12e_iv
-in lbry-android.keystore.enc -out lbry-android.keystore -d
+1 -1
View File
@@ -71,7 +71,7 @@ Assuming `lbry-android` as the current working folder:
The `google-services.json` file is required for the build to be successful due to the Firebase implementation. Simply copy the provided sample file into the same destination folder.
```
cd lbry-android
cp p4a/pythonforandroid/bootstraps/lbry/templates/google-services.sample.json p4a/pythonforandroid/bootstraps/lbry/templates/google-services.json
cp p4a/pythonforandroid/bootstraps/lbry/build/templates/google-services.sample.json p4a/pythonforandroid/bootstraps/lbry/build/templates/google-services.json
```
#### Setup Android SDK for buildozer
+1 -1
View File
@@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2017-2018 LBRY Inc
Copyright (c) 2017-2019 LBRY Inc
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish,distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+10 -10
View File
@@ -1,17 +1,17 @@
### Introduction
# Introduction
If you would like to contribute to the Android app, but find the build documentation a little daunting, this guide lets you copy-paste your way to a successful APK build.
#### Estimated build time
### Estimated build time
25 - 40 minutes (depending on Internet connection speeds)
#### What do you need?
* A computer running Ubuntu 18.04
### What do you need?
* A computer running [Ubuntu 18.04](https://ubuntu.com/download/desktop)
* Internet access to download modules and packages.
* At least 15GB of free disk space.
* Alternatively, Docker. You can skip steps 1 through 5 if you make use of the `lbry/android-base` Docker base image. Scroll down to Fast track if you would prefer to use Docker.
* Alternatively, Docker. You can skip steps 1 through 5 if you make use of the `lbry/android-base` Docker base image. Scroll down to [Fast Track](#Fast-Track) at the bottom of the page if you would prefer to use Docker.
### Step 1 of 10
Install all the apt packages required by running the following commands. You can copy-paste directly to your terminal.
Install all the apt packages required by running the following commands. You can copy-paste this directly to your terminal.
```
sudo dpkg --add-architecture i386
sudo apt-get -y update
@@ -32,7 +32,7 @@ sudo -H pip install --upgrade cython==0.28.1 setuptools
```
### Step 3 of 10
Install buildozer, a tool for creating the apk package using the python for android toolcahin.
Install [buildozer](https://github.com/lbryio/buildozer.git), a tool for creating the apk package using the python for android toolchain.
```
git clone https://github.com/lbryio/buildozer.git
cd buildozer && python2.7 setup.py install && cd ..
@@ -72,7 +72,7 @@ wget 'https://www.crystax.net/download/crystax-ndk-10.3.2-linux-x86_64.tar.xz' -
```
### Step 7 of 10
Clone the lbryio/lbry-android git repository, initialise submodules and create your `buildozer.spec` and `google-services.json` files. The provided `buildozer.spec.sample` contains defaults provided you followed steps 1 through 5 exactly as described. You can also customise the spec file if you want to. The `google-services.sample.json` can be used to ensure the build completes successfully.
Clone the [lbryio/lbry-android git repository](https://github.com/lbryio/lbry-android), initialise submodules and create your `buildozer.spec` and `google-services.json` files. The provided `buildozer.spec.sample` contains defaults provided you followed steps 1 through 5 exactly as described. You can also customise the spec file if you want to. The `google-services.sample.json` can be used to ensure the build completes successfully.
```
git clone https://github.com/lbryio/lbry-android
cd lbry-android
@@ -103,11 +103,11 @@ If you made it this far, you're finally ready to build the package! You just hav
buildozer android debug
```
### Fast Track
### Fast Track {#Fast-Track}
Install Docker and start a container using the `lbry/android-base` image, which is about 1.72GB in size. Run the following commands for Ubuntu and then follow steps 6 through 10 in the container's bash prompt.
```
sudo apt-get install docker-ce
docker run -it lbry/android-base:latest /bin/bash
```
**Protip:** You can also make use of Docker to run your builds on macOS or Windows.
**Pro Tip:** You can also make use of Docker to run your builds on macOS or Windows.
+4 -1
View File
@@ -1,9 +1,12 @@
# LBRY Android
[![pipeline status](https://ci.lbry.tech/lbry/lbry-android/badges/master/pipeline.svg)](https://ci.lbry.tech/lbry/lbry-android/commits/master)
[![GitHub license](https://img.shields.io/github/license/lbryio/lbry-android)](https://github.com/lbryio/lbry-android/blob/master/LICENSE)
An Android browser and wallet for the [LBRY](https://lbry.com) network. This app bundles [lbrynet-daemon](https://github.com/lbryio/lbry) as a background service with a UI layer built with React Native. The APK is built using buildozer and the Gradle build tool.
<img src="https://spee.ch/8/lbry-android.png" alt="LBRY Android Screenshot" width="384px" />
<img src="https://spee.ch/@lbry:3f/android-08-homepage.gif" alt="LBRY Android GIF" width="384px" />
## Installation
The minimum supported Android version is 5.0 Lollipop. There are two ways to install:
+1 -1
Submodule app updated: 60b4210c53...bc62580aae.
+3 -3
View File
@@ -36,7 +36,7 @@ version.filename = %(source.dir)s/main.py
# (list) Application requirements
# comma seperated e.g. requirements = sqlite3,kivy
requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2018.11.29, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==10.4.0, git+https://github.com/lbryio/aioupnp.git@a404269d91cff5358bcffb8067b0fd1d9c6842d3#egg=aioupnp, asn1crypto, mock, netifaces, 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, "git+https://github.com/lbryio/lbry-sdk@v0.38.5#egg=lbry&subdirectory=lbry", "git+https://github.com/lbryio/lbry-sdk@v0.38.5#egg=torba&subdirectory=torba"
requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2018.11.29, 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==10.4.0, defusedxml, git+https://github.com/lbryio/aioupnp.git@ab7ef0048bbce6404e463d20e8a15046ea6941f0#egg=aioupnp, asn1crypto, mock, netifaces, 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, "git+https://github.com/lbryio/lbry-sdk@v0.51.2#egg=lbry&subdirectory=lbry", "git+https://github.com/lbryio/lbry-sdk@v0.51.2#egg=torba&subdirectory=torba"
# (str) Custom source folders for requirements
# Sets custom source for any requirements with recipes
@@ -148,7 +148,7 @@ android.react_src = ./app
# (list) Gradle dependencies to add (currently works only with sdl2_gradle
# bootstrap)
android.gradle_dependencies = com.android.support:support-v4:27.1.1, com.android.support:support-media-compat:27.1.1, com.android.support:appcompat-v7:27.1.1, com.facebook.react:react-native:0.59.10, com.google.android.gms:play-services-gcm:11.0.4+, com.facebook.fresco:fresco:1.9.0, com.facebook.fresco:animated-gif:1.9.0, com.squareup.picasso:picasso:2.71828, com.google.firebase:firebase-core:16.0.1, com.google.android.gms:play-services-base:16.1.0, com.android.support:exifinterface:27.1.1
android.gradle_dependencies = androidx.legacy:legacy-support-v4:1.0.0, androidx.media:media:1.0.0, androidx.appcompat:appcompat:1.0.0, com.facebook.react:react-native:0.61.5, com.facebook.fresco:fresco:1.9.0, com.facebook.fresco:animated-gif:1.9.0, com.squareup.picasso:picasso:2.71828, com.google.firebase:firebase-analytics:17.2.1, com.google.android.gms:play-services-base:17.1.0, androidx.exifinterface:exifinterface:1.0.0, com.facebook.fresco:animated-base-support:1.3.0, com.facebook.fresco:animated-gif:1.10.0, com.google.firebase:firebase-messaging:20.1.0
# (str) python-for-android branch to use, defaults to master
#p4a.branch = stable
@@ -187,7 +187,7 @@ android.gradle_dependencies = com.android.support:support-v4:27.1.1, com.android
#android.copy_libs = 1
# (str) The Android arch to build for, choices: armeabi-v7a, arm64-v8a, x86
android.arch = arm64-v8a
android.arch = armeabi-v7a
#
# Python for android (p4a) specific
+274
View File
@@ -0,0 +1,274 @@
[app]
# (str) Title of your application
title = LBRY
# (str) Package name
package.name = browser
# (str) Package domain (needed for android/ios packaging)
package.domain = io.lbry
# (str) Source code where the main.py live
source.dir = ./src/main/python
# (list) Source files to include (let empty to include all the files)
source.include_exts = py,png,jpg,kv,atlas
# (list) List of inclusions using pattern matching
#source.include_patterns = assets/*, res/*
# (list) Source files to exclude (let empty to not exclude anything)
#source.exclude_exts = spec
# (list) List of directory to exclude (let empty to not exclude anything)
#source.exclude_dirs = tests, bin
# (list) List of exclusions using pattern matching
#source.exclude_patterns = license,images/*/*.jpg
# (str) Application versioning (method 1)
#version = 0.1
# (str) Application versioning (method 2)
version.regex = __version__ = ['"](.*)['"]
version.filename = %(source.dir)s/main.py
# (list) Application requirements
# comma seperated e.g. requirements = sqlite3,kivy
requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2018.11.29, 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==10.4.0, defusedxml, git+https://github.com/lbryio/aioupnp.git@ab7ef0048bbce6404e463d20e8a15046ea6941f0#egg=aioupnp, asn1crypto, mock, netifaces, 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, "git+https://github.com/lbryio/lbry-sdk@v0.51.2#egg=lbry&subdirectory=lbry", "git+https://github.com/lbryio/lbry-sdk@v0.51.2#egg=torba&subdirectory=torba"
# (str) Custom source folders for requirements
# Sets custom source for any requirements with recipes
# requirements.source.kivy = ../../kivy
# (list) Garden requirements
#garden_requirements =
# (str) Presplash of the application
#presplash.filename = %(source.dir)s/data/presplash.png
# (str) Icon of the application
#icon.filename = %(source.dir)s/data/icon.png
# (str) Supported orientation (one of landscape, portrait or all)
orientation = portrait
# (list) List of service to declare
#services = NAME:ENTRYPOINT_TO_PY,NAME2:ENTRYPOINT2_TO_PY
services = lbrynetservice:./lbrynetservice.py
#
# OSX Specific
#
#
# author = © Copyright Info
# change the major version of python used by the app
osx.python_version = 3
# Kivy version to use
osx.kivy_version = 1.9.1
#
# Android specific
#
# (bool) Indicate if the application should be fullscreen or not
fullscreen = 0
# (string) Presplash background color (for new android toolchain)
# Supported formats are: #RRGGBB #AARRGGBB or one of the following names:
# red, blue, green, black, white, gray, cyan, magenta, yellow, lightgray,
# darkgray, grey, lightgrey, darkgrey, aqua, fuchsia, lime, maroon, navy,
# olive, purple, silver, teal.
#android.presplash_color = #FFFFFF
# (list) Permissions
android.permissions = CAMERA,INTERNET,READ_EXTERNAL_STORAGE,RECORD_AUDIO,WRITE_EXTERNAL_STORAGE
# (int) Android API to use
android.api = 28
# (int) Minimum API required
android.minapi = 21
# (int) Android SDK version to use
android.sdk = 23
# (str) Android NDK version to use
#android.ndk = 13b
# (bool) Use --private data storage (True) or --dir public storage (False)
#android.private_storage = True
# (str) Android NDK directory (if empty, it will be automatically downloaded.)
android.ndk_path = ~/.buildozer/android/crystax-ndk-10.3.2
# (str) Android SDK directory (if empty, it will be automatically downloaded.)
#android.sdk_path = ~/.buildozer/android
# (str) ANT directory (if empty, it will be automatically downloaded.)
#android.ant_path =
# (bool) If True, then skip trying to update the Android sdk
# This can be useful to avoid excess Internet downloads or save time
# when an update is due and you just want to test/build your package
#android.skip_update = False
# (str) Android entry point, default is ok for Kivy-based app
#android.entrypoint = org.renpy.android.PythonActivity
# (list) Pattern to whitelist for the whole project
#android.whitelist =
# (str) Path to a custom whitelist file
#android.whitelist_src =
# (str) Path to a custom blacklist file
#android.blacklist_src =
# (list) List of Java .jar files to add to the libs so that pyjnius can access
# their classes. Don't add jars that you do not need, since extra jars can slow
# down the build process. Allows wildcards matching, for example:
# OUYA-ODK/libs/*.jar3
#android.add_jars = foo.jar,bar.jar,path/to/more/*.jar
# (list) List of Java files to add to the android project (can be java or a
# directory containing the files)
android.add_src = ./src/main
# (str) Path to the React files and node_modules for building3
android.react_src = ./app
# (list) Android AAR archives to add (currently works only with sdl2_gradle
# bootstrap)
#android.add_aars =
# (list) Gradle dependencies to add (currently works only with sdl2_gradle
# bootstrap)
android.gradle_dependencies = androidx.legacy:legacy-support-v4:1.0.0, androidx.media:media:1.0.0, androidx.appcompat:appcompat:1.0.0, com.facebook.react:react-native:0.61.5, com.facebook.fresco:fresco:1.9.0, com.facebook.fresco:animated-gif:1.9.0, com.squareup.picasso:picasso:2.71828, com.google.firebase:firebase-analytics:17.2.1, com.google.android.gms:play-services-base:17.1.0, androidx.exifinterface:exifinterface:1.0.0, com.facebook.fresco:animated-base-support:1.3.0, com.facebook.fresco:animated-gif:1.10.0, com.google.firebase:firebase-messaging:20.1.0
# (str) python-for-android branch to use, defaults to master
#p4a.branch = stable
# (str) OUYA Console category. Should be one of GAME or APP
# If you leave this blank, OUYA support will not be enabled
#android.ouya.category = GAME
# (str) Filename of OUYA Console icon. It must be a 732x412 png image.
#android.ouya.icon.filename = %(source.dir)s/data/ouya_icon.png
# (str) XML file to include as an intent filters in <activity> tag
#android.manifest.intent_filters =
# (list) Android additionnal libraries to copy into libs/armeabi
#android.add_libs_armeabi = libs/android-v7/*
#android.add_libs_armeabi_v7a = libs/android-v7/*
#android.add_libs_x86 = libs/android-x86/*.so
#android.add_libs_mips = libs/android-mips/*.so
# (bool) Indicate whether the screen should stay on
# Don't forget to add the WAKE_LOCK permission if you set this to True
#android.wakelock = False
# (list) Android application meta-data to set (key=value format)
#android.meta_data =
# (list) Android library project to add (will be added in the
# project.properties automatically.)
#android.library_references =
# (str) Android logcat filters to use
#android.logcat_filters = *:S python:D
# (bool) Copy library instead of making a libpymodules.so
#android.copy_libs = 1
# (str) The Android arch to build for, choices: armeabi-v7a, arm64-v8a, x86
android.arch = arm64-v8a
#
# Python for android (p4a) specific
#
# (str) python-for-android git clone directory (if empty, it will be automatically cloned from github)
p4a.source_dir = ./p4a
# (str) The directory in which python-for-android should look for your own build recipes (if any)
p4a.local_recipes = ./recipes
# (str) Filename to the hook for p4a
#p4a.hook =
# (str) Bootstrap to use for android builds
p4a.bootstrap = lbry
#
# iOS specific
#
# (str) Path to a custom kivy-ios folder
#ios.kivy_ios_dir = ../kivy-ios
# (str) Name of the certificate to use for signing the debug version
# Get a list of available identities: buildozer ios list_identities
#ios.codesign.debug = "iPhone Developer: <lastname> <firstname> (<hexstring>)"
# (str) Name of the certificate to use for signing the release version
#ios.codesign.release = %(ios.codesign.debug)s
[buildozer]
# (int) Log level (0 = error only, 1 = info, 2 = debug (with command output))
log_level = 2
# (int) Display warning if buildozer is run as root (0 = False, 1 = True)
warn_on_root = 1
# (str) Path to build artifact storage, absolute or relative to spec file
# build_dir = ./.buildozer
# (str) Path to build output (i.e. .apk, .ipa) storage
# bin_dir = ./bin
# -----------------------------------------------------------------------------
# List as sections
#
# You can define all the "list" as [section:key].
# Each line will be considered as a option to the list.
# Let's take [app] / source.exclude_patterns.
# Instead of doing:
#
#[app]
#source.exclude_patterns = license,data/audio/*.wav,data/images/original/*
#
# This can be translated into:
#
#[app:source.exclude_patterns]
#license
#data/audio/*.wav
#data/images/original/*
#
# -----------------------------------------------------------------------------
# Profiles
#
# You can extend section / key with a profile
# For example, you want to deploy a demo version of your application without
# HD content. You could first change the title to add "(demo)" in the name
# and extend the excluded directories to remove the HD content.
#
#[app@demo]
#title = My Application (demo)
#
#[app:source.exclude_patterns@demo]
#images/hd/*
#
# Then, invoke the command line with the "demo" profile:
#
#buildozer --profile demo android debug
+2 -2
View File
@@ -36,7 +36,7 @@ version.filename = %(source.dir)s/main.py
# (list) Application requirements
# comma seperated e.g. requirements = sqlite3,kivy
requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2018.11.29, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==10.4.0, git+https://github.com/lbryio/aioupnp.git@a404269d91cff5358bcffb8067b0fd1d9c6842d3#egg=aioupnp, asn1crypto, mock, netifaces, 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, "git+https://github.com/lbryio/lbry-sdk@v0.38.5#egg=lbry&subdirectory=lbry", "git+https://github.com/lbryio/lbry-sdk@v0.38.5#egg=torba&subdirectory=torba"
requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2018.11.29, 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==10.4.0, defusedxml, git+https://github.com/lbryio/aioupnp.git@ab7ef0048bbce6404e463d20e8a15046ea6941f0#egg=aioupnp, asn1crypto, mock, netifaces, 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, "git+https://github.com/lbryio/lbry-sdk@v0.51.2#egg=lbry&subdirectory=lbry", "git+https://github.com/lbryio/lbry-sdk@v0.51.2#egg=torba&subdirectory=torba"
# (str) Custom source folders for requirements
# Sets custom source for any requirements with recipes
@@ -148,7 +148,7 @@ android.react_src = ./app
# (list) Gradle dependencies to add (currently works only with sdl2_gradle
# bootstrap)
android.gradle_dependencies = com.android.support:support-v4:27.1.1, com.android.support:support-media-compat:27.1.1, com.android.support:appcompat-v7:27.1.1, com.facebook.react:react-native:0.59.10, com.google.android.gms:play-services-gcm:11.0.4+, com.facebook.fresco:fresco:1.9.0, com.facebook.fresco:animated-gif:1.9.0, com.squareup.picasso:picasso:2.71828, com.google.firebase:firebase-core:16.0.1, com.google.android.gms:play-services-base:16.1.0, com.android.support:exifinterface:27.1.1
android.gradle_dependencies = androidx.legacy:legacy-support-v4:1.0.0, androidx.media:media:1.0.0, androidx.appcompat:appcompat:1.0.0, com.facebook.react:react-native:0.61.5, com.facebook.fresco:fresco:1.9.0, com.facebook.fresco:animated-gif:1.9.0, com.squareup.picasso:picasso:2.71828, com.google.firebase:firebase-analytics:17.2.1, com.google.android.gms:play-services-base:17.1.0, androidx.exifinterface:exifinterface:1.0.0, com.facebook.fresco:animated-base-support:1.3.0, com.facebook.fresco:animated-gif:1.10.0, com.google.firebase:firebase-messaging:20.1.0
# (str) python-for-android branch to use, defaults to master
#p4a.branch = stable
+3 -3
View File
@@ -36,7 +36,7 @@ version.filename = %(source.dir)s/main.py
# (list) Application requirements
# comma seperated e.g. requirements = sqlite3,kivy
requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2018.11.29, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==10.4.0, git+https://github.com/lbryio/aioupnp.git@a404269d91cff5358bcffb8067b0fd1d9c6842d3#egg=aioupnp, asn1crypto, mock, netifaces, 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, "git+https://github.com/lbryio/lbry-sdk@v0.38.3#egg=lbry&subdirectory=lbry", "git+https://github.com/lbryio/lbry-sdk@v0.38.3#egg=torba&subdirectory=torba"
requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2018.11.29, 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==10.4.0, defusedxml, git+https://github.com/lbryio/aioupnp.git@ab7ef0048bbce6404e463d20e8a15046ea6941f0#egg=aioupnp, asn1crypto, mock, netifaces, 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, "git+https://github.com/lbryio/lbry-sdk@v0.51.2#egg=lbry&subdirectory=lbry", "git+https://github.com/lbryio/lbry-sdk@v0.51.2#egg=torba&subdirectory=torba"
# (str) Custom source folders for requirements
# Sets custom source for any requirements with recipes
@@ -148,7 +148,7 @@ android.react_src = ./app
# (list) Gradle dependencies to add (currently works only with sdl2_gradle
# bootstrap)
android.gradle_dependencies = com.android.support:support-v4:27.1.1, com.android.support:support-media-compat:27.1.1, com.android.support:appcompat-v7:27.1.1, com.facebook.react:react-native:0.59.10, com.google.android.gms:play-services-gcm:11.0.4+, com.facebook.fresco:fresco:1.9.0, com.facebook.fresco:animated-gif:1.9.0, com.squareup.picasso:picasso:2.71828, com.google.firebase:firebase-core:16.0.1, com.google.android.gms:play-services-base:16.1.0, com.android.support:exifinterface:27.1.1
android.gradle_dependencies = androidx.legacy:legacy-support-v4:1.0.0, androidx.media:media:1.0.0, androidx.appcompat:appcompat:1.0.0, com.facebook.react:react-native:0.61.5, com.facebook.fresco:fresco:1.9.0, com.facebook.fresco:animated-gif:1.9.0, com.squareup.picasso:picasso:2.71828, com.google.firebase:firebase-analytics:17.2.1, com.google.android.gms:play-services-base:17.1.0, androidx.exifinterface:exifinterface:1.0.0, com.facebook.fresco:animated-base-support:1.3.0, com.facebook.fresco:animated-gif:1.10.0, com.google.firebase:firebase-messaging:20.1.0
# (str) python-for-android branch to use, defaults to master
#p4a.branch = stable
@@ -272,4 +272,4 @@ warn_on_root = 1
# Then, invoke the command line with the "demo" profile:
#
#buildozer --profile demo android debug
requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2018.11.29, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==10.4.0, git+https://github.com/lbryio/aioupnp.git@a404269d91cff5358bcffb8067b0fd1d9c6842d3#egg=aioupnp, asn1crypto, mock, netifaces, 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, "git+https://github.com/lbryio/lbry-sdk@v0.38.5#egg=lbry&subdirectory=lbry", "git+https://github.com/lbryio/lbry-sdk@v0.38.5#egg=torba&subdirectory=torba"
requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2018.11.29, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==10.4.0, defusedxml, git+https://github.com/lbryio/aioupnp.git@ab7ef0048bbce6404e463d20e8a15046ea6941f0#egg=aioupnp, asn1crypto, mock, netifaces, 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, "git+https://github.com/lbryio/lbry-sdk@v0.43.3#egg=lbry&subdirectory=lbry", "git+https://github.com/lbryio/lbry-sdk@v0.43.3#egg=torba&subdirectory=torba"
+2 -2
View File
@@ -123,7 +123,7 @@ class BdistAPK(Command):
exit(1)
if len(main_py_dirs) > 1:
print('WARNING: Multiple main.py dirs found, using the shortest path')
main_py_dirs = sorted(main_py_dirs, key=lambda j: len(split(j)))
main_py_dirs.sort(key=lambda j: len(split(j)))
if not argv_contains('--launcher'):
sys.argv.append('--private={}'.format(
@@ -145,4 +145,4 @@ def _set_user_options():
BdistAPK.user_options = user_options
_set_user_options()
_set_user_options()
@@ -447,8 +447,7 @@ main.py that loads it.''')
# Try to build with the newest available build tools
ignored = {".DS_Store", ".ds_store"}
build_tools_versions = [x for x in listdir(join(sdk_dir, 'build-tools')) if x not in ignored]
build_tools_versions = sorted(build_tools_versions,
key=LooseVersion)
build_tools_versions.sort(key=LooseVersion)
build_tools_version = build_tools_versions[-1]
# Folder name for launcher (used by SDL2 bootstrap)
@@ -344,8 +344,7 @@ main.py that loads it.''')
# Try to build with the newest available build tools
build_tools_versions = listdir(join(sdk_dir, 'build-tools'))
build_tools_versions = sorted(build_tools_versions,
key=LooseVersion)
build_tools_versions.sort(key=LooseVersion)
build_tools_version = build_tools_versions[-1]
@@ -407,6 +406,8 @@ main.py that loads it.''')
render('settings.gradle', 'settings.gradle')
render('gradle.properties', 'gradle.properties')
## google-services.json for firebase
render('google-services.json', 'google-services.json')
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-all.zip
@@ -58,6 +58,16 @@
android:hardwareAccelerated="true"
android:usesCleartextTraffic="true">
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/ic_lbry" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_color"
android:resource="@color/lbryGreen" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_channel_id"
android:value="@string/default_notification_channel_id"/>
{% for m in args.meta_data %}
<meta-data android:name="{{ m.split('=', 1)[0] }}" android:value="{{ m.split('=', 1)[-1] }}"/>{% endfor %}
<meta-data android:name="wakelock" android:value="{% if args.wakelock %}1{% else %}0{% endif %}"/>
@@ -71,6 +81,7 @@
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
<activity android:name="io.lbry.browser.MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/LbryAppTheme"
android:configChanges="keyboardHidden|orientation{% if args.min_sdk_version >= 13 %}|screenSize{% endif %}"
@@ -131,6 +142,14 @@
<service android:name="{{ args.package }}.LbrynetTestRunnerService"
android:process=":service_lbrynet_testrunner" />
<service
android:name="{{ args.package }}.LbrynetMessagingService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
{% if args.billing_pubkey %}
<service android:name="org.kivy.android.billing.BillingReceiver"
android:process=":pythonbilling" />
@@ -6,7 +6,7 @@ buildscript {
maven { url "https://jitpack.io" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.google.gms:google-services:4.2.0'
}
}
@@ -21,6 +21,10 @@ allprojects {
// All of React Native (JS, Android binaries) is installed from npm
url "$rootDir/react/node_modules/react-native/android"
}
maven {
// Android JSC is installed from npm
url("$rootDir/react/node_modules/jsc-android/dist")
}
flatDir {
dirs 'libs'
}
@@ -29,19 +33,27 @@ allprojects {
apply plugin: 'com.android.application'
project.ext.react = [
enableHermes: false,
entryFile: "index.js"
]
def enableHermes = project.ext.react.get("enableHermes", false);
def jscFlavor = 'org.webkit:android-jsc:+'
android {
compileSdkVersion {{ android_api }}
buildToolsVersion '{{ build_tools_version }}'
defaultConfig {
minSdkVersion {{ args.min_sdk_version }}
targetSdkVersion {{ android_api }}
versionCode {{ args.numeric_version }}
versionCode {{ args.numeric_version }} * 10 + 2
versionName '{{ args.version }}'
missingDimensionStrategy 'react-native-camera', 'general'
multiDexEnabled true
ndk {
abiFilters "armeabi-v7a", "arm64-v8a"
abiFilters "arm64-v8a"
}
}
@@ -87,7 +99,7 @@ ext {
buildToolsVersion = '{{ build_tools_version }}'
minSdkVersion = {{ args.min_sdk_version }}
targetSdkVersion = {{ android_api }}
supportLibVersion = '27.1.1'
supportLibVersion = '28.0.0'
googlePlayServicesVersion = '16.1.0'
googlePlayServicesVisionVersion = '17.0.2'
}
@@ -106,12 +118,14 @@ subprojects {
dependencies {
compile project(':@react-native-community_async-storage')
compile project(':react-native-camera')
compile project(':react-native-document-picker')
compile project(':react-native-exception-handler')
compile project(':react-native-fast-image')
compile project(':react-native-fs')
compile project(':react-native-gesture-handler')
compile project(':react-native-reanimated')
compile project(':react-native-snackbar')
compile project(':react-native-video')
compile project(':react-native-webview')
compile project(':rn-fetch-blob')
{%- for aar in aars %}
compile(name: '{{ aar }}', ext: 'aar')
@@ -121,6 +135,15 @@ dependencies {
compile '{{ depend }}'
{%- endfor %}
{%- endif %}
if (enableHermes) {
def hermesPath = "$rootDir/react/node_modules/hermes-engine/android/";
debugImplementation files(hermesPath + "hermes-debug.aar")
releaseImplementation files(hermesPath + "hermes-release.aar")
} else {
implementation jscFlavor
}
}
apply plugin: 'com.google.gms.google-services'
@@ -0,0 +1,150 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
maven { url "https://jitpack.io" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.google.gms:google-services:4.2.0'
}
}
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com'
}
maven {
// All of React Native (JS, Android binaries) is installed from npm
url "$rootDir/react/node_modules/react-native/android"
}
maven {
// Android JSC is installed from npm
url("$rootDir/react/node_modules/jsc-android/dist")
}
flatDir {
dirs 'libs'
}
}
}
apply plugin: 'com.android.application'
project.ext.react = [
enableHermes: false,
entryFile: "index.js"
]
def enableHermes = project.ext.react.get("enableHermes", false);
def jscFlavor = 'org.webkit:android-jsc:+'
android {
compileSdkVersion {{ android_api }}
buildToolsVersion '{{ build_tools_version }}'
defaultConfig {
minSdkVersion {{ args.min_sdk_version }}
targetSdkVersion {{ android_api }}
versionCode {{ args.numeric_version }} * 10 + 1
versionName '{{ args.version }}'
missingDimensionStrategy 'react-native-camera', 'general'
multiDexEnabled true
ndk {
abiFilters "armeabi-v7a"
}
}
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
dexOptions {
jumboMode true
}
{% if args.sign -%}
signingConfigs {
release {
storeFile file(System.getenv("P4A_RELEASE_KEYSTORE"))
keyAlias System.getenv("P4A_RELEASE_KEYALIAS")
storePassword System.getenv("P4A_RELEASE_KEYSTORE_PASSWD")
keyPassword System.getenv("P4A_RELEASE_KEYALIAS_PASSWD")
}
}
{%- endif %}
buildTypes {
debug {
}
release {
{% if args.sign -%}
signingConfig signingConfigs.release
{%- endif %}
}
}
sourceSets {
main {
jniLibs.srcDir 'libs'
}
}
}
ext {
compileSdkVersion = {{ android_api }}
buildToolsVersion = '{{ build_tools_version }}'
minSdkVersion = {{ args.min_sdk_version }}
targetSdkVersion = {{ android_api }}
supportLibVersion = '28.0.0'
googlePlayServicesVersion = '16.1.0'
googlePlayServicesVisionVersion = '17.0.2'
}
subprojects {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion {{ android_api }}
buildToolsVersion '{{ build_tools_version }}'
}
}
}
}
dependencies {
compile project(':@react-native-community_async-storage')
compile project(':react-native-camera')
compile project(':react-native-exception-handler')
compile project(':react-native-fast-image')
compile project(':react-native-fs')
compile project(':react-native-gesture-handler')
compile project(':react-native-reanimated')
compile project(':react-native-snackbar')
compile project(':react-native-video')
compile project(':react-native-webview')
compile project(':rn-fetch-blob')
{%- for aar in aars %}
compile(name: '{{ aar }}', ext: 'aar')
{%- endfor -%}
{%- if args.depends -%}
{%- for depend in args.depends %}
compile '{{ depend }}'
{%- endfor %}
{%- endif %}
if (enableHermes) {
def hermesPath = "$rootDir/react/node_modules/hermes-engine/android/";
debugImplementation files(hermesPath + "hermes-debug.aar")
releaseImplementation files(hermesPath + "hermes-release.aar")
} else {
implementation jscFlavor
}
}
apply plugin: 'com.google.gms.google-services'
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
@@ -0,0 +1,2 @@
android.useAndroidX=true
android.enableJetifier=true
@@ -3,8 +3,6 @@ include ':@react-native-community_async-storage'
project(':@react-native-community_async-storage').projectDir = new File(rootProject.projectDir, './react/node_modules/@react-native-community/async-storage/android')
include ':react-native-camera'
project(':react-native-camera').projectDir = new File(rootProject.projectDir, './react/node_modules/react-native-camera/android')
include ':react-native-document-picker'
project(':react-native-document-picker').projectDir = new File(rootProject.projectDir, './react/node_modules/react-native-document-picker/android')
include ':react-native-exception-handler'
project(':react-native-exception-handler').projectDir = new File(rootProject.projectDir, './react/node_modules/react-native-exception-handler/android')
include ':react-native-fast-image'
@@ -13,7 +11,13 @@ include ':react-native-fs'
project(':react-native-fs').projectDir = new File(settingsDir, './react/node_modules/react-native-fs/android')
include ':react-native-gesture-handler'
project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, './react/node_modules/react-native-gesture-handler/android')
include ':react-native-reanimated'
project(':react-native-reanimated').projectDir = new File(rootProject.projectDir, './react/node_modules/react-native-reanimated/android')
include ':react-native-snackbar'
project(':react-native-snackbar').projectDir = new File(rootProject.projectDir, './react/node_modules/react-native-snackbar/android')
include ':react-native-video'
project(':react-native-video').projectDir = new File(rootProject.projectDir, './react/node_modules/react-native-video/android-exoplayer')
include ':react-native-webview'
project(':react-native-webview').projectDir = new File(rootProject.projectDir, './react/node_modules/react-native-webview/android')
include ':rn-fetch-blob'
project(':rn-fetch-blob').projectDir = new File(rootProject.projectDir, './react/node_modules/rn-fetch-blob/android')
project(':rn-fetch-blob').projectDir = new File(rootProject.projectDir, './react/node_modules/rn-fetch-blob/android')
@@ -4,7 +4,8 @@
<string name="private_version">{{ private_version }}</string>
<string name="presplash_color">{{ args.presplash_color }}</string>
<string name="urlScheme">{{ url_scheme }}</string>
<string name="default_notification_channel_id">io.lbry.browser.LBRY_ENGAGEMENT_CHANNEL</string>
<string name="running">Running</string>
<string name="service_status">Service Status</string>
<string name="stopped">Stopped</string>
+1 -2
View File
@@ -293,8 +293,7 @@ def get_recipe_order_and_bootstrap(ctx, names, bs=None, blacklist=None):
orders.append(list(order))
# prefer python3 and SDL2 if available
orders = sorted(orders,
key=lambda order: -('python3' in order) - ('sdl2' in order))
orders.sort(key=lambda order: -('python3' in order) - ('sdl2' in order))
if not orders:
raise BuildInterruptingException(
@@ -93,9 +93,7 @@ def find_channel(force=False):
if not force:
return None
busy.sort(key=lambda x: x.play_time)
return busy[0]
return min(busy, key=lambda x: x.play_time)
class ChannelImpl(object):
+1 -2
View File
@@ -822,8 +822,7 @@ class ToolchainCL(object):
build_tools_versions = os.listdir(join(ctx.sdk_dir,
'build-tools'))
build_tools_versions = sorted(build_tools_versions,
key=LooseVersion)
build_tools_versions.sort(key=LooseVersion)
build_tools_version = build_tools_versions[-1]
info(('Detected highest available build tools '
'version to be {}').format(build_tools_version))
+1 -3
View File
@@ -79,9 +79,7 @@ def find_channel(force=False):
if not force:
return None
busy.sort(key=lambda x : x.play_time)
return busy[0]
return min(busy, key=lambda x : x.play_time)
class ChannelImpl(object):
+2 -1
View File
@@ -2,6 +2,7 @@
cd app
react-native bundle --platform android --dev false --entry-file src/index.js --bundle-output ../src/main/assets/index.android.bundle --assets-dest ../src/main/res/
cd ..
cp src/main/assets/index.android.bundle /dev/null
version=$(cat src/main/python/main.py | grep --color=never -oP '([0-9]+\.?)+')
buildozer android release <<< y
jarsigner -verbose -sigalg SHA1withRSA \
@@ -10,6 +11,6 @@ jarsigner -verbose -sigalg SHA1withRSA \
-storepass $KEYSTORE_PASSWORD \
bin/browser-$version-release-unsigned.apk lbry-android > /dev/null \
&& mv bin/browser-$version-release-unsigned.apk bin/browser-$version-release-signed.apk
~/.buildozer/android/platform/android-sdk-23/build-tools/26.0.2/zipalign -v 4 \
~/.buildozer/android/platform/android-sdk-23/build-tools/28.0.3/zipalign -v 4 \
bin/browser-$version-release-signed.apk bin/browser-$version-release.apk > /dev/null \
&& rm bin/browser-$version-release-signed.apk
Binary file not shown.
@@ -8,8 +8,8 @@ import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.support.v4.app.NotificationCompat;
import android.support.v4.app.NotificationManagerCompat;
import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationManagerCompat;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
@@ -86,6 +86,7 @@ public class DownloadManager {
NotificationChannel channel = new NotificationChannel(
NOTIFICATION_CHANNEL_ID, "LBRY Downloads", NotificationManager.IMPORTANCE_LOW);
channel.setDescription("LBRY file downloads");
channel.setSound(null, null);
notificationManager.createNotificationChannel(channel);
}
}
@@ -0,0 +1,157 @@
package io.lbry.browser;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import androidx.core.app.NotificationCompat;
import androidx.core.content.ContextCompat;
import android.util.Log;
import com.google.firebase.analytics.FirebaseAnalytics;
import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;
import io.lbry.browser.reactmodules.UtilityModule;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class LbrynetMessagingService extends FirebaseMessagingService {
private static final String TAG = "LbrynetMessagingService";
private static final String NOTIFICATION_CHANNEL_ID = "io.lbry.browser.LBRY_ENGAGEMENT_CHANNEL";
private static final String TYPE_SUBSCRIPTION = "subscription";
private static final String TYPE_REWARD = "reward";
private static final String TYPE_INTERESTS = "interests";
private static final String TYPE_CREATOR = "creator";
private FirebaseAnalytics firebaseAnalytics;
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
Log.d(TAG, "From: " + remoteMessage.getFrom());
if (firebaseAnalytics == null) {
firebaseAnalytics = FirebaseAnalytics.getInstance(this);
}
Map<String, String> payload = remoteMessage.getData();
if (payload != null) {
String type = payload.get("type");
String url = payload.get("target");
String title = payload.get("title");
String body = payload.get("body");
String name = payload.get("name"); // notification name
if (type != null && getEnabledTypes().indexOf(type) > -1 && body != null && body.trim().length() > 0) {
// only log the receive event for valid notifications received
if (firebaseAnalytics != null) {
Bundle bundle = new Bundle();
bundle.putString("name", name);
firebaseAnalytics.logEvent("lbry_notification_receive", bundle);
}
sendNotification(title, body, type, url, name);
}
}
}
@Override
public void onNewToken(String token) {
Log.d(TAG, "Refreshed token: " + token);
// If you want to send messages to this application instance or
// manage this apps subscriptions on the server side, send the
// Instance ID token to your app server.
sendRegistrationToServer(token);
}
/**
* Persist token to third-party servers.
*
* Modify this method to associate the user's FCM InstanceID token with any server-side account
* maintained by your application.
*
* @param token The new token.
*/
private void sendRegistrationToServer(String token) {
// TODO: Implement this method to send token to your app server.
}
/**
* Create and show a simple notification containing the received FCM message.
*
* @param messageBody FCM message body received.
*/
private void sendNotification(String title, String messageBody, String type, String url, String name) {
//Intent intent = new Intent(this, MainActivity.class);
//intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
if (url == null) {
if (TYPE_REWARD.equals(type)) {
url = "lbry://?rewards";
} else {
// default to home page
url = "lbry://?discover";
}
}
Intent launchIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
launchIntent.putExtra("notification_name", name);
launchIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, launchIntent, PendingIntent.FLAG_ONE_SHOT);
Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
NotificationCompat.Builder notificationBuilder =
new NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID)
.setColor(ContextCompat.getColor(this, R.color.lbryGreen))
.setSmallIcon(R.drawable.ic_lbry)
.setContentTitle(title)
.setContentText(messageBody)
.setAutoCancel(true)
.setSound(defaultSoundUri)
.setContentIntent(pendingIntent);
NotificationManager notificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
// Since android Oreo notification channel is needed.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
NotificationChannel channel = new NotificationChannel(
NOTIFICATION_CHANNEL_ID, "LBRY Engagement", NotificationManager.IMPORTANCE_DEFAULT);
notificationManager.createNotificationChannel(channel);
}
notificationManager.notify(9898, notificationBuilder.build());
}
public List<String> getEnabledTypes() {
SharedPreferences sp = getSharedPreferences(MainActivity.SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);
List<String> enabledTypes = new ArrayList<String>();
if (sp.getBoolean(UtilityModule.RECEIVE_SUBSCRIPTION_NOTIFICATIONS, true)) {
enabledTypes.add(TYPE_SUBSCRIPTION);
}
if (sp.getBoolean(UtilityModule.RECEIVE_REWARD_NOTIFICATIONS, true)) {
enabledTypes.add(TYPE_REWARD);
}
if (sp.getBoolean(UtilityModule.RECEIVE_INTERESTS_NOTIFICATIONS, true)) {
enabledTypes.add(TYPE_INTERESTS);
}
if (sp.getBoolean(UtilityModule.RECEIVE_CREATOR_NOTIFICATIONS, true)) {
enabledTypes.add(TYPE_CREATOR);
}
return enabledTypes;
}
}
+91 -162
View File
@@ -14,8 +14,8 @@ import android.os.Build;
import android.os.Bundle;
import android.os.Binder;
import android.os.IBinder;
import android.support.v4.app.NotificationCompat;
import android.support.v4.content.ContextCompat;
import androidx.core.app.NotificationCompat;
import androidx.core.content.ContextCompat;
import android.util.Log;
import java.io.BufferedReader;
@@ -74,8 +74,6 @@ public class LbrynetService extends PythonService {
public static LbrynetService serviceInstance;
private static final String SDK_URL = "http://127.0.0.1:5279";
private static final int SDK_POLL_INTERVAL = 500; // 500 milliseconds
private BroadcastReceiver stopServiceReceiver;
@@ -192,86 +190,10 @@ public class LbrynetService extends PythonService {
}
}
private String sdkCall(String method) throws ConnectException {
return sdkCall(method, null);
}
private String sdkCall(String method, Map<String, String> params) throws ConnectException {
BufferedReader reader = null;
DataOutputStream dos = null;
HttpURLConnection conn = null;
try {
JSONObject request = new JSONObject();
request.put("method", method);
if (params != null) {
JSONObject requestParams = new JSONObject();
for (Map.Entry<String, String> entry : params.entrySet()) {
requestParams.put(entry.getKey(), entry.getValue());
}
request.put("params", requestParams);
}
URL url = new URL(SDK_URL);
conn = (HttpURLConnection) url.openConnection();
conn.setDoInput(true);
conn.setDoOutput(true);
conn.setUseCaches(false);
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-type", "application/json");
dos = new DataOutputStream(conn.getOutputStream());
dos.writeBytes(request.toString());
dos.flush();
dos.close();
if (conn.getResponseCode() == 200) {
reader = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"));
StringBuilder sb = new StringBuilder();
String input;
while ((input = reader.readLine()) != null) {
sb.append(input);
}
return sb.toString();
} else {
reader = new BufferedReader(new InputStreamReader(conn.getErrorStream(), "utf-8"));
StringBuilder sb = new StringBuilder();
String error;
while ((error = reader.readLine()) != null) {
sb.append(error);
}
return sb.toString();
}
} catch (ConnectException ex) {
// sdk not started yet. rethrow
throw ex;
} catch (IOException ex) {
Log.e(TAG, ex.getMessage(), ex);
// ignore and continue
} catch (Exception ex) {
Log.e(TAG, ex.getMessage(), ex);
// ignore
} finally {
try {
if (reader != null) {
reader.close();
}
if (conn != null) {
conn.disconnect();
}
} catch (IOException ex) {
// pass
}
}
return null;
}
private void pollFileList() {
try {
if (!streamManagerReady) {
String statusResponse = sdkCall("status");
String statusResponse = Utils.sdkCall("status");
if (statusResponse != null) {
JSONObject status = new JSONObject(statusResponse);
if (status.has("error")) {
@@ -288,7 +210,7 @@ public class LbrynetService extends PythonService {
}
if (streamManagerReady) {
String fileList = sdkCall("file_list");
String fileList = Utils.sdkCall("file_list");
if (fileList != null) {
JSONObject response = new JSONObject(fileList);
if (!response.has("error")) {
@@ -309,7 +231,7 @@ public class LbrynetService extends PythonService {
try {
Map<String, String> params = new HashMap<String, String>();
params.put("outpoint", outpoint);
return sdkCall("file_list", params);
return Utils.sdkCall("file_list", params);
} catch (ConnectException ex) {
return null;
}
@@ -320,27 +242,30 @@ public class LbrynetService extends PythonService {
try {
JSONObject response = new JSONObject(fileList);
if (!response.has("error")) {
JSONArray fileItems = response.optJSONArray("result");
if (fileItems != null && fileItems.length() > 0) {
// TODO: Create Java FileItem class
JSONObject item = fileItems.getJSONObject(0);
String downloadPath = item.isNull("download_path") ? null : item.getString("download_path");
if (downloadPath == null || downloadPath.trim().length() == 0) {
return;
}
String claimId = item.getString("claim_id");
String claimName = item.getString("claim_name");
String uri = String.format("lbry://%s#%s", claimName, claimId);
JSONObject result = response.getJSONObject("result");
if (result != null) {
JSONArray fileItems = response.optJSONArray("items");
if (fileItems != null && fileItems.length() > 0) {
// TODO: Create Java FileItem class
JSONObject item = fileItems.getJSONObject(0);
String downloadPath = item.isNull("download_path") ? null : item.getString("download_path");
if (downloadPath == null || downloadPath.trim().length() == 0) {
return;
}
String claimId = item.getString("claim_id");
String claimName = item.getString("claim_name");
String uri = String.format("lbry://%s#%s", claimName, claimId);
if (!downloadManager.isDownloadActive(uri) && !downloadManager.isDownloadCompleted(uri)) {
File file = new File(downloadPath);
Intent intent = createDownloadEventIntent(uri, outpoint, item.toString());
intent.putExtra("action", "start");
downloadManager.startDownload(uri, file.getName());
if (!downloadManager.isDownloadActive(uri) && !downloadManager.isDownloadCompleted(uri)) {
File file = new File(downloadPath);
Intent intent = createDownloadEventIntent(uri, outpoint, item.toString());
intent.putExtra("action", "start");
downloadManager.startDownload(uri, file.getName());
Context context = getApplicationContext();
if (context != null) {
context.sendBroadcast(intent);
Context context = getApplicationContext();
if (context != null) {
context.sendBroadcast(intent);
}
}
}
}
@@ -365,74 +290,78 @@ public class LbrynetService extends PythonService {
private void handlePollFileResponse(JSONObject response) {
Context context = getApplicationContext();
if (response.has("result")) {
JSONArray fileItems = response.optJSONArray("result");
if (fileItems != null) {
try {
//List<String> itemUris = new ArrayList<String>();
for (int i = 0; i < fileItems.length(); i++) {
JSONObject item = fileItems.getJSONObject(i);
String downloadPath = item.isNull("download_path") ? null : item.getString("download_path");
if (downloadPath == null || downloadPath.trim().length() == 0) {
continue;
}
String claimId = item.getString("claim_id");
String claimName = item.getString("claim_name");
String uri = String.format("lbry://%s#%s", claimName, claimId);
boolean completed = item.getBoolean("completed");
double writtenBytes = item.optDouble("written_bytes", -1);
double totalBytes = item.optDouble("total_bytes", -1);
String outpoint = item.getString("outpoint");
if (downloadManager.isDownloadActive(uri) && (writtenBytes == -1 || totalBytes == -1)) {
// possibly deleted, abort the download
downloadManager.abortDownload(uri);
continue;
}
File file = new File(downloadPath);
Intent intent = createDownloadEventIntent(uri, outpoint, item.toString());
if (downloadManager.isDownloadActive(uri)) {
if (writtenBytes >= totalBytes || completed) {
// completed download
intent.putExtra("action", "complete");
downloadManager.completeDownload(uri, file.getName(), totalBytes);
} else {
intent.putExtra("action", "update");
intent.putExtra("progress", (writtenBytes / totalBytes) * 100);
downloadManager.updateDownload(uri, file.getName(), writtenBytes, totalBytes);
}
if (context != null) {
context.sendBroadcast(intent);
}
} else {
if (writtenBytes == -1 || writtenBytes >= totalBytes) {
// do not start a download that is considered completed
JSONObject result = response.optJSONObject("result");
if (result != null) {
JSONArray fileItems = result.optJSONArray("items");
if (fileItems != null) {
try {
//List<String> itemUris = new ArrayList<String>();
for (int i = 0; i < fileItems.length(); i++) {
JSONObject item = fileItems.getJSONObject(i);
String downloadPath = item.isNull("download_path") ? null : item.getString("download_path");
if (downloadPath == null || downloadPath.trim().length() == 0) {
continue;
}
if (!completed && downloadPath != null) {
intent.putExtra("action", "start");
downloadManager.startDownload(uri, file.getName());
String claimId = item.getString("claim_id");
String claimName = item.getString("claim_name");
String uri = String.format("lbry://%s#%s", claimName, claimId);
boolean completed = item.getBoolean("completed");
double writtenBytes = item.optDouble("written_bytes", -1);
double totalBytes = item.optDouble("total_bytes", -1);
String outpoint = item.getString("outpoint");
if (downloadManager.isDownloadActive(uri) && (writtenBytes == -1 || totalBytes == -1)) {
// possibly deleted, abort the download
downloadManager.abortDownload(uri);
continue;
}
File file = new File(downloadPath);
Intent intent = createDownloadEventIntent(uri, outpoint, item.toString());
if (downloadManager.isDownloadActive(uri)) {
if (writtenBytes >= totalBytes || completed) {
// completed download
intent.putExtra("action", "complete");
downloadManager.completeDownload(uri, file.getName(), totalBytes);
} else {
intent.putExtra("action", "update");
intent.putExtra("progress", (writtenBytes / totalBytes) * 100);
downloadManager.updateDownload(uri, file.getName(), writtenBytes, totalBytes);
}
if (context != null) {
context.sendBroadcast(intent);
}
} else {
if (writtenBytes == -1 || writtenBytes >= totalBytes) {
// do not start a download that is considered completed
continue;
}
if (!completed && downloadPath != null) {
intent.putExtra("action", "start");
downloadManager.startDownload(uri, file.getName());
if (context != null) {
context.sendBroadcast(intent);
}
}
}
}
}
// check download manager uris and clear downloads that may have been cancelled / deleted
/*List<String> activeUris = downloadManager.getActiveDownloads();
for (int i = 0; i < activeUris.size(); i++) {
String activeUri = activeUris.get(i);
if (!itemUris.contains(activeUri)) {
downloadManager.abortDownload(activeUri);
fileListUris.remove(activeUri); // remove URIs from the session that may have been deleted
}
}*/
} catch (JSONException ex) {
// pass
Log.e(TAG, ex.getMessage(), ex);
// check download manager uris and clear downloads that may have been cancelled / deleted
/*List<String> activeUris = downloadManager.getActiveDownloads();
for (int i = 0; i < activeUris.size(); i++) {
String activeUri = activeUris.get(i);
if (!itemUris.contains(activeUri)) {
downloadManager.abortDownload(activeUri);
fileListUris.remove(activeUri); // remove URIs from the session that may have been deleted
}
}*/
} catch (JSONException ex) {
// pass
Log.e(TAG, ex.getMessage(), ex);
}
}
}
}
@@ -1,6 +1,6 @@
package io.lbry.browser;
import android.support.v4.content.FileProvider;
import androidx.core.content.FileProvider;
public class LocalFileProvider extends FileProvider {
+249 -23
View File
@@ -1,26 +1,34 @@
package io.lbry.browser;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.app.Activity;
import android.app.ActivityManager;
import android.content.BroadcastReceiver;
import android.content.ContentUris;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.content.SharedPreferences;
import android.database.Cursor;
import android.Manifest;
import android.net.Uri;
import android.provider.DocumentsContract;
import android.provider.MediaStore;
import android.provider.Settings;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.NotificationManagerCompat;
import android.support.v4.content.ContextCompat;
import androidx.core.app.ActivityCompat;
import androidx.core.app.NotificationManagerCompat;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.FragmentActivity;
import android.telephony.SmsMessage;
import android.telephony.TelephonyManager;
import android.widget.Toast;
import com.azendoo.reactnativesnackbar.SnackbarPackage;
import com.brentvatne.react.ReactVideoPackage;
import com.dylanvann.fastimage.FastImageViewPackage;
import com.facebook.react.common.LifecycleState;
@@ -31,23 +39,30 @@ import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.WritableArray;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.bridge.ReadableNativeArray;
import com.facebook.react.bridge.ReadableNativeMap;
import com.facebook.react.modules.core.DeviceEventManagerModule;
import com.facebook.react.modules.core.PermissionAwareActivity;
import com.facebook.react.modules.core.PermissionListener;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.react.ReactRootView;
import com.facebook.soloader.SoLoader;
import com.google.firebase.analytics.FirebaseAnalytics;
import com.reactnativecommunity.asyncstorage.AsyncStoragePackage;
import com.reactnativedocumentpicker.ReactNativeDocumentPicker;
import com.reactnativecommunity.webview.RNCWebViewPackage;
import com.rnfs.RNFSPackage;
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;
import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
import com.swmansion.reanimated.ReanimatedPackage;
import com.RNFetchBlob.RNFetchBlobPackage;
import io.lbry.browser.reactpackages.LbryReactPackage;
import io.lbry.browser.reactmodules.BackgroundMediaModule;
import java.io.File;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.net.URISyntaxException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
@@ -61,7 +76,7 @@ import org.json.JSONArray;
import org.json.JSONException;
import org.reactnative.camera.RNCameraPackage;
public class MainActivity extends Activity implements DefaultHardwareBackBtnHandler, PermissionAwareActivity {
public class MainActivity extends FragmentActivity implements DefaultHardwareBackBtnHandler, PermissionAwareActivity {
private static Activity currentActivity = null;
@@ -73,6 +88,8 @@ public class MainActivity extends Activity implements DefaultHardwareBackBtnHand
private static final int RECEIVE_SMS_PERMISSION_REQ_CODE = 203;
public static final int DOCUMENT_PICKER_RESULT_CODE = 301;
private BroadcastReceiver notificationsReceiver;
private BroadcastReceiver smsReceiver;
@@ -81,6 +98,8 @@ public class MainActivity extends Activity implements DefaultHardwareBackBtnHand
private BroadcastReceiver downloadEventReceiver;
private FirebaseAnalytics firebaseAnalytics;
private ReactRootView mReactRootView;
private ReactInstanceManager mReactInstanceManager;
@@ -113,17 +132,11 @@ public class MainActivity extends Activity implements DefaultHardwareBackBtnHand
@Override
protected void onCreate(Bundle savedInstanceState) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
// Request external storage permission on Android version >= 6
checkPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE,
STORAGE_PERMISSION_REQ_CODE,
"LBRY requires access to your device storage to be able to download files and media.",
this);
}
super.onCreate(savedInstanceState);
currentActivity = this;
SoLoader.init(this, false);
// Register the stop service receiver (so that we close the activity if the user requests the service to stop)
registerStopReceiver();
@@ -139,22 +152,27 @@ public class MainActivity extends Activity implements DefaultHardwareBackBtnHand
ServiceHelper.start(this, "", LbrynetService.class, "lbrynetservice");
}
checkNotificationOpenIntent(getIntent());
mReactRootView = new RNGestureHandlerEnabledRootView(this);
mReactInstanceManager = ReactInstanceManager.builder()
.setApplication(getApplication())
.setCurrentActivity(this)
.setBundleAssetName("index.android.bundle")
.setJSMainModulePath("index")
.addPackage(new MainReactPackage())
.addPackage(new AsyncStoragePackage())
.addPackage(new FastImageViewPackage())
.addPackage(new ReactNativeDocumentPicker())
.addPackage(new RNCWebViewPackage())
.addPackage(new ReactVideoPackage())
.addPackage(new ReanimatedPackage())
.addPackage(new RNCameraPackage())
.addPackage(new RNFetchBlobPackage())
.addPackage(new RNFSPackage())
.addPackage(new RNGestureHandlerPackage())
.addPackage(new SnackbarPackage())
.addPackage(new LbryReactPackage())
.setUseDeveloperSupport(true)
.setUseDeveloperSupport(BuildConfig.DEBUG)
.setInitialLifecycleState(LifecycleState.RESUMED)
.build();
mReactRootView.startReactApplication(mReactInstanceManager, "LBRYApp", null);
@@ -164,6 +182,25 @@ public class MainActivity extends Activity implements DefaultHardwareBackBtnHand
setContentView(mReactRootView);
}
private void checkNotificationOpenIntent(Intent intent) {
if (intent != null) {
String notificationName = intent.getStringExtra("notification_name");
if (notificationName != null) {
logNotificationOpen(notificationName);
}
}
}
private void logNotificationOpen(String name) {
if (firebaseAnalytics == null) {
firebaseAnalytics = FirebaseAnalytics.getInstance(this);
}
Bundle bundle = new Bundle();
bundle.putString("name", name);
firebaseAnalytics.logEvent("lbry_notification_open", bundle);
}
private void registerDownloadEventReceiver() {
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(DownloadManager.ACTION_DOWNLOAD_EVENT);
@@ -297,6 +334,24 @@ public class MainActivity extends Activity implements DefaultHardwareBackBtnHand
}
}
}
if (requestCode == DOCUMENT_PICKER_RESULT_CODE) {
ReactContext reactContext = mReactInstanceManager.getCurrentReactContext();
if (reactContext != null) {
if (resultCode == RESULT_OK) {
Uri fileUri = data.getData();
String filePath = getRealPathFromURI_API19(this, fileUri);
WritableMap params = Arguments.createMap();
params.putString("path", filePath);
reactContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
.emit("onDocumentPickerFilePicked", params);
} else if (resultCode == RESULT_CANCELED) {
// user canceled or request failed
reactContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
.emit("onDocumentPickerCanceled", null);
}
}
}
}
public static Activity getActivity() {
@@ -307,6 +362,7 @@ public class MainActivity extends Activity implements DefaultHardwareBackBtnHand
@Override
public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
ReactContext reactContext = mReactInstanceManager.getCurrentReactContext();
switch (requestCode) {
case STORAGE_PERMISSION_REQ_CODE:
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
@@ -315,22 +371,25 @@ public class MainActivity extends Activity implements DefaultHardwareBackBtnHand
Uri.parse("package:" + getPackageName()));
startActivityForResult(intent, OVERLAY_PERMISSION_REQ_CODE);
}
if (reactContext != null) {
reactContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
.emit("onStoragePermissionGranted", null);
}
} else {
// Permission not granted. Show a message and terminate the application
Toast.makeText(this,
// Permission not granted
/*Toast.makeText(this,
"LBRY requires access to your device storage to be able to download files and media." +
" Please enable the storage permission and restart the app.", Toast.LENGTH_LONG).show();
if (serviceRunning) {
ServiceHelper.stop(this, LbrynetService.class);
" Please enable the storage permission and restart the app.", Toast.LENGTH_LONG).show();*/
if (reactContext != null) {
reactContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
.emit("onStoragePermissionRefused", null);
}
finish();
}
break;
case PHONE_STATE_PERMISSION_REQ_CODE:
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
// Permission granted. Emit an onPhoneStatePermissionGranted event
ReactContext reactContext = mReactInstanceManager.getCurrentReactContext();
if (reactContext != null) {
reactContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
.emit("onPhoneStatePermissionGranted", null);
@@ -345,7 +404,6 @@ public class MainActivity extends Activity implements DefaultHardwareBackBtnHand
case RECEIVE_SMS_PERMISSION_REQ_CODE:
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
// Permission granted. Emit an onPhoneStatePermissionGranted event
ReactContext reactContext = mReactInstanceManager.getCurrentReactContext();
if (reactContext != null) {
reactContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
.emit("onReceiveSmsPermissionGranted", null);
@@ -506,6 +564,8 @@ public class MainActivity extends Activity implements DefaultHardwareBackBtnHand
NotificationManagerCompat notificationManager = NotificationManagerCompat.from(this);
notificationManager.cancel(sourceNotificationId);
}
checkNotificationOpenIntent(intent);
}
super.onNewIntent(intent);
@@ -549,6 +609,15 @@ public class MainActivity extends Activity implements DefaultHardwareBackBtnHand
true);
}
public static void checkStoragePermission(Context context) {
// Request read phone state permission
checkPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE,
STORAGE_PERMISSION_REQ_CODE,
"LBRY requires access to your device storage to be able to download files and media.",
context,
true);
}
private boolean isServiceRunning(Class<?> serviceClass) {
ActivityManager manager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
for (ActivityManager.RunningServiceInfo serviceInfo : manager.getRunningServices(Integer.MAX_VALUE)) {
@@ -609,4 +678,161 @@ public class MainActivity extends Activity implements DefaultHardwareBackBtnHand
return array;
}
/**
* https://gist.github.com/HBiSoft/15899990b8cd0723c3a894c1636550a8
*/
@SuppressLint("NewApi")
public static String getRealPathFromURI_API19(final Context context, final Uri uri) {
final boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
// DocumentProvider
if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) {
// ExternalStorageProvider
if (isExternalStorageDocument(uri)) {
final String docId = DocumentsContract.getDocumentId(uri);
final String[] split = docId.split(":");
final String type = split[0];
// This is for checking Main Memory
if ("primary".equalsIgnoreCase(type)) {
if (split.length > 1) {
return Environment.getExternalStorageDirectory() + "/" + split[1];
} else {
return Environment.getExternalStorageDirectory() + "/";
}
// This is for checking SD Card
} else {
return "storage" + "/" + docId.replace(":", "/");
}
}
// DownloadsProvider
else if (isDownloadsDocument(uri)) {
String fileName = getFilePath(context, uri);
if (fileName != null) {
return Environment.getExternalStorageDirectory().toString() + "/Download/" + fileName;
}
String id = DocumentsContract.getDocumentId(uri);
if (id.startsWith("raw:")) {
id = id.replaceFirst("raw:", "");
File file = new File(id);
if (file.exists())
return id;
}
final Uri contentUri = ContentUris.withAppendedId(Uri.parse("content://downloads/public_downloads"), Long.valueOf(id));
return getDataColumn(context, contentUri, null, null);
}
// MediaProvider
else if (isMediaDocument(uri)) {
final String docId = DocumentsContract.getDocumentId(uri);
final String[] split = docId.split(":");
final String type = split[0];
Uri contentUri = null;
if ("image".equals(type)) {
contentUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
} else if ("video".equals(type)) {
contentUri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
} else if ("audio".equals(type)) {
contentUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
}
final String selection = "_id=?";
final String[] selectionArgs = new String[]{
split[1]
};
return getDataColumn(context, contentUri, selection, selectionArgs);
}
}
// MediaStore (and general)
else if ("content".equalsIgnoreCase(uri.getScheme())) {
// Return the remote address
if (isGooglePhotosUri(uri))
return uri.getLastPathSegment();
return getDataColumn(context, uri, null, null);
}
// File
else if ("file".equalsIgnoreCase(uri.getScheme())) {
return uri.getPath();
}
return null;
}
public static String getDataColumn(Context context, Uri uri, String selection, String[] selectionArgs) {
Cursor cursor = null;
final String column = "_data";
final String[] projection = {
column
};
try {
cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs, null);
if (cursor != null && cursor.moveToFirst()) {
final int index = cursor.getColumnIndexOrThrow(column);
return cursor.getString(index);
}
} finally {
if (cursor != null)
cursor.close();
}
return null;
}
public static String getFilePath(Context context, Uri uri) {
Cursor cursor = null;
final String[] projection = { MediaStore.MediaColumns.DISPLAY_NAME };
try {
cursor = context.getContentResolver().query(uri, projection, null, null, null);
if (cursor != null && cursor.moveToFirst()) {
final int index = cursor.getColumnIndexOrThrow(MediaStore.MediaColumns.DISPLAY_NAME);
return cursor.getString(index);
}
} finally {
if (cursor != null)
cursor.close();
}
return null;
}
/**
* @param uri The Uri to check.
* @return Whether the Uri authority is ExternalStorageProvider.
*/
public static boolean isExternalStorageDocument(Uri uri) {
return "com.android.externalstorage.documents".equals(uri.getAuthority());
}
/**
* @param uri The Uri to check.
* @return Whether the Uri authority is DownloadsProvider.
*/
public static boolean isDownloadsDocument(Uri uri) {
return "com.android.providers.downloads.documents".equals(uri.getAuthority());
}
/**
* @param uri The Uri to check.
* @return Whether the Uri authority is MediaProvider.
*/
public static boolean isMediaDocument(Uri uri) {
return "com.android.providers.media.documents".equals(uri.getAuthority());
}
/**
* @param uri The Uri to check.
* @return Whether the Uri authority is Google Photos.
*/
public static boolean isGooglePhotosUri(Uri uri) {
return "com.google.android.apps.photos.content".equals(uri.getAuthority());
}
}
@@ -2,8 +2,22 @@ package io.lbry.browser;
import android.content.Intent;
import android.content.Context;
import android.content.res.AssetFileDescriptor;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import java.io.Closeable;
import java.io.File;
import java.io.InputStream;
import java.io.FileOutputStream;
import java.io.IOException;
public class ServiceHelper {
private static final String TAG = "io.lbry.browser.ServiceHelper";
private static final String HEADERS_ASSET_KEY = "headersAssetInitialized";
public static Intent buildIntent(Context ctx, String pythonServiceArgument, Class serviceClass, String pythonName) {
Intent intent = new Intent(ctx, serviceClass);
String argument = ctx.getFilesDir().getAbsolutePath() + "/app";
@@ -18,13 +32,83 @@ public class ServiceHelper {
return intent;
}
public static void start(Context ctx, String pythonServiceArgument, Class serviceClass, String pythonName) {
Intent intent = buildIntent(ctx, pythonServiceArgument, serviceClass, pythonName);
ctx.startService(intent);
public static void start(final Context ctx, String pythonServiceArgument, Class serviceClass, String pythonName) {
// always check initial headers status before starting the service
final SharedPreferences sp = ctx.getSharedPreferences(MainActivity.SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);
boolean initHeaders = sp.getBoolean(HEADERS_ASSET_KEY, false);
if (initHeaders) {
// initial headers asset copy already done. simply start the service
Intent intent = buildIntent(ctx, pythonServiceArgument, serviceClass, pythonName);
ctx.startService(intent);
return;
}
(new AsyncTask<Void, Void, Void>() {
@Override
protected Void doInBackground(Void... params) {
String targetPath = String.format("%s/lbryum/lbc_mainnet", Utils.getAppInternalStorageDir(ctx));
File targetDir = new File(targetPath);
if (!targetDir.exists()) {
targetDir.mkdirs();
}
String headersPath = String.format("%s/headers", targetPath);
android.util.Log.d(TAG, String.format("HeadersPath: %s", headersPath));
File targetHeadersFile = new File(headersPath);
InputStream in = null;
FileOutputStream out = null;
long sourceLen = 0;
long targetLen = 0;
try {
android.util.Log.d(TAG, "Opening asset: blockchain/headers");
in = ctx.getAssets().open("blockchain/headers");
out = new FileOutputStream(targetHeadersFile);
byte[] b = new byte[1120]; // 10 headers at a time?
int len;
while ((len = in.read(b, 0, 1120)) > 0) {
sourceLen += len;
out.write(b, 0, len);
}
} catch (Exception ex) {
// failed to copy the headers. sdk will perform the download instead.
android.util.Log.e(TAG, "failed to copy headers asset", ex);
} finally {
closeStream(in);
closeStream(out);
// only mark the copy as successful if the file sizes are the same
targetLen = targetHeadersFile.exists() ? targetHeadersFile.length() : 0;
android.util.Log.d(TAG, String.format("SourceLength=%d; TargetLength=%d", sourceLen, targetLen));
if (targetLen > 0 && targetLen == sourceLen) {
SharedPreferences.Editor editor = sp.edit();
editor.putBoolean(HEADERS_ASSET_KEY, true);
editor.commit();
}
}
return null;
}
protected void onPostExecute(Void result) {
Intent intent = buildIntent(ctx, pythonServiceArgument, serviceClass, pythonName);
ctx.startService(intent);
}
}).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
public static void stop(Context ctx, Class serviceClass) {
Intent intent = new Intent(ctx, serviceClass);
ctx.stopService(intent);
}
private static void closeStream(Closeable closeable) {
try {
if (closeable != null) {
closeable.close();
}
} catch (IOException ex) {
// pass
}
}
}
+166 -4
View File
@@ -2,6 +2,7 @@ package io.lbry.browser;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Build;
import android.security.KeyPairGeneratorSpec;
import android.util.Base64;
import android.util.Log;
@@ -10,7 +11,14 @@ import io.lbry.browser.BuildConfig;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.DataOutputStream;
import java.net.ConnectException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.math.BigInteger;
import java.nio.charset.Charset;
import java.security.InvalidAlgorithmParameterException;
@@ -18,9 +26,12 @@ import java.security.Key;
import java.security.KeyPairGenerator;
import java.security.KeyStore;
import java.security.NoSuchProviderException;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Map;
import javax.crypto.Cipher;
import javax.crypto.CipherInputStream;
@@ -28,6 +39,9 @@ import javax.crypto.CipherOutputStream;
import javax.crypto.spec.SecretKeySpec;
import javax.security.auth.x500.X500Principal;
import org.json.JSONObject;
import org.json.JSONException;
public final class Utils {
private static final String TAG = Utils.class.getName();
@@ -46,6 +60,10 @@ public final class Utils {
private static final String SP_API_SECRET_KEY = "api_secret";
public static final String SDK_URL = "http://127.0.0.1:5279";
public static final String SP_DOWNLOAD_DIR_KEY = "download_dir";
public static String getAndroidRelease() {
return android.os.Build.VERSION.RELEASE;
}
@@ -98,6 +116,16 @@ public final class Utils {
return file.getAbsolutePath();
}
public static String getConfiguredDownloadDirectory(Context context) {
// use the default folder (usually [private files]/Download with WRITE_EXTERNAL_STOAGE permission not granted)
// if none is configured or specified
String defaultDirectory = String.format("%s/Download", getInternalStorageDir(context));
SharedPreferences pref = context.getSharedPreferences(SP_NAME, Context.MODE_PRIVATE);
String downloadDirectory = pref.getString(SP_DOWNLOAD_DIR_KEY, defaultDirectory);
return downloadDirectory;
}
public static void saveApiSecret(String secret, Context context, KeyStore keyStore) {
try {
SharedPreferences pref = context.getSharedPreferences(SP_NAME, Context.MODE_PRIVATE);
@@ -140,6 +168,7 @@ public final class Utils {
try {
SharedPreferences pref = context.getSharedPreferences(SP_NAME, Context.MODE_PRIVATE);
String encryptedValue = pref.getString(key, null);
if (encryptedValue == null || encryptedValue.trim().length() == 0) {
return null;
}
@@ -243,12 +272,124 @@ public final class Utils {
return ks;
}
public static String performRequest(String url) throws ConnectException {
return performRequest(url, "GET", null);
}
public static String performRequest(String requestUrl, String requestMethod, String json) throws ConnectException {
BufferedReader reader = null;
DataOutputStream dos = null;
HttpURLConnection conn = null;
try {
URL url = new URL(requestUrl);
conn = (HttpURLConnection) url.openConnection();
conn.setDoInput(true);
conn.setUseCaches(false);
conn.setRequestMethod(requestMethod);
if ("POST".equals(requestMethod)) {
conn.setDoOutput(true);
conn.setRequestProperty("Content-type", "application/json");
}
if (json != null) {
dos = new DataOutputStream(conn.getOutputStream());
dos.writeBytes(json);
dos.flush();
dos.close();
}
if (conn.getResponseCode() == 200) {
reader = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"));
StringBuilder sb = new StringBuilder();
String input;
while ((input = reader.readLine()) != null) {
sb.append(input);
}
return sb.toString();
} else {
reader = new BufferedReader(new InputStreamReader(conn.getErrorStream(), "utf-8"));
StringBuilder sb = new StringBuilder();
String error;
while ((error = reader.readLine()) != null) {
sb.append(error);
}
return sb.toString();
}
} catch (ConnectException ex) {
// unable to connect. rethrow
throw ex;
} catch (IOException ex) {
Log.e(TAG, ex.getMessage(), ex);
// pass
} catch (Exception ex) {
Log.e(TAG, ex.getMessage(), ex);
// pass
} finally {
try {
if (reader != null) {
reader.close();
}
if (conn != null) {
conn.disconnect();
}
} catch (IOException ex) {
// pass
}
}
return null;
}
public static String sdkCall(String method) throws ConnectException {
return sdkCall(method, null);
}
public static String sdkCall(String method, Map<String, String> params) throws ConnectException {
try {
JSONObject request = new JSONObject();
request.put("method", method);
if (params != null) {
JSONObject requestParams = new JSONObject();
for (Map.Entry<String, String> entry : params.entrySet()) {
requestParams.put(entry.getKey(), entry.getValue());
}
request.put("params", requestParams);
}
return performRequest(SDK_URL, "POST", request.toString());
} catch (ConnectException ex) {
// sdk not started yet. rethrow
throw ex;
} catch (JSONException ex) {
// normally shouldn't happen
Log.e(TAG, ex.getMessage(), ex);
// pass
}
return null;
}
private static byte[] rsaEncrypt(byte[] secret, KeyStore keyStore) throws Exception {
KeyStore.PrivateKeyEntry privateKeyEntry = (KeyStore.PrivateKeyEntry) keyStore.getEntry(KEY_ALIAS, null);
PrivateKey privateKey = null;
PublicKey publicKey = null;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
privateKey = (PrivateKey) keyStore.getKey(KEY_ALIAS, null);
publicKey = keyStore.getCertificate(KEY_ALIAS).getPublicKey();
} else {
KeyStore.PrivateKeyEntry privateKeyEntry = (KeyStore.PrivateKeyEntry) keyStore.getEntry(KEY_ALIAS, null);
privateKey = privateKeyEntry.getPrivateKey();
publicKey = privateKeyEntry.getCertificate().getPublicKey();
}
if (publicKey == null) {
throw new Exception("Could not obtain public key for encryption.");
}
// Encrypt the text
Cipher inputCipher = Cipher.getInstance(RSA_MODE);
inputCipher.init(Cipher.ENCRYPT_MODE, privateKeyEntry.getCertificate().getPublicKey());
inputCipher.init(Cipher.ENCRYPT_MODE, publicKey);
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
CipherOutputStream cipherOutputStream = new CipherOutputStream(outputStream, inputCipher);
@@ -259,9 +400,20 @@ public final class Utils {
}
private static byte[] rsaDecrypt(byte[] encrypted, KeyStore keyStore) throws Exception {
KeyStore.PrivateKeyEntry privateKeyEntry = (KeyStore.PrivateKeyEntry) keyStore.getEntry(KEY_ALIAS, null);
PrivateKey privateKey = null;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
privateKey = (PrivateKey) keyStore.getKey(KEY_ALIAS, null);
} else {
KeyStore.PrivateKeyEntry privateKeyEntry = (KeyStore.PrivateKeyEntry) keyStore.getEntry(KEY_ALIAS, null);
privateKey = privateKeyEntry.getPrivateKey();
}
if (privateKey == null) {
throw new Exception("Could not obtain private key for decryption");
}
Cipher output = Cipher.getInstance(RSA_MODE);
output.init(Cipher.DECRYPT_MODE, privateKeyEntry.getPrivateKey());
output.init(Cipher.DECRYPT_MODE, privateKey);
CipherInputStream cipherInputStream = new CipherInputStream(new ByteArrayInputStream(encrypted), output);
ArrayList<Byte> values = new ArrayList<Byte>();
int nextByte;
@@ -300,4 +452,14 @@ public final class Utils {
}
return new SecretKeySpec(rsaDecrypt(Base64.decode(base64Key, Base64.DEFAULT), keyStore), "AES");
}
public static String capitalizeAndStrip(String text) {
String[] parts = text.split(" ");
StringBuilder sb = new StringBuilder();
for (int i = 0; i < parts.length; i++) {
sb.append(parts[i].substring(0, 1).toUpperCase()).append(parts[i].substring(1));
}
return sb.toString();
}
}
@@ -10,9 +10,9 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Build;
import android.support.v4.app.NotificationCompat;
import android.support.v4.app.NotificationManagerCompat;
import android.support.v4.content.ContextCompat;
import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationManagerCompat;
import androidx.core.content.ContextCompat;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
@@ -66,7 +66,7 @@ public class BackgroundMediaModule extends ReactContextBaseJavaModule {
.setGroup(LbrynetService.GROUP_SERVICE)
.setOngoing(!paused)
.setSmallIcon(paused ? android.R.drawable.ic_media_pause : android.R.drawable.ic_media_play)
.setStyle(new android.support.v4.media.app.NotificationCompat.MediaStyle()
.setStyle(new androidx.media.app.NotificationCompat.MediaStyle()
.setShowActionsInCompactView(0))
.addAction(paused ? android.R.drawable.ic_media_play : android.R.drawable.ic_media_pause,
paused ? "Play" : "Pause",
@@ -1,16 +1,24 @@
package io.lbry.browser.reactmodules;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.widget.Toast;
import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.ReadableMap;
import com.google.firebase.analytics.FirebaseAnalytics;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.iid.FirebaseInstanceId;
import com.google.firebase.iid.InstanceIdResult;
import io.lbry.browser.BuildConfig;
import io.lbry.browser.MainActivity;
import io.lbry.browser.Utils;
import java.util.HashMap;
import java.util.Map;
@@ -34,6 +42,19 @@ public class FirebaseModule extends ReactContextBaseJavaModule {
return "Firebase";
}
@ReactMethod
public void setCurrentScreen(String name, final Promise promise) {
final Activity activity = getCurrentActivity();
if (activity != null && firebaseAnalytics != null) {
activity.runOnUiThread(new Runnable() {
public void run() {
firebaseAnalytics.setCurrentScreen(activity, name, Utils.capitalizeAndStrip(name));
}
});
}
promise.resolve(true);
}
@ReactMethod
public void track(String name, ReadableMap payload) {
Bundle bundle = new Bundle();
@@ -65,8 +86,26 @@ public class FirebaseModule extends ReactContextBaseJavaModule {
Toast.makeText(context,
"An application error occurred which has been automatically logged. " +
"If you keep seeing this message, please provide feedback to the LBRY " +
"team by emailing hello@lbry.io.",
"team by emailing hello@lbry.com.",
Toast.LENGTH_LONG).show();
}
}
@ReactMethod
public void getMessagingToken(final Promise promise) {
FirebaseInstanceId.getInstance().getInstanceId()
.addOnCompleteListener(new OnCompleteListener<InstanceIdResult>() {
@Override
public void onComplete(Task<InstanceIdResult> task) {
if (!task.isSuccessful()) {
promise.reject("Firebase getInstanceId call failed");
return;
}
// Get new Instance ID token
String token = task.getResult().getToken();
promise.resolve(token);
}
});
}
}
@@ -221,16 +221,23 @@ public class GalleryModule extends ReactContextBaseJavaModule {
}
}
}
if (file.exists() && file.length() > 0 && GalleryModule.this.context != null) {
WritableMap params = Arguments.createMap();
params.putString("id", id);
((ReactApplicationContext) GalleryModule.this.context).getJSModule(
DeviceEventManagerModule.RCTDeviceEventEmitter.class).emit("onGalleryThumbnailChecked", params);
}
}
}
return null;
}
protected void onPostExecute(Void result) {
public void onPostExecute(Void result) {
if (GalleryModule.this.context != null) {
((ReactApplicationContext) GalleryModule.this.context).getJSModule(
DeviceEventManagerModule.RCTDeviceEventEmitter.class).emit("onGalleryThumbnailsChecked", null);
DeviceEventManagerModule.RCTDeviceEventEmitter.class).emit("onAllGalleryThumbnailsChecked", null);
}
}
}).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
@@ -0,0 +1,74 @@
package io.lbry.browser.reactmodules;
import android.content.Context;
import android.os.AsyncTask;
import android.os.Bundle;
import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.ReadableMapKeySetIterator;
import com.facebook.react.bridge.ReadableType;
import com.facebook.react.bridge.WritableMap;
import io.lbry.browser.MainActivity;
import io.lbry.browser.Utils;
import java.util.List;
import java.util.ArrayList;
import org.json.JSONObject;
import org.json.JSONArray;
import org.json.JSONException;
public class RequestsModule extends ReactContextBaseJavaModule {
private Context context;
public RequestsModule(ReactApplicationContext reactContext) {
super(reactContext);
this.context = reactContext;
}
@Override
public String getName() {
return "Requests";
}
@ReactMethod
public void get(final String url, final Promise promise) {
(new AsyncTask<Void, Void, String>() {
@Override
protected String doInBackground(Void... params) {
try {
return Utils.performRequest(url);
} catch (Exception ex) {
return null;
}
}
protected void onPostExecute(String response) {
if (response == null) {
promise.reject(String.format("Request to %s returned null.", url));
return;
}
promise.resolve(response);
}
}).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
@ReactMethod
public void lbryioCall(String authToken, final Promise promise) {
// get the auth token here, or let the app pass it in?
}
@ReactMethod
public void lbryCall(final Promise promise) {
}
}
@@ -0,0 +1,193 @@
package io.lbry.browser.reactmodules;
import android.content.Context;
import android.os.AsyncTask;
import android.os.Bundle;
import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.ReadableMapKeySetIterator;
import com.facebook.react.bridge.ReadableType;
import com.facebook.react.bridge.WritableMap;
import io.lbry.browser.MainActivity;
import java.util.List;
import java.util.ArrayList;
import org.json.JSONObject;
import org.json.JSONArray;
import org.json.JSONException;
public class StatePersistorModule extends ReactContextBaseJavaModule {
private Context context;
private List<ReadableMap> queue;
private ReadableMap filter;
private ReadableMap lastState;
private AsyncTask persistTask;
public StatePersistorModule(ReactApplicationContext reactContext) {
super(reactContext);
this.context = reactContext;
queue = new ArrayList<ReadableMap>();
}
@Override
public String getName() {
return "StatePersistor";
}
/*private WritableMap filterState(ReadableMap state) {
WritableMap filteredState = Arguments.createMap();
return state;
}*/
public boolean hasStateChanged(ReadableMap newState) {
return false;
}
@ReactMethod
public void update(ReadableMap state, ReadableMap filter) {
if (this.filter == null) {
this.filter = filter;
}
// process state updates from the queue using a background task
synchronized (this) {
queue.add(state);
}
persistState();
}
private void persistState() {
persistState(false);
}
private void persistState(final boolean flush) {
if (flush && persistTask != null) {
persistTask.cancel(true);
persistTask = null;
}
if (persistTask == null) {
persistTask = (new AsyncTask<Object, Void, Boolean>() {
protected Boolean doInBackground(Object... param) {
// get the first item in the queue
ReadableMap queuedState = null;
if (queue.size() > 0) {
synchronized (StatePersistorModule.this) {
queuedState = queue.remove(flush ? queue.size() - 1 : 0);
if (flush) {
// we only want the final state in this scenario
queue.clear();
}
}
}
if (queuedState != null) {
ReadableMap state = queuedState; //(ReadableMap) filterState(queuedState);
// convert to JSON object
try {
JSONObject json = readableMapToJSON(state);
// save the state file
// TODO: explore this option at a later date
throw new UnsupportedOperationException();
} catch (JSONException ex) {
// normally shouldn't happen, but if it does, reinsert into the queue
if (queuedState != null) {
synchronized (StatePersistorModule.this) {
queue.add(0, queuedState);
}
}
return false;
}
}
return false;
}
public void onPostExecute(Boolean result) {
if (queue.size() > 0) {
persistState();
}
persistTask = null;
}
});
persistTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
}
@ReactMethod
public void flush() {
persistState(true);
}
private static JSONObject readableMapToJSON(ReadableMap readableMap) throws JSONException {
JSONObject json = new JSONObject();
ReadableMapKeySetIterator iterator = readableMap.keySetIterator();
while (iterator.hasNextKey()) {
String key = iterator.nextKey();
switch (readableMap.getType(key)) {
case Map:
json.put(key, readableMapToJSON(readableMap.getMap(key)));
break;
case Array:
json.put(key, readableArrayToJSON(readableMap.getArray(key)));
break;
case Boolean:
json.put(key, readableMap.getBoolean(key));
break;
case Null:
json.put(key, JSONObject.NULL);
break;
case Number:
json.put(key, readableMap.getDouble(key));
break;
case String:
json.put(key, readableMap.getString(key));
break;
}
}
return json;
}
private static JSONArray readableArrayToJSON(ReadableArray readableArray) throws JSONException {
JSONArray array = new JSONArray();
for (int i = 0; i < readableArray.size(); i++) {
switch (readableArray.getType(i)) {
case Null:
break;
case Boolean:
array.put(readableArray.getBoolean(i));
break;
case Number:
array.put(readableArray.getDouble(i));
break;
case String:
array.put(readableArray.getString(i));
break;
case Map:
array.put(readableMapToJSON(readableArray.getMap(i)));
break;
case Array:
array.put(readableArrayToJSON(readableArray.getArray(i)));
break;
}
}
return array;
}
}
@@ -12,10 +12,10 @@ import android.Manifest;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build;
import android.support.v4.content.FileProvider;
import android.support.v4.app.NotificationCompat;
import android.support.v4.app.NotificationManagerCompat;
import android.support.v4.content.ContextCompat;
import androidx.core.content.FileProvider;
import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationManagerCompat;
import androidx.core.content.ContextCompat;
import android.telephony.TelephonyManager;
import android.view.View;
import android.view.WindowManager;
@@ -25,10 +25,14 @@ import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.common.MapBuilder;
import com.squareup.picasso.Picasso;
import java.io.File;
import java.io.Closeable;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
@@ -52,6 +56,19 @@ public class UtilityModule extends ReactContextBaseJavaModule {
public static final String ACTION_NOTIFICATION_LATER = "io.lbry.browser.ACTION_NOTIFICATION_LATER";
public static final String RECEIVE_SUBSCRIPTION_NOTIFICATIONS = "receiveSubscriptionNotifications";
public static final String RECEIVE_REWARD_NOTIFICATIONS = "receiveRewardNotifications";
public static final String RECEIVE_INTERESTS_NOTIFICATIONS = "receiveInterestsNotifications";
public static final String RECEIVE_CREATOR_NOTIFICATIONS = "receiveCreatorNotifications";
// the last language set to be loaded
private static final String LANGUAGE_SETTING_KEY = "language";
private String language;
private Context context;
private KeyStore keyStore;
@@ -64,6 +81,16 @@ public class UtilityModule extends ReactContextBaseJavaModule {
} catch (Exception ex) {
// continue without keystore
}
SharedPreferences sp = context.getSharedPreferences(MainActivity.SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);
language = sp.getString(LANGUAGE_SETTING_KEY, "en");
}
@Override
public Map<String, Object> getConstants() {
final Map<String, Object> constants = MapBuilder.newHashMap();
constants.put("language", language);
return constants;
}
@Override
@@ -113,7 +140,6 @@ public class UtilityModule extends ReactContextBaseJavaModule {
View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
}
});
}
}
@@ -181,6 +207,19 @@ public class UtilityModule extends ReactContextBaseJavaModule {
}
}
@ReactMethod
public void canReadWriteStorage(final Promise promise) {
promise.resolve(MainActivity.hasPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE, MainActivity.getActivity()));
}
@ReactMethod
public void requestStoragePermission() {
MainActivity activity = (MainActivity) MainActivity.getActivity();
if (activity != null) {
MainActivity.checkStoragePermission(activity);
}
}
@ReactMethod
public void shareLogFile(Callback errorCallback) {
String logFileName = "lbrynet.log";
@@ -208,6 +247,18 @@ public class UtilityModule extends ReactContextBaseJavaModule {
}
}
@ReactMethod
public void shareUrl(String url) {
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(Intent.EXTRA_TEXT, url);
Intent shareUrlIntent = Intent.createChooser(shareIntent, "Share LBRY content");
shareUrlIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(shareUrlIntent);
}
@ReactMethod
public void showNotificationForContent(final String uri, String title, String publisher, final String thumbnail, boolean isPlayable) {
final NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
@@ -340,6 +391,7 @@ public class UtilityModule extends ReactContextBaseJavaModule {
Intent intent = new Intent();
intent.setAction(LbrynetService.ACTION_QUEUE_DOWNLOAD);
intent.putExtra("outpoint", outpoint);
if (context != null) {
context.sendBroadcast(intent);
}
@@ -354,4 +406,68 @@ public class UtilityModule extends ReactContextBaseJavaModule {
context.sendBroadcast(intent);
}
}
@ReactMethod
public void openDocumentPicker(String type) {
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
intent.setType(type);
Activity activity = MainActivity.getActivity();
if (activity != null) {
activity.startActivityForResult(
Intent.createChooser(intent, "Select a file"), MainActivity.DOCUMENT_PICKER_RESULT_CODE);
}
}
@ReactMethod
public void setNativeBooleanSetting(String key, boolean value) {
if (context != null) {
SharedPreferences sp = context.getSharedPreferences(MainActivity.SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sp.edit();
editor.putBoolean(key, value);
editor.commit();
}
}
@ReactMethod
public void setNativeStringSetting(String key, String value) {
if (context != null) {
SharedPreferences sp = context.getSharedPreferences(MainActivity.SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sp.edit();
editor.putString(key, value);
editor.commit();
}
}
@ReactMethod
public void getNativeStringSetting(String key, String defaultValue, Promise promise) {
if (context != null) {
SharedPreferences sp = context.getSharedPreferences(MainActivity.SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);
promise.resolve(sp.getString(key, defaultValue));
} else {
promise.resolve(null);
}
}
@ReactMethod
public void getNotificationLaunchTarget(Promise promise) {
Activity activity = MainActivity.getActivity();
if (activity != null) {
Intent intent = activity.getIntent();
if (intent != null) {
String target = intent.getStringExtra("target");
if (target != null && target.trim().length() > 0) {
promise.resolve(target);
return;
}
}
}
promise.resolve(null);
}
@ReactMethod
public void getDownloadDirectory(Promise promise) {
// This obtains a public default download directory after the storage permission has been granted
promise.resolve(Utils.getConfiguredDownloadDirectory(context));
}
}
@@ -10,9 +10,11 @@ import io.lbry.browser.reactmodules.DaemonServiceControlModule;
import io.lbry.browser.reactmodules.FirstRunModule;
import io.lbry.browser.reactmodules.FirebaseModule;
import io.lbry.browser.reactmodules.GalleryModule;
import io.lbry.browser.reactmodules.RequestsModule;
import io.lbry.browser.reactmodules.ScreenOrientationModule;
import io.lbry.browser.reactmodules.StatePersistorModule;
import io.lbry.browser.reactmodules.VersionInfoModule;
import io.lbry.browser.reactmodules.UtilityModule;;
import io.lbry.browser.reactmodules.UtilityModule;
import java.util.ArrayList;
import java.util.Collections;
@@ -33,7 +35,9 @@ public class LbryReactPackage implements ReactPackage {
modules.add(new FirstRunModule(reactContext));
modules.add(new FirebaseModule(reactContext));
modules.add(new GalleryModule(reactContext));
modules.add(new RequestsModule(reactContext));
modules.add(new ScreenOrientationModule(reactContext));
modules.add(new StatePersistorModule(reactContext));
modules.add(new UtilityModule(reactContext));
modules.add(new VersionInfoModule(reactContext));
+3 -1
View File
@@ -73,10 +73,12 @@ def configure_logging(conf):
def start():
keyring.set_keyring(LbryAndroidKeyring())
private_storage_dir = lbrynet_android_utils.getAppInternalStorageDir(service.getApplicationContext())
configured_download_dir = lbrynet_android_utils.getConfiguredDownloadDirectory(service.getApplicationContext())
print('configured_download_dir={}'.format(configured_download_dir))
conf = Config(
data_dir=f'{private_storage_dir}/lbrynet',
wallet_dir=f'{private_storage_dir}/lbryum',
download_dir=f'{lbrynet_android_utils.getInternalStorageDir(service.getApplicationContext())}/Download',
download_dir=configured_download_dir,
blob_lru_cache_size=32,
components_to_skip=[DHT_COMPONENT, HASH_ANNOUNCER_COMPONENT, PEER_PROTOCOL_SERVER_COMPONENT],
save_blobs=False,
+1 -1
View File
@@ -1,4 +1,4 @@
__version__ = "0.8.0"
__version__ = "0.12.2"
class ServiceApp(App):
def build(self):
Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 KiB

After

Width:  |  Height:  |  Size: 620 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 KiB

After

Width:  |  Height:  |  Size: 444 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

@@ -0,0 +1 @@
{"100":"💯","1234":"🔢","umbrella_with_rain_drops":"☔","coffee":"☕","aries":"♈","taurus":"♉","sagittarius":"♐","capricorn":"♑","aquarius":"♒","pisces":"♓","anchor":"⚓","white_check_mark":"✅","sparkles":"✨","question":"❓","grey_question":"❔","grey_exclamation":"❕","exclamation":"❗","heavy_exclamation_mark":"❗","heavy_plus_sign":"➕","heavy_minus_sign":"➖","heavy_division_sign":"➗","hash":"#️⃣","keycap_star":"*️⃣","zero":"0️⃣","one":"1️⃣","two":"2️⃣","three":"3️⃣","four":"4️⃣","five":"5️⃣","six":"6️⃣","seven":"7️⃣","eight":"8️⃣","nine":"9️⃣","copyright":"©️","registered":"®️","mahjong":"🀄","black_joker":"🃏","a":"🅰️","b":"🅱️","o2":"🅾️","parking":"🅿️","ab":"🆎","cl":"🆑","cool":"🆒","free":"🆓","id":"🆔","new":"🆕","ng":"🆖","ok":"🆗","sos":"🆘","up":"🆙","vs":"🆚","flag-ac":"🇦🇨","flag-ad":"🇦🇩","flag-ae":"🇦🇪","flag-af":"🇦🇫","flag-ag":"🇦🇬","flag-ai":"🇦🇮","flag-al":"🇦🇱","flag-am":"🇦🇲","flag-ao":"🇦🇴","flag-aq":"🇦🇶","flag-ar":"🇦🇷","flag-as":"🇦🇸","flag-at":"🇦🇹","flag-au":"🇦🇺","flag-aw":"🇦🇼","flag-ax":"🇦🇽","flag-az":"🇦🇿","flag-ba":"🇧🇦","flag-bb":"🇧🇧","flag-bd":"🇧🇩","flag-be":"🇧🇪","flag-bf":"🇧🇫","flag-bg":"🇧🇬","flag-bh":"🇧🇭","flag-bi":"🇧🇮","flag-bj":"🇧🇯","flag-bl":"🇧🇱","flag-bm":"🇧🇲","flag-bn":"🇧🇳","flag-bo":"🇧🇴","flag-bq":"🇧🇶","flag-br":"🇧🇷","flag-bs":"🇧🇸","flag-bt":"🇧🇹","flag-bv":"🇧🇻","flag-bw":"🇧🇼","flag-by":"🇧🇾","flag-bz":"🇧🇿","flag-ca":"🇨🇦","flag-cc":"🇨🇨","flag-cd":"🇨🇩","flag-cf":"🇨🇫","flag-cg":"🇨🇬","flag-ch":"🇨🇭","flag-ci":"🇨🇮","flag-ck":"🇨🇰","flag-cl":"🇨🇱","flag-cm":"🇨🇲","cn":"🇨🇳","flag-cn":"🇨🇳","flag-co":"🇨🇴","flag-cp":"🇨🇵","flag-cr":"🇨🇷","flag-cu":"🇨🇺","flag-cv":"🇨🇻","flag-cw":"🇨🇼","flag-cx":"🇨🇽","flag-cy":"🇨🇾","flag-cz":"🇨🇿","de":"🇩🇪","flag-de":"🇩🇪","flag-dg":"🇩🇬","flag-dj":"🇩🇯","flag-dk":"🇩🇰","flag-dm":"🇩🇲","flag-do":"🇩🇴","flag-dz":"🇩🇿","flag-ea":"🇪🇦","flag-ec":"🇪🇨","flag-ee":"🇪🇪","flag-eg":"🇪🇬","flag-eh":"🇪🇭","flag-er":"🇪🇷","es":"🇪🇸","flag-es":"🇪🇸","flag-et":"🇪🇹","flag-eu":"🇪🇺","flag-fi":"🇫🇮","flag-fj":"🇫🇯","flag-fk":"🇫🇰","flag-fm":"🇫🇲","flag-fo":"🇫🇴","fr":"🇫🇷","flag-fr":"🇫🇷","flag-ga":"🇬🇦","gb":"🇬🇧","uk":"🇬🇧","flag-gb":"🇬🇧","flag-gd":"🇬🇩","flag-ge":"🇬🇪","flag-gf":"🇬🇫","flag-gg":"🇬🇬","flag-gh":"🇬🇭","flag-gi":"🇬🇮","flag-gl":"🇬🇱","flag-gm":"🇬🇲","flag-gn":"🇬🇳","flag-gp":"🇬🇵","flag-gq":"🇬🇶","flag-gr":"🇬🇷","flag-gs":"🇬🇸","flag-gt":"🇬🇹","flag-gu":"🇬🇺","flag-gw":"🇬🇼","flag-gy":"🇬🇾","flag-hk":"🇭🇰","flag-hm":"🇭🇲","flag-hn":"🇭🇳","flag-hr":"🇭🇷","flag-ht":"🇭🇹","flag-hu":"🇭🇺","flag-ic":"🇮🇨","flag-id":"🇮🇩","flag-ie":"🇮🇪","flag-il":"🇮🇱","flag-im":"🇮🇲","flag-in":"🇮🇳","flag-io":"🇮🇴","flag-iq":"🇮🇶","flag-ir":"🇮🇷","flag-is":"🇮🇸","it":"🇮🇹","flag-it":"🇮🇹","flag-je":"🇯🇪","flag-jm":"🇯🇲","flag-jo":"🇯🇴","jp":"🇯🇵","flag-jp":"🇯🇵","flag-ke":"🇰🇪","flag-kg":"🇰🇬","flag-kh":"🇰🇭","flag-ki":"🇰🇮","flag-km":"🇰🇲","flag-kn":"🇰🇳","flag-kp":"🇰🇵","kr":"🇰🇷","flag-kr":"🇰🇷","flag-kw":"🇰🇼","flag-ky":"🇰🇾","flag-kz":"🇰🇿","flag-la":"🇱🇦","flag-lb":"🇱🇧","flag-lc":"🇱🇨","flag-li":"🇱🇮","flag-lk":"🇱🇰","flag-lr":"🇱🇷","flag-ls":"🇱🇸","flag-lt":"🇱🇹","flag-lu":"🇱🇺","flag-lv":"🇱🇻","flag-ly":"🇱🇾","flag-ma":"🇲🇦","flag-mc":"🇲🇨","flag-md":"🇲🇩","flag-me":"🇲🇪","flag-mf":"🇲🇫","flag-mg":"🇲🇬","flag-mh":"🇲🇭","flag-mk":"🇲🇰","flag-ml":"🇲🇱","flag-mm":"🇲🇲","flag-mn":"🇲🇳","flag-mo":"🇲🇴","flag-mp":"🇲🇵","flag-mq":"🇲🇶","flag-mr":"🇲🇷","flag-ms":"🇲🇸","flag-mt":"🇲🇹","flag-mu":"🇲🇺","flag-mv":"🇲🇻","flag-mw":"🇲🇼","flag-mx":"🇲🇽","flag-my":"🇲🇾","flag-mz":"🇲🇿","flag-na":"🇳🇦","flag-nc":"🇳🇨","flag-ne":"🇳🇪","flag-nf":"🇳🇫","flag-ng":"🇳🇬","flag-ni":"🇳🇮","flag-nl":"🇳🇱","flag-no":"🇳🇴","flag-np":"🇳🇵","flag-nr":"🇳🇷","flag-nu":"🇳🇺","flag-nz":"🇳🇿","flag-om":"🇴🇲","flag-pa":"🇵🇦","flag-pe":"🇵🇪","flag-pf":"🇵🇫","flag-pg":"🇵🇬","flag-ph":"🇵🇭","flag-pk":"🇵🇰","flag-pl":"🇵🇱","flag-pm":"🇵🇲","flag-pn":"🇵🇳","flag-pr":"Line truncated
@@ -0,0 +1 @@
["AF","AL","DZ","AS","AD","AO","AI","AQ","AG","AR","AM","AW","AU","AT","AZ","BS","BH","BD","BB","BY","BE","BZ","BJ","BM","BT","BO","BA","BW","BV","BR","IO","VG","BN","BG","BF","BI","KH","CM","CA","CV","KY","CF","TD","CL","CN","CX","CC","CO","KM","CK","CR","HR","CU","CW","CY","CZ","CD","DK","DJ","DM","DO","EC","EG","SV","GQ","ER","EE","ET","FK","FO","FJ","FI","FR","GF","PF","TF","GA","GM","GE","DE","GH","GI","GR","GL","GD","GP","GU","GT","GG","GN","GW","GY","HT","HM","HN","HK","HU","IS","IN","ID","IR","IQ","IE","IM","IL","IT","CI","JM","JP","JE","JO","KZ","KE","KI","XK","KW","KG","LA","LV","LB","LS","LR","LY","LI","LT","LU","MO","MK","MG","MW","MY","MV","ML","MT","MH","MQ","MR","MU","YT","MX","FM","MD","MC","MN","ME","MS","MA","MZ","MM","NA","NR","NP","NL","NC","NZ","NI","NE","NG","NU","NF","KP","MP","NO","OM","PK","PW","PS","PA","PG","PY","PE","PH","PN","PL","PT","PR","QA","CG","RO","RU","RW","RE","BL","KN","LC","MF","PM","VC","WS","SM","SA","SN","RS","SC","SL","SG","SX","SK","SI","SB","SO","ZA","GS","KR","SS","ES","LK","SD","SR","SJ","SZ","SE","CH","SY","ST","TW","TJ","TZ","TH","TL","TG","TK","TO","TT","TN","TR","TM","TC","TV","UG","UA","AE","GB","US","UM","VI","UY","UZ","VU","VA","VE","VN","WF","EH","YE","ZM","ZW","AX"]
@@ -0,0 +1 @@
{"AF": {"currency": "AFN", "callingCode": "93", "flag": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAeCAIAAADRv8uKAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAASAAAAEgARslrPgAABJ1JREFUSMfll19oU1ccx3+/c29yc2PaJG2TGFvTuljRdnViWx9sxSmlutmhFl+GCBvCQPBhyAR92VDwcb74IJTucQo+zVFQJs6/9M/AlqrB2cZqbbLYJrRNanL/5J7z20McbA/rbevci+fhcC/nz+d8fz/u73wvgl2TADjAdwBdAFkA6V+mcQZeAX1b4czXIOWBM5tt7cbfWXv/wPJKFiH+45XofwEjlkgIQKW+dA4EgGWcYHlgBCDGoLwcXC5DVaVsFnWdEUGhUCK/AzAiAnCHg2prcds2i3M5FOIjI8Q5hsNyIgFPn8Bcbum67cFUohJZTqfR1OSKRPjYmJzNOhTF8ngQQLjdptdr7d/v+flXtBKASEtg24MREYisSASiUUmWpVhMGhsDr7fg88HsrDI3Jw8NUUODjgTr15tqDqwcINrqlm2pnEiW5bpjx6RoVL13T9y4oUSjxsxMoLNTFAra1auOmhqIxSo/65LqPwznR0D7nqT/QjEAfHrgwMaqqvzEhDQ6KgBcXV08nY5euKBPT8cNQ6mo0Ht65Hh8QVEb123arnzcP3cbmU3AFysgiEhEq9xuYZovBwbcr14V794FAF8k4nW7zQcP+MOHXr+/LBwGALOvr7wokg9uqMIlk2SbZmmRMcYYEe3etautra19z575vj5aWGCqKlpaPLt3o89HLhdFIrnxcXN0lDwe8vqDRw9rEhQNc6o4xZAtgrdRDAB1dXWesjJ/fb2aTEZ7e9Xm5nw2+/vFi4+am2M7dz6/di2fSnn37l179qw78dK7oaGy6Kv3bADxZvlKwEQEAE6nkwsxfOmS/9AhT03N64mJ4szMms2b15486SwWnY8fc84LyWSwo0Pt7Hx6/ToyWZZkQHirHAOAqqodHR2NO3Zwzqd6e9n4eNqysLnZf+6c9/z5hYWF+bKy4uBg6qerksezoWlre8OOomyCAFy0lkmLg4lIEFWvXp1LJNZUV6dOn0aA6u5uPj2dHRhw1tdLDkcVY8bQUGFk2P/F0ZeTo0kwLicvpymNgCvMcSnU8Xj8ta6n+vsTuZxRVaU0NdUcObK6rc1tmvKLF8HW1tDBg3IwaFQF4pOTqftDf1iZZ1rcNtQ2lZ0xJoTo6u4+1d7u0HVfa6s+OGgND4OiQCCAhoHz80Qkbdni2r597tYtHgp9U3llYPYOk5gAscjONgWkJPq3+/fVEyc2hkLPbt7MFIv67dssHAafD2WZJ5OkaeVtbcqL5x99+VX/1OBwbBAksP2O7e8yCZETfVtb+8nhwxkhVgWDDNGIxRzT00KSnOvWOVta8pmM+TrnT2vXYj1nPs8wEwW+Xa1+I5oxnJyEK1cqjx+v2LdvLJWiTZv8FRUzmYzpcpUFAmGAuV+uix8u4AcZcDAwhK2iJdxOACAEMOaIx3OnTulPngQaG+c1LW9ZKgCWl69SVfPOHe3yjz6LyIFAYimWYMlGQAhCFLqe7ulBRFVRSNclRFCUWcMgImRAACCW6n6W4zKJANHBmExEmgaMEQBpmkzkYAyI3qHnAiLiHAAAEf56IADgfLlGeUX2Fv5maVfkbeF9/JP4E60nG6TGip3CAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDEzLTEwLTA3VDEzOjE0OjQwKzAyOjAwHXwFzwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxMy0xMC0wN1QxMzoxNDo0MCswMjowMGwhvXMAAAAASUVORK5CYII=", "name": {"common": "Afghanistan", "cym": "Affganistan", "deu": "Afghanistan", "fra": "Afghanistan", "hrv": "Afganistan", "ita": "Afghanistan", "jpn": "アフガニスタン", "nld": "Afghanistan", "por": "Afeganistão", "rus": "Афганистан", "spa": "Afganistán", "svk": "Afganistan", "fin": "Afganistan", "zho": "阿富汗", "isr": "אפגניסטן"}}, "AL": {"currency": "ALL", "callingCode": "355", "flag": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAeCAMAAABpA6zvAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAgdQTFRF3iEQ3CEQ3SEQ2iAQ2yEQ3yEQ5iIR4iIQ5SIQ5yIR7iMR7yMR6SMR7SMR7CMR4yIQ4CEQuBsNxR0OvRwOtxsNahAIcREIrxoN5SIRnBcLkRYKYw8HhhQK4SEQxh0O1CAPsxsNGgQClhYLoxgMZQ8HCwIBAAAAIgUC0B8PvxwOEAIBZw8HqRkMexIJJwYDZA8HIwUD0x8PkxYLQgoFXA4HTAsFcxEIVg0GYA4HrRoMAQAAjhUK6yMRTgwGHgQCRgoFKQYDeBIJNwgEJgYDFQMCPQkEYQ4HPAkESgsFLQcDKwYDWg0GIAUCaxAIdxIJAwAATAsGLgcDeRIJ1iAPUwwGOgkEOwkEEwMBFgMCDAIBHAQCUAwGwh0O5CIQdBEIHQQCbhAIgxMJPgkESwsFCAEBAgAADQIBNQgE1SAPPwkFUQwGSAsFJQUDFwMCGwQCRwsFUgwGYg8H1yAQRAoFVAwGmxcLDgIBRwoFyh4PWA0GjRUKWw0HMQcE2CAQoBgMMgcETQwGvBwOQwoFRQoFcBEIyR4OJAUDwx0OmRcLfRMJBwEBQQoFBAEAKAYDjxUKpBgMFAMB2SAQtRsNzx8PbRAI6iMRxx4OJQYDLAYDOAgEHwUCIQUCNggE4SIQrhoNgBMJyB4ONAgE0R8PmBcLqBkMphkMrBoM9iUS2yAQTwwGfxMJ6CMR////lzGo6AAAAAFiS0dErFdl8osAAAAJcEhZcwAAAEgAAABIAEbJaz4AAAHtSURBVDjLY2AYWoCRiYmBkZmZkYGBhYWZhYGJiRG7OlY2dg4mTi5uNkYmHl5uPgZ+AU7s6lgEhYTZRUTFxCWYJaWkZWTl5BVYsahjYmVSVFJWUVVTU9fQ1FJTU9XW0dXjZMKikoVP38DQyNjEVE3STM3cwkTB0srahgWbicy2dvYOamqOTs4urm5qau4enioS2ExkYHXz8vZRU/PVV1PzM1XzdwgIDMKmjEkgOCQ0LFxNLSJSTS0KSPtEe5vGxGI1Ms4jOl7NSg0MrKwczBISsatj8k5KdkpRSwUqtUpVSwuzTxfDppBJICM6Mys7JxdkppVaXk5+gVOhAFY3FkkXJ5eU2pcBrVVLszXKL/eIw6qQv8LVo9JIpjATaJ6/hWhVUHVNMRO2qGGtrROt125ojFJLTVVrYmjW1mspxRqF/K1teu0dnYpd3Wo92Va9ff3KE9wnCmD1DU/HpMldVpXOamrFU9T0piqL22BNPUzs07rVpms3zQAF0ExplVlqlcGsWMORZarK7DlzjRwmqKkp9s6rUJ89n48Fh5GCspMnL/BdqOgSNn9RzIKJ0/ixGghUycEky8C3eEmu89JlfALsrOw41AFVAuHE5f1qXdN4mYFZBqc6CFjBv3LVamYGwoBJgD+WCGUglYTspBIAAL5eaGbLfsJqAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDEzLTEwLTA3VDEzOjE0OjQ3KzAyOjAw2Ns7QQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxMy0xMC0wN1QxMzoxNDo0NyswMjowMKmGg/0AAAAASUVORK5CYII=", "name": {"common": "Albania", "cym": "Albania", "deu": "Albanien", "fra": "Albanie", "hrv": "Albanija", "ita": "Albania", "jpn": "アルバニア", "nld": "Albanië", "por": "Albânia", "rus": "Албания", "spa": "Albania", "svk": "Albánsko", "fin": "Albania", "zho": "阿尔巴尼亚", "isr": "אלבניה"}}, "DZ": {"currency": "DZD", "callingCode": "213", "flag": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAeCAMAAABpA6zvAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAgFQTFRFAL8TAL8RH8cv4Pfi////AMATAMARH8gv4PjiAMETDLYUIKcWR6Uv5NDD/+jr//r7AcATKaMYe2oiuz8p2Sot5CQw8Sk+9DlN9mJy+qy0/vDxC7gUbXQg1ywt9Rcw9Bcw9hYw8xox8yU78yk+8yg+9VZn/MbM//7+DbcUjF8k7xsw9Bgw8hkw5yAutFM266im/dHW/dre/MzR+p6o929++73EAr4TeG0h8Row8xgw0i8sT4cbJsIw/vDy+7i//eLkOZga4CUuP5QbAMER/vLine truncated
@@ -0,0 +1 @@
{"AF": {"currency": "AFN", "callingCode": "93", "flag": "flag-af", "name": {"common": "Afghanistan", "cym": "Affganistan", "deu": "Afghanistan", "fra": "Afghanistan", "hrv": "Afganistan", "ita": "Afghanistan", "jpn": "アフガニスタン", "nld": "Afghanistan", "por": "Afeganistão", "rus": "Афганистан", "spa": "Afganistán", "svk": "Afganistan", "fin": "Afganistan", "zho": "阿富汗", "isr": "אפגניסטן"}}, "AL": {"currency": "ALL", "callingCode": "355", "flag": "flag-al", "name": {"common": "Albania", "cym": "Albania", "deu": "Albanien", "fra": "Albanie", "hrv": "Albanija", "ita": "Albania", "jpn": "アルバニア", "nld": "Albanië", "por": "Albânia", "rus": "Албания", "spa": "Albania", "svk": "Albánsko", "fin": "Albania", "zho": "阿尔巴尼亚", "isr": "אלבניה"}}, "DZ": {"currency": "DZD", "callingCode": "213", "flag": "flag-dz", "name": {"common": "Algeria", "cym": "Algeria", "deu": "Algerien", "fra": "Algérie", "hrv": "Alžir", "ita": "Algeria", "jpn": "アルジェリア", "nld": "Algerije", "por": "Argélia", "rus": "Алжир", "spa": "Argelia", "svk": "Alžírsko", "fin": "Algeria", "zho": "阿尔及利亚", "isr": "אלג׳יריה"}}, "AS": {"currency": "USD", "callingCode": "1684", "flag": "flag-as", "name": {"common": "American Samoa", "deu": "Amerikanisch-Samoa", "fra": "Samoa américaines", "hrv": "Američka Samoa", "ita": "Samoa Americane", "jpn": "アメリカ領サモア", "nld": "Amerikaans Samoa", "por": "Samoa Americana", "rus": "Американское Самоа", "spa": "Samoa Americana", "svk": "Americká Samoa", "fin": "Amerikan Samoa", "zho": "美属萨摩亚", "isr": "סמואה האמריקנית"}}, "AD": {"currency": "EUR", "callingCode": "376", "flag": "flag-ad", "name": {"common": "Andorra", "cym": "Andorra", "deu": "Andorra", "fra": "Andorre", "hrv": "Andora", "ita": "Andorra", "jpn": "アンドラ", "nld": "Andorra", "por": "Andorra", "rus": "Андорра", "spa": "Andorra", "svk": "Andorra", "fin": "Andorra", "zho": "安道尔", "isr": "אנדורה"}}, "AO": {"currency": "AOA", "callingCode": "244", "flag": "flag-ao", "name": {"common": "Angola", "cym": "Angola", "deu": "Angola", "fra": "Angola", "hrv": "Angola", "ita": "Angola", "jpn": "アンゴラ", "nld": "Angola", "por": "Angola", "rus": "Ангола", "spa": "Angola", "svk": "Angola", "fin": "Angola", "zho": "安哥拉", "isr": "אנגולה"}}, "AI": {"currency": "XCD", "callingCode": "1264", "flag": "flag-ai", "name": {"common": "Anguilla", "deu": "Anguilla", "fra": "Anguilla", "hrv": "Angvila", "ita": "Anguilla", "jpn": "アンギラ", "nld": "Anguilla", "por": "Anguilla", "rus": "Ангилья", "spa": "Anguilla", "svk": "Anguilla", "fin": "Anguilla", "zho": "安圭拉", "isr": "אנגילה"}}, "AQ": {"flag": "flag-aq", "callingCode": "672", "name": {"common": "Antarctica", "cym": "Antarctica", "deu": "Antarktis", "fra": "Antarctique", "hrv": "Antarktika", "ita": "Antartide", "jpn": "南極", "nld": "Antarctica", "por": "Antártida", "rus": "Антарктида", "spa": "Antártida", "svk": "Antarktída", "fin": "Etelämanner", "zho": "南极洲", "isr": "אנטארקטיקה"}}, "AG": {"currency": "XCD", "callingCode": "1268", "flag": "flag-ag", "name": {"common": "Antigua and Barbuda", "cym": "Antigwa a Barbiwda", "deu": "Antigua und Barbuda", "fra": "Antigua-et-Barbuda", "hrv": "Antigva i Barbuda", "ita": "Antigua e Barbuda", "jpn": "アンティグア・バーブーダ", "nld": "Antigua en Barbuda", "por": "Antígua e Barbuda", "rus": "Антигуа и Барбуда", "spa": "Antigua y Barbuda", "svk": "Antigua a Barbuda", "fin": "Antigua ja Barbuda", "zho": "安提瓜和巴布达", "isr": "אנטיגואה וברבודה"}}, "AR": {"currency": "ARS", "callingCode": "54", "flag": "flag-ar", "name": {"common": "Argentina", "cym": "Ariannin", "deu": "Argentinien", "fra": "Argentine", "hrv": "Argentina", "ita": "Argentina", "jpn": "アルゼンチン", "nld": "Argentinië", "por": "Argentina", "rus": "Аргентина", "spa": "Argentina", "svk": "Argentína", "fin": "Argentiina", "zho": "阿根廷", "isr": "ארגנטינה"}}, "AM": {"currency": "AMD", "callingCode": "374", "flag": "flag-am", "name": {"common": "Armenia", "cym": "Armenia", "deu": "Armenien", "fra": "Arménie", "hrv": "Armenija", "ita": "Armenia", "jpn": "アルメニア", "nld": "Armenië", "por": "Arménia", "rus": "Армения", "spa": "Armenia", "svk": "Arménsko", "fin": "Armenia", "zho": "亚美尼亚", "isr": "ארמניה"}}, "AW": {"currency": "AWG", "callingCode": "297", "flag": "flag-aw", "name": {"common": "Aruba", "deu": "Aruba", "fra": "Aruba", "hrv": "Aruba", "ita": "Aruba", "jpn": "アルバ", "nld": "Aruba", "por": "Aruba", "rus": "Аруба", "spa": "Aruba", "svk": "Aruba", "fin": "Aruba", "zho": "阿鲁巴", "isr": "ארובה"}}, "AU": {"currency": "AUD", "callingCode": "61", "flag": "flag-au", "name": {"common": "Australia", "cym": "Awstralia", "deu": "Australien", "Line truncated
@@ -0,0 +1 @@
{"AF":{"currency":["AFN"],"callingCode":["93"],"region":"Asia","subregion":"Southern Asia","flag":"flag-af","name":{"common":"Afghanistan","ces":"Afghánistán","cym":"Affganistan","deu":"Afghanistan","fra":"Afghanistan","hrv":"Afganistan","ita":"Afghanistan","jpn":"アフガニスタン","nld":"Afghanistan","por":"Afeganistão","rus":"Афганистан","slk":"Afganistan","spa":"Afganistán","fin":"Afganistan","est":"Afganistan","zho":"阿富汗","pol":"Afganistan","urd":"افغانستان","kor":"아프가니스탄"}},"AL":{"currency":["ALL"],"callingCode":["355"],"region":"Europe","subregion":"Southern Europe","flag":"flag-al","name":{"common":"Albania","ces":"Albánie","cym":"Albania","deu":"Albanien","fra":"Albanie","hrv":"Albanija","ita":"Albania","jpn":"アルバニア","nld":"Albanië","por":"Albânia","rus":"Албания","slk":"Albánsko","spa":"Albania","fin":"Albania","est":"Albaania","zho":"阿尔巴尼亚","pol":"Albania","urd":"البانیا","kor":"알바니아"}},"DZ":{"currency":["DZD"],"callingCode":["213"],"region":"Africa","subregion":"Northern Africa","flag":"flag-dz","name":{"common":"Algeria","ces":"Alžírsko","cym":"Algeria","deu":"Algerien","fra":"Algérie","hrv":"Alžir","ita":"Algeria","jpn":"アルジェリア","nld":"Algerije","por":"Argélia","rus":"Алжир","slk":"Alžírsko","spa":"Argelia","fin":"Algeria","est":"Alžeeria","zho":"阿尔及利亚","pol":"Algieria","urd":"الجزائر","kor":"알제리"}},"AS":{"currency":["USD"],"callingCode":["1684"],"region":"Oceania","subregion":"Polynesia","flag":"flag-as","name":{"common":"American Samoa","ces":"Americká Samoa","deu":"Amerikanisch-Samoa","fra":"Samoa américaines","hrv":"Američka Samoa","ita":"Samoa Americane","jpn":"アメリカ領サモア","nld":"Amerikaans Samoa","por":"Samoa Americana","rus":"Американское Самоа","slk":"Americká Samoa","spa":"Samoa Americana","fin":"Amerikan Samoa","est":"Ameerika Samoa","zho":"美属萨摩亚","pol":"Samoa Amerykańskie","urd":"امریکی سمووا","kor":"아메리칸사모아"}},"AD":{"currency":["EUR"],"callingCode":["376"],"region":"Europe","subregion":"Southern Europe","flag":"flag-ad","name":{"common":"Andorra","ces":"Andorra","cym":"Andorra","deu":"Andorra","fra":"Andorre","hrv":"Andora","ita":"Andorra","jpn":"アンドラ","nld":"Andorra","por":"Andorra","rus":"Андорра","slk":"Andorra","spa":"Andorra","fin":"Andorra","est":"Andorra","zho":"安道尔","pol":"Andora","urd":"انڈورا","kor":"안도라"}},"AO":{"currency":["AOA"],"callingCode":["244"],"region":"Africa","subregion":"Middle Africa","flag":"flag-ao","name":{"common":"Angola","ces":"Angola","cym":"Angola","deu":"Angola","fra":"Angola","hrv":"Angola","ita":"Angola","jpn":"アンゴラ","nld":"Angola","por":"Angola","rus":"Ангола","slk":"Angola","spa":"Angola","fin":"Angola","est":"Angola","zho":"安哥拉","pol":"Angola","urd":"انگولہ","kor":"앙골라"}},"AI":{"currency":["XCD"],"callingCode":["1264"],"region":"Americas","subregion":"Caribbean","flag":"flag-ai","name":{"common":"Anguilla","ces":"Anguilla","deu":"Anguilla","fra":"Anguilla","hrv":"Angvila","ita":"Anguilla","jpn":"アンギラ","nld":"Anguilla","por":"Anguilla","rus":"Ангилья","slk":"Anguilla","spa":"Anguilla","fin":"Anguilla","est":"Anguilla","zho":"安圭拉","pol":"Anguilla","urd":"اینگویلا","kor":"앵귈라"}},"AQ":{"currency":[],"callingCode":[],"region":"Antarctic","subregion":"","flag":"flag-aq","name":{"common":"Antarctica","ces":"Antarktida","cym":"Yr Antarctig","deu":"Antarktis","fra":"Antarctique","hrv":"Antarktika","ita":"Antartide","jpn":"南極","nld":"Antarctica","por":"Antártida","rus":"Антарктида","slk":"Antarktída","spa":"Antártida","fin":"Etelämanner","est":"Antarktika","zho":"南极洲","pol":"Antarktyka","urd":"انٹارکٹکا","kor":"남극"}},"AG":{"currency":["XCD"],"callingCode":["1268"],"region":"Americas","subregion":"Caribbean","flag":"flag-ag","name":{"common":"Antigua and Barbuda","ces":"Antigua a Barbuda","cym":"Antigwa a Barbiwda","deu":"Antigua und Barbuda","fra":"Antigua-et-Barbuda","hrv":"Antigva i Barbuda","ita":"Antigua e Barbuda","jpn":"アンティグア・バーブーダ","nld":"Antigua en Barbuda","por":"Antígua e Barbuda","rus":"Антигуа и Барбуда","slk":"Antigua a Barbuda","spa":"Antigua y Barbuda","fin":"Antigua ja Barbuda","est":"Antigua ja Barbuda","zho":"安提瓜和巴布达","pol":"Antigua i Barbuda","urd":"اینٹیگوا و باربوڈا","kor":"앤티가 바부다"}},"AR":{"currency":["ARS"],"callingCode":["54"],"region":"Americas","subregion":"South America","flag":"flag-ar","name":{"common":"Argentina","ces":"Argentina","cym":"Ariannin","deu":"Argentinien","fra":"Argentine","hrv":"Argentina","ita":"Argentina","jpn":"アルゼンチン","nld":"Argentinië","por":"Argentina","rus":"Аргентина","slk":"Argentína","spa":"Argentina","fin":"Argentiina","est":"Argentina","zho":"阿根廷","Line truncated
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,14 @@
{
"FIXED_LINE": 0,
"MOBILE": 1,
"FIXED_LINE_OR_MOBILE": 2,
"TOLL_FREE": 3,
"PREMIUM_RATE": 4,
"SHARED_COST": 5,
"VOIP": 6,
"PERSONAL_NUMBER": 7,
"PAGER": 8,
"UAN": 9,
"VOICEMAIL": 10,
"UNKNOWN": -1
}
@@ -0,0 +1,281 @@
{
"activity": 61696,
"airplay": 61697,
"alert-circle": 61698,
"alert-octagon": 61699,
"alert-triangle": 61700,
"align-center": 61701,
"align-justify": 61702,
"align-left": 61703,
"align-right": 61704,
"anchor": 61705,
"aperture": 61706,
"archive": 61707,
"arrow-down": 61708,
"arrow-down-circle": 61709,
"arrow-down-left": 61710,
"arrow-down-right": 61711,
"arrow-left": 61712,
"arrow-left-circle": 61713,
"arrow-right": 61714,
"arrow-right-circle": 61715,
"arrow-up": 61716,
"arrow-up-circle": 61717,
"arrow-up-left": 61718,
"arrow-up-right": 61719,
"at-sign": 61720,
"award": 61721,
"bar-chart": 61722,
"bar-chart-2": 61723,
"battery": 61724,
"battery-charging": 61725,
"bell": 61726,
"bell-off": 61727,
"bluetooth": 61728,
"bold": 61729,
"book": 61730,
"book-open": 61731,
"bookmark": 61732,
"box": 61733,
"briefcase": 61734,
"calendar": 61735,
"camera": 61736,
"camera-off": 61737,
"cast": 61738,
"check": 61739,
"check-circle": 61740,
"check-square": 61741,
"chevron-down": 61742,
"chevron-left": 61743,
"chevron-right": 61744,
"chevron-up": 61745,
"chevrons-down": 61746,
"chevrons-left": 61747,
"chevrons-right": 61748,
"chevrons-up": 61749,
"chrome": 61750,
"circle": 61751,
"clipboard": 61752,
"clock": 61753,
"cloud": 61754,
"cloud-drizzle": 61755,
"cloud-lightning": 61756,
"cloud-off": 61757,
"cloud-rain": 61758,
"cloud-snow": 61759,
"code": 61760,
"codepen": 61761,
"codesandbox": 61972,
"coffee": 61762,
"columns": 61973,
"command": 61763,
"compass": 61764,
"copy": 61765,
"corner-down-left": 61766,
"corner-down-right": 61767,
"corner-left-down": 61768,
"corner-left-up": 61769,
"corner-right-down": 61770,
"corner-right-up": 61771,
"corner-up-left": 61772,
"corner-up-right": 61773,
"cpu": 61774,
"credit-card": 61775,
"crop": 61776,
"crosshair": 61777,
"database": 61778,
"delete": 61779,
"disc": 61780,
"dollar-sign": 61781,
"download": 61782,
"download-cloud": 61783,
"droplet": 61784,
"edit": 61785,
"edit-2": 61786,
"edit-3": 61787,
"external-link": 61788,
"eye": 61789,
"eye-off": 61790,
"facebook": 61791,
"fast-forward": 61792,
"feather": 61793,
"figma": 61970,
"file": 61794,
"file-minus": 61795,
"file-plus": 61796,
"file-text": 61797,
"film": 61798,
"filter": 61799,
"flag": 61800,
"folder": 61801,
"folder-minus": 61802,
"folder-plus": 61803,
"frown": 61804,
"gift": 61805,
"git-branch": 61806,
"git-commit": 61807,
"git-merge": 61808,
"git-pull-request": 61809,
"github": 61810,
"gitlab": 61811,
"globe": 61812,
"grid": 61813,
"hard-drive": 61814,
"hash": 61815,
"headphones": 61816,
"heart": 61817,
"help-circle": 61818,
"hexagon": 61974,
"home": 61819,
"image": 61820,
"inbox": 61821,
"info": 61822,
"instagram": 61823,
"italic": 61824,
"key": 61967,
"layers": 61825,
"layout": 61826,
"life-buoy": 61827,
"link": 61828,
"link-2": 61829,
"linkedin": 61830,
"list": 61831,
"loader": 61832,
"lock": 61833,
"log-in": 61834,
"log-out": 61835,
"mail": 61836,
"map": 61837,
"map-pin": 61838,
"maximize": 61839,
"maximize-2": 61840,
"meh": 61841,
"menu": 61842,
"message-circle": 61843,
"message-square": 61844,
"mic": 61845,
"mic-off": 61846,
"minimize": 61847,
"minimize-2": 61848,
"minus": 61849,
"minus-circle": 61850,
"minus-square": 61851,
"monitor": 61852,
"moon": 61853,
"more-horizontal": 61854,
"more-vertical": 61855,
"mouse-pointer": 61968,
"move": 61856,
"music": 61857,
"navigation": 61858,
"navigation-2": 61859,
"octagon": 61860,
"package": 61861,
"paperclip": 61862,
"pause": 61863,
"pause-circle": 61864,
"pen-tool": 61969,
"percent": 61865,
"phone": 61866,
"phone-call": 61867,
"phone-forwarded": 61868,
"phone-incoming": 61869,
"phone-missed": 61870,
"phone-off": 61871,
"phone-outgoing": 61872,
"pie-chart": 61873,
"play": 61874,
"play-circle": 61875,
"plus": 61876,
"plus-circle": 61877,
"plus-square": 61878,
"pocket": 61879,
"power": 61880,
"printer": 61881,
"radio": 61882,
"refresh-ccw": 61883,
"refresh-cw": 61884,
"repeat": 61885,
"rewind": 61886,
"rotate-ccw": 61887,
"rotate-cw": 61888,
"rss": 61889,
"save": 61890,
"scissors": 61891,
"search": 61892,
"send": 61893,
"server": 61894,
"settings": 61895,
"share": 61896,
"share-2": 61897,
"shield": 61898,
"shield-off": 61899,
"shopping-bag": 61900,
"shopping-cart": 61901,
"shuffle": 61902,
"sidebar": 61903,
"skip-back": 61904,
"skip-forward": 61905,
"slack": 61906,
"slash": 61907,
"sliders": 61908,
"smartphone": 61909,
"smile": 61910,
"speaker": 61911,
"square": 61912,
"star": 61913,
"stop-circle": 61914,
"sun": 61915,
"sunrise": 61916,
"sunset": 61917,
"tablet": 61975,
"tag": 61919,
"target": 61920,
"terminal": 61921,
"thermometer": 61922,
"thumbs-down": 61923,
"thumbs-up": 61924,
"toggle-left": 61925,
"toggle-right": 61926,
"trash": 61927,
"trash-2": 61928,
"trello": 61929,
"trending-down": 61930,
"trending-up": 61931,
"triangle": 61932,
"truck": 61933,
"tv": 61934,
"twitter": 61935,
"type": 61936,
"umbrella": 61937,
"underline": 61938,
"unlock": 61939,
"upload": 61940,
"upload-cloud": 61941,
"user": 61942,
"user-check": 61943,
"user-minus": 61944,
"user-plus": 61945,
"user-x": 61946,
"users": 61947,
"video": 61948,
"video-off": 61949,
"voicemail": 61950,
"volume": 61951,
"volume-1": 61952,
"volume-2": 61953,
"volume-x": 61954,
"watch": 61955,
"wifi": 61956,
"wifi-off": 61957,
"wind": 61958,
"x": 61959,
"x-circle": 61960,
"x-octagon": 61971,
"x-square": 61961,
"youtube": 61962,
"zap": 61963,
"zap-off": 61964,
"zoom-in": 61965,
"zoom-out": 61966
}