Upload folder using huggingface_hub
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .editorconfig +7 -0
- .git-blame-ignore-revs +9 -0
- .gitattributes +63 -35
- .github/FUNDING.yml +12 -0
- .github/ISSUE_TEMPLATE/bug_report.md +33 -0
- .github/ISSUE_TEMPLATE/feature_request.md +20 -0
- .github/no-response.yml +13 -0
- .github/pull_request_template.md +39 -0
- .github/workflows/android-build.yml +114 -0
- .github/workflows/android-debug-artifact-ondemand.yml +117 -0
- .github/workflows/android-debug-artifact-release.yml +69 -0
- .github/workflows/android-feature.yml +89 -0
- .github/workflows/android-main.yml +163 -0
- .gitignore +333 -0
- .tx/config +23 -0
- CODE_OF_CONDUCT.md +134 -0
- CONTRIBUTING.md +56 -0
- LICENSE.txt +674 -0
- README.md +103 -0
- SECURITY.md +20 -0
- amaze.license.spotless.txt +20 -0
- app/.gitignore +2 -0
- app/build.gradle +342 -0
- app/proguard.cfg +130 -0
- app/src/androidTest/java/com/amaze/filemanager/asynchronous/services/ftp/FtpServiceEspressoTest.kt +319 -0
- app/src/androidTest/java/com/amaze/filemanager/asynchronous/services/ftp/FtpServiceStaticMethodsTest.kt +67 -0
- app/src/androidTest/java/com/amaze/filemanager/database/UtilsHandlerTest.java +142 -0
- app/src/androidTest/java/com/amaze/filemanager/filesystem/HybridFileParcelableTest.java +221 -0
- app/src/androidTest/java/com/amaze/filemanager/filesystem/files/CryptUtilTest.java +60 -0
- app/src/androidTest/java/com/amaze/filemanager/filesystem/files/GenericCopyUtilEspressoTest.java +126 -0
- app/src/androidTest/java/com/amaze/filemanager/ssh/SshClientUtilTest.java +82 -0
- app/src/androidTest/java/com/amaze/filemanager/test/DummyFileGenerator.java +78 -0
- app/src/androidTest/java/com/amaze/filemanager/test/StoragePermissionHelper.kt +73 -0
- app/src/androidTest/java/com/amaze/filemanager/ui/activities/TextEditorActivityEspressoTest.java +88 -0
- app/src/androidTest/java/com/amaze/filemanager/ui/fragments/BackupPrefsFragmentTest.kt +243 -0
- app/src/androidTest/java/com/amaze/filemanager/ui/fragments/TabFragmentTest.kt +134 -0
- app/src/androidTest/java/com/amaze/filemanager/utils/CryptUtilEspressoTest.kt +151 -0
- app/src/androidTest/java/com/amaze/filemanager/utils/security/SecretKeygenEspressoTest.kt +57 -0
- app/src/androidTest/resources/amaze_backup.json +33 -0
- app/src/debug/res/values/strings.xml +4 -0
- app/src/debug/res/xml-v25/shortcuts.xml +52 -0
- app/src/fdroid/java/com/amaze/filemanager/asynchronous/asynctasks/CloudLoaderAsyncTask.java +71 -0
- app/src/fdroid/java/com/amaze/filemanager/filesystem/compressed/extractcontents/helpers/RarExtractor.kt +37 -0
- app/src/fdroid/java/com/amaze/filemanager/filesystem/compressed/showcontents/helpers/RarDecompressor.kt +36 -0
- app/src/fdroid/java/com/amaze/filemanager/utils/Billing.java +36 -0
- app/src/fdroid/java/com/amaze/filemanager/utils/PackageInstallValidation.kt +43 -0
- app/src/fdroid/java/com/cloudrail/si/CloudRail.java +29 -0
- app/src/fdroid/java/com/cloudrail/si/interfaces/CloudStorage.java +85 -0
- app/src/fdroid/java/com/cloudrail/si/services/Box.java +31 -0
- app/src/fdroid/java/com/cloudrail/si/services/Dropbox.java +32 -0
.editorconfig
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
root = true
|
| 2 |
+
|
| 3 |
+
[*.{kt,kts}]
|
| 4 |
+
ktlint_standard_property-naming = disabled
|
| 5 |
+
ktlint_standard_value-argument-comment = disabled
|
| 6 |
+
ktlint_standard_kdoc-wrapping = disabled
|
| 7 |
+
ktlint_standard_no-consecutive-comments = disabled
|
.git-blame-ignore-revs
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Run this command to always ignore specific commits in `git blame`
|
| 2 |
+
# git config blame.ignoreRevsFile .git-blame-ignore-revs
|
| 3 |
+
|
| 4 |
+
# format all java files
|
| 5 |
+
94dae8259f075e4099cd92c258386dc39bfc30c1
|
| 6 |
+
|
| 7 |
+
# format all kotlin files
|
| 8 |
+
45178b3d348cd1fe768bcfc086b04b15ea5d69ea
|
| 9 |
+
|
.gitattributes
CHANGED
|
@@ -1,35 +1,63 @@
|
|
| 1 |
-
|
| 2 |
-
*
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
*.
|
| 6 |
-
*.
|
| 7 |
-
*.
|
| 8 |
-
*.
|
| 9 |
-
*.
|
| 10 |
-
*.
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
*.
|
| 14 |
-
*.
|
| 15 |
-
*.
|
| 16 |
-
*.
|
| 17 |
-
*.
|
| 18 |
-
*.
|
| 19 |
-
*.
|
| 20 |
-
*.
|
| 21 |
-
*.
|
| 22 |
-
*.
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Auto detect text files and perform LF normalization
|
| 2 |
+
* text=auto
|
| 3 |
+
|
| 4 |
+
# Custom for Visual Studio
|
| 5 |
+
*.cs diff=csharp
|
| 6 |
+
*.sln merge=union
|
| 7 |
+
*.csproj merge=union
|
| 8 |
+
*.vbproj merge=union
|
| 9 |
+
*.fsproj merge=union
|
| 10 |
+
*.dbproj merge=union
|
| 11 |
+
|
| 12 |
+
# Standard to msysgit
|
| 13 |
+
*.doc diff=astextplain
|
| 14 |
+
*.DOC diff=astextplain
|
| 15 |
+
*.docx diff=astextplain
|
| 16 |
+
*.DOCX diff=astextplain
|
| 17 |
+
*.dot diff=astextplain
|
| 18 |
+
*.DOT diff=astextplain
|
| 19 |
+
*.pdf diff=astextplain
|
| 20 |
+
*.PDF diff=astextplain
|
| 21 |
+
*.rtf diff=astextplain
|
| 22 |
+
*.RTF diff=astextplain
|
| 23 |
+
app/src/test/resources/compress.7z filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
app/src/test/resources/compress.tar.xz filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
app/src/test/resources/empty.tar filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
app/src/test/resources/empty.zip filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
app/src/test/resources/test-archive-encrypted-list.7z filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
app/src/test/resources/test-archive-encrypted-list.rar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
app/src/test/resources/test-archive-encrypted.7z filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
app/src/test/resources/test-archive-encrypted.rar filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
app/src/test/resources/test-archive-encrypted.zip filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
app/src/test/resources/test-archive-no-timestamp.7z filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
app/src/test/resources/test-archive-sizes.rar filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
app/src/test/resources/test-archive.7z filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
app/src/test/resources/test-archive.rar filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
app/src/test/resources/test-archive.tar filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
app/src/test/resources/test-archive.tar.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
app/src/test/resources/test-archive.tar.gz filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
app/src/test/resources/test-archive.tar.lzma filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
app/src/test/resources/test-archive.tar.xz filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
app/src/test/resources/test-archive.tgz filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
app/src/test/resources/test-archive.zip filter=lfs diff=lfs merge=lfs -text
|
| 43 |
+
app/src/test/resources/test-direct-paths.7z filter=lfs diff=lfs merge=lfs -text
|
| 44 |
+
app/src/test/resources/test-multipart-archive-v4.part1.rar filter=lfs diff=lfs merge=lfs -text
|
| 45 |
+
app/src/test/resources/test-multipart-archive-v4.part2.rar filter=lfs diff=lfs merge=lfs -text
|
| 46 |
+
app/src/test/resources/test-multipart-archive-v4.part3.rar filter=lfs diff=lfs merge=lfs -text
|
| 47 |
+
app/src/test/resources/test-multipart-archive-v5.part1.rar filter=lfs diff=lfs merge=lfs -text
|
| 48 |
+
app/src/test/resources/test-multipart-archive-v5.part2.rar filter=lfs diff=lfs merge=lfs -text
|
| 49 |
+
app/src/test/resources/test-multipart-archive-v5.part3.rar filter=lfs diff=lfs merge=lfs -text
|
| 50 |
+
app/src/test/resources/test-slashprefix.zip filter=lfs diff=lfs merge=lfs -text
|
| 51 |
+
app/src/test/resources/test.txt.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 52 |
+
app/src/test/resources/test.txt.gz filter=lfs diff=lfs merge=lfs -text
|
| 53 |
+
app/src/test/resources/test.txt.xz filter=lfs diff=lfs merge=lfs -text
|
| 54 |
+
app/src/test/resources/zip-slip-win.zip filter=lfs diff=lfs merge=lfs -text
|
| 55 |
+
app/src/test/resources/zip-slip.zip filter=lfs diff=lfs merge=lfs -text
|
| 56 |
+
fastlane/metadata/android/en-US/images/phoneScreenshots/1.png filter=lfs diff=lfs merge=lfs -text
|
| 57 |
+
fastlane/metadata/android/en-US/images/phoneScreenshots/2.png filter=lfs diff=lfs merge=lfs -text
|
| 58 |
+
fastlane/metadata/android/en-US/images/phoneScreenshots/3.png filter=lfs diff=lfs merge=lfs -text
|
| 59 |
+
fastlane/metadata/android/en-US/images/phoneScreenshots/4.png filter=lfs diff=lfs merge=lfs -text
|
| 60 |
+
fastlane/metadata/android/en-US/images/phoneScreenshots/5.png filter=lfs diff=lfs merge=lfs -text
|
| 61 |
+
fastlane/metadata/android/en-US/images/phoneScreenshots/6.png filter=lfs diff=lfs merge=lfs -text
|
| 62 |
+
fastlane/metadata/android/en-US/images/phoneScreenshots/7.png filter=lfs diff=lfs merge=lfs -text
|
| 63 |
+
fastlane/metadata/android/en-US/images/phoneScreenshots/8.png filter=lfs diff=lfs merge=lfs -text
|
.github/FUNDING.yml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# These are supported funding model platforms
|
| 2 |
+
|
| 3 |
+
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
| 4 |
+
patreon: # Replace with a single Patreon username
|
| 5 |
+
open_collective: TeamAmaze
|
| 6 |
+
ko_fi: # Replace with a single Ko-fi username
|
| 7 |
+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
| 8 |
+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
| 9 |
+
liberapay: Team-Amaze
|
| 10 |
+
issuehunt: # Replace with a single IssueHunt username
|
| 11 |
+
otechie: # Replace with a single Otechie username
|
| 12 |
+
custom: ['https://www.paypal.me/vishalnehra', 'https://github.com/TeamAmaze/AmazeFileManager#support']
|
.github/ISSUE_TEMPLATE/bug_report.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
name: Bug report
|
| 3 |
+
about: Create a report to help us improve
|
| 4 |
+
title: ''
|
| 5 |
+
labels: bug
|
| 6 |
+
assignees: ''
|
| 7 |
+
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
**Describe the bug**
|
| 11 |
+
A clear and concise description of what the bug is.
|
| 12 |
+
|
| 13 |
+
**To Reproduce**
|
| 14 |
+
Steps to reproduce the behavior:
|
| 15 |
+
1. Go to '...'
|
| 16 |
+
2. Click on '....'
|
| 17 |
+
3. Scroll down to '....'
|
| 18 |
+
4. See error
|
| 19 |
+
|
| 20 |
+
**Expected behavior**
|
| 21 |
+
A clear and concise description of what you expected to happen.
|
| 22 |
+
|
| 23 |
+
**Screenshots**
|
| 24 |
+
If applicable, add screenshots to help explain your problem.
|
| 25 |
+
|
| 26 |
+
**Smartphone (please complete the following information):**
|
| 27 |
+
- Device: [e.g. Google Pixel 2]
|
| 28 |
+
- OS: [e.g. Android 9]
|
| 29 |
+
- Rooted: [e.g. No]
|
| 30 |
+
- Version: [e.g. 3.3.4]
|
| 31 |
+
|
| 32 |
+
**Additional context**
|
| 33 |
+
Add any other context about the problem here.
|
.github/ISSUE_TEMPLATE/feature_request.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
name: Feature request
|
| 3 |
+
about: Suggest an idea for this project
|
| 4 |
+
title: ''
|
| 5 |
+
labels: enhancement
|
| 6 |
+
assignees: ''
|
| 7 |
+
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
**Is your feature request related to a problem? Please describe.**
|
| 11 |
+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
| 12 |
+
|
| 13 |
+
**Describe the solution you'd like**
|
| 14 |
+
A clear and concise description of what you want to happen.
|
| 15 |
+
|
| 16 |
+
**Describe alternatives you've considered**
|
| 17 |
+
A clear and concise description of any alternative solutions or features you've considered.
|
| 18 |
+
|
| 19 |
+
**Additional context**
|
| 20 |
+
Add any other context or screenshots about the feature request here.
|
.github/no-response.yml
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Configuration for probot-no-response - https://github.com/probot/no-response
|
| 2 |
+
|
| 3 |
+
# Number of days of inactivity before an Issue is closed for lack of response
|
| 4 |
+
daysUntilClose: 14
|
| 5 |
+
# Label requiring a response
|
| 6 |
+
responseRequiredLabel: Needs-OPResponse
|
| 7 |
+
# Comment to post when closing an Issue for lack of response. Set to `false` to disable
|
| 8 |
+
closeComment: >
|
| 9 |
+
This issue has been automatically closed because there has been no response
|
| 10 |
+
to our request for more information from the original author. With only the
|
| 11 |
+
information that is currently in the issue, we don't have enough information
|
| 12 |
+
to take action. Please reach out if you have or find the answers we need so
|
| 13 |
+
that we can investigate further.
|
.github/pull_request_template.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!--
|
| 2 |
+
Read this first:
|
| 3 |
+
To open a pull request read this file,
|
| 4 |
+
uncomment the corresponding lines and
|
| 5 |
+
complete them.
|
| 6 |
+
-->
|
| 7 |
+
|
| 8 |
+
## Description
|
| 9 |
+
|
| 10 |
+
#### Issue tracker
|
| 11 |
+
<!-- Fixes will automatically close the related issue -->
|
| 12 |
+
<!-- Fixes # -->
|
| 13 |
+
<!-- Addresses won't automatically close the related issue -->
|
| 14 |
+
<!-- Addresses # -->
|
| 15 |
+
|
| 16 |
+
#### Automatic tests
|
| 17 |
+
<!-- remember to do manual testing when making UI changes! -->
|
| 18 |
+
- [ ] Added test cases
|
| 19 |
+
|
| 20 |
+
#### Manual tests
|
| 21 |
+
- [ ] Done
|
| 22 |
+
|
| 23 |
+
<!-- If yes, -->
|
| 24 |
+
<!--
|
| 25 |
+
- Device:
|
| 26 |
+
- OS:
|
| 27 |
+
-->
|
| 28 |
+
|
| 29 |
+
#### Build tasks success
|
| 30 |
+
<!-- run these! -->
|
| 31 |
+
Successfully running following tasks on local:
|
| 32 |
+
- [ ] `./gradlew assembledebug`
|
| 33 |
+
- [ ] `./gradlew spotlessCheck`
|
| 34 |
+
|
| 35 |
+
<!-- If there are related PRs please add them here -->
|
| 36 |
+
<!--
|
| 37 |
+
#### Related PR
|
| 38 |
+
Related to PR #
|
| 39 |
+
-->
|
.github/workflows/android-build.yml
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: Android Build CI
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
push:
|
| 5 |
+
branches:
|
| 6 |
+
- '*'
|
| 7 |
+
- '!master'
|
| 8 |
+
- '!release/*'
|
| 9 |
+
concurrency:
|
| 10 |
+
group: build-${{ github.event.pull_request.number || github.ref }}
|
| 11 |
+
cancel-in-progress: true
|
| 12 |
+
|
| 13 |
+
jobs:
|
| 14 |
+
check_spotless:
|
| 15 |
+
name: Check spotless
|
| 16 |
+
runs-on: ubuntu-latest
|
| 17 |
+
steps:
|
| 18 |
+
- uses: actions/checkout@v4
|
| 19 |
+
- name: Set up JDK 17
|
| 20 |
+
uses: actions/setup-java@v4
|
| 21 |
+
with:
|
| 22 |
+
distribution: "temurin"
|
| 23 |
+
java-version: 17
|
| 24 |
+
- name: Set up NDK
|
| 25 |
+
uses: nttld/setup-ndk@afb4c9964b521afb97c864b7d40b11e6911bd410
|
| 26 |
+
with:
|
| 27 |
+
ndk-version: r28c
|
| 28 |
+
link-to-sdk: true
|
| 29 |
+
local-cache: true
|
| 30 |
+
- name: Install Rust
|
| 31 |
+
uses: dtolnay/rust-toolchain@stable
|
| 32 |
+
with:
|
| 33 |
+
toolchain: stable
|
| 34 |
+
- name: Cache Rust dependencies
|
| 35 |
+
uses: actions/cache@v4
|
| 36 |
+
with:
|
| 37 |
+
path: |
|
| 38 |
+
~/.cargo/bin/
|
| 39 |
+
~/.cargo/registry/index/
|
| 40 |
+
~/.cargo/registry/cache/
|
| 41 |
+
~/.cargo/git/db/
|
| 42 |
+
file_operations/target/
|
| 43 |
+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
| 44 |
+
restore-keys: |
|
| 45 |
+
${{ runner.os }}-cargo-
|
| 46 |
+
- name: Setup Rust for Android
|
| 47 |
+
run: |
|
| 48 |
+
cd file_operations
|
| 49 |
+
chmod +x setup_rust_android.sh
|
| 50 |
+
./setup_rust_android.sh
|
| 51 |
+
- name: Verify Rust setup
|
| 52 |
+
run: |
|
| 53 |
+
cd file_operations
|
| 54 |
+
echo "🔍 Verifying Rust Android targets..."
|
| 55 |
+
rustup target list --installed | grep android || echo "No Android targets found"
|
| 56 |
+
echo "🔍 Verifying cargo configuration..."
|
| 57 |
+
if [ -f .cargo/config.toml ]; then
|
| 58 |
+
echo "✅ .cargo/config.toml exists"
|
| 59 |
+
else
|
| 60 |
+
echo "❌ .cargo/config.toml missing"
|
| 61 |
+
exit 1
|
| 62 |
+
fi
|
| 63 |
+
- name: Check formatting using spotless
|
| 64 |
+
uses: gradle/actions/setup-gradle@v3
|
| 65 |
+
with:
|
| 66 |
+
arguments: spotlessCheck --stacktrace
|
| 67 |
+
|
| 68 |
+
build:
|
| 69 |
+
name: Build debug
|
| 70 |
+
runs-on: ubuntu-latest
|
| 71 |
+
steps:
|
| 72 |
+
- uses: actions/checkout@v4
|
| 73 |
+
- name: Set up JDK 17
|
| 74 |
+
uses: actions/setup-java@v4
|
| 75 |
+
with:
|
| 76 |
+
distribution: "temurin"
|
| 77 |
+
java-version: 17
|
| 78 |
+
- name: Install Rust
|
| 79 |
+
uses: dtolnay/rust-toolchain@stable
|
| 80 |
+
with:
|
| 81 |
+
toolchain: stable
|
| 82 |
+
- name: Cache Rust dependencies
|
| 83 |
+
uses: actions/cache@v4
|
| 84 |
+
with:
|
| 85 |
+
path: |
|
| 86 |
+
~/.cargo/bin/
|
| 87 |
+
~/.cargo/registry/index/
|
| 88 |
+
~/.cargo/registry/cache/
|
| 89 |
+
~/.cargo/git/db/
|
| 90 |
+
file_operations/target/
|
| 91 |
+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
| 92 |
+
restore-keys: |
|
| 93 |
+
${{ runner.os }}-cargo-
|
| 94 |
+
- name: Setup Rust for Android
|
| 95 |
+
run: |
|
| 96 |
+
cd file_operations
|
| 97 |
+
chmod +x setup_rust_android.sh
|
| 98 |
+
./setup_rust_android.sh
|
| 99 |
+
- name: Verify Rust setup
|
| 100 |
+
run: |
|
| 101 |
+
cd file_operations
|
| 102 |
+
echo "🔍 Verifying Rust Android targets..."
|
| 103 |
+
rustup target list --installed | grep android || echo "No Android targets found"
|
| 104 |
+
echo "🔍 Verifying cargo configuration..."
|
| 105 |
+
if [ -f .cargo/config.toml ]; then
|
| 106 |
+
echo "✅ .cargo/config.toml exists"
|
| 107 |
+
else
|
| 108 |
+
echo "❌ .cargo/config.toml missing"
|
| 109 |
+
exit 1
|
| 110 |
+
fi
|
| 111 |
+
- name: Build with Gradle
|
| 112 |
+
uses: gradle/actions/setup-gradle@v3
|
| 113 |
+
with:
|
| 114 |
+
arguments: assembledebug --stacktrace
|
.github/workflows/android-debug-artifact-ondemand.yml
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: Android Debug artifact ondemand
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
pull_request:
|
| 5 |
+
types: [opened]
|
| 6 |
+
issue_comment:
|
| 7 |
+
types: [created]
|
| 8 |
+
|
| 9 |
+
jobs:
|
| 10 |
+
apk:
|
| 11 |
+
runs-on: ubuntu-latest
|
| 12 |
+
if: github.event.comment.body == 'Build test apk' && (github.actor == 'VishalNehra' || github.actor == 'TranceLove' || github.actor == 'EmmanuelMess' || github.actor == 'VishnuSanal')
|
| 13 |
+
steps:
|
| 14 |
+
- name: Acknowledge the request with thumbs up reaction
|
| 15 |
+
uses: peter-evans/create-or-update-comment@v2
|
| 16 |
+
with:
|
| 17 |
+
comment-id: ${{ github.event.comment.id }}
|
| 18 |
+
reactions: '+1'
|
| 19 |
+
- name: Github API Request
|
| 20 |
+
id: request
|
| 21 |
+
uses: octokit/request-action@v2.0.2
|
| 22 |
+
with:
|
| 23 |
+
route: ${{ github.event.issue.pull_request.url }}
|
| 24 |
+
env:
|
| 25 |
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
| 26 |
+
- name: Get PR informations
|
| 27 |
+
id: pr_data
|
| 28 |
+
run: |
|
| 29 |
+
echo "::set-output name=repo_name::${{ fromJson(steps.request.outputs.data).head.repo.full_name }}"
|
| 30 |
+
echo "::set-output name=repo_clone_url::${{ fromJson(steps.request.outputs.data).head.repo.clone_url }}"
|
| 31 |
+
echo "::set-output name=repo_ssh_url::${{ fromJson(steps.request.outputs.data).head.repo.ssh_url }}"
|
| 32 |
+
- name: Checkout PR Branch
|
| 33 |
+
uses: actions/checkout@v4
|
| 34 |
+
with:
|
| 35 |
+
token: ${{ secrets.GITHUB_TOKEN }}
|
| 36 |
+
repository: ${{fromJson(steps.request.outputs.data).head.repo.full_name}}
|
| 37 |
+
ref: ${{fromJson(steps.request.outputs.data).head.ref}}
|
| 38 |
+
- name: Set up JDK 17
|
| 39 |
+
uses: actions/setup-java@v4
|
| 40 |
+
with:
|
| 41 |
+
distribution: "temurin"
|
| 42 |
+
java-version: 17
|
| 43 |
+
- name: Set up NDK
|
| 44 |
+
uses: nttld/setup-ndk@afb4c9964b521afb97c864b7d40b11e6911bd410
|
| 45 |
+
with:
|
| 46 |
+
ndk-version: r28c
|
| 47 |
+
link-to-sdk: true
|
| 48 |
+
local-cache: true
|
| 49 |
+
- name: Install Rust
|
| 50 |
+
uses: dtolnay/rust-toolchain@stable
|
| 51 |
+
with:
|
| 52 |
+
toolchain: stable
|
| 53 |
+
- name: Cache Rust dependencies
|
| 54 |
+
uses: actions/cache@v4
|
| 55 |
+
with:
|
| 56 |
+
path: |
|
| 57 |
+
~/.cargo/bin/
|
| 58 |
+
~/.cargo/registry/index/
|
| 59 |
+
~/.cargo/registry/cache/
|
| 60 |
+
~/.cargo/git/db/
|
| 61 |
+
file_operations/target/
|
| 62 |
+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
| 63 |
+
restore-keys: |
|
| 64 |
+
${{ runner.os }}-cargo-
|
| 65 |
+
- name: Setup Rust for Android
|
| 66 |
+
run: |
|
| 67 |
+
cd file_operations
|
| 68 |
+
chmod +x setup_rust_android.sh
|
| 69 |
+
./setup_rust_android.sh
|
| 70 |
+
- name: Verify Rust setup
|
| 71 |
+
run: |
|
| 72 |
+
cd file_operations
|
| 73 |
+
echo "🔍 Verifying Rust Android targets..."
|
| 74 |
+
rustup target list --installed | grep android || echo "No Android targets found"
|
| 75 |
+
echo "🔍 Verifying cargo configuration..."
|
| 76 |
+
if [ -f .cargo/config.toml ]; then
|
| 77 |
+
echo "✅ .cargo/config.toml exists"
|
| 78 |
+
else
|
| 79 |
+
echo "❌ .cargo/config.toml missing"
|
| 80 |
+
exit 1
|
| 81 |
+
fi
|
| 82 |
+
- name: Build with Gradle
|
| 83 |
+
uses: gradle/actions/setup-gradle@v3
|
| 84 |
+
with:
|
| 85 |
+
arguments: assembleDebug --stacktrace
|
| 86 |
+
- name: Upload fdroid artifact
|
| 87 |
+
uses: actions/upload-artifact@v4
|
| 88 |
+
id: artifact-upload-fdroid
|
| 89 |
+
with:
|
| 90 |
+
name: Amaze-Fdroid-debug
|
| 91 |
+
path: app/build/outputs/apk/fdroid/debug/app-fdroid-debug.apk
|
| 92 |
+
if-no-files-found: error
|
| 93 |
+
- name: Upload play artifact
|
| 94 |
+
uses: actions/upload-artifact@v4
|
| 95 |
+
id: artifact-upload-play
|
| 96 |
+
with:
|
| 97 |
+
name: Amaze-Play-debug
|
| 98 |
+
path: app/build/outputs/apk/play/debug/app-play-debug.apk
|
| 99 |
+
if-no-files-found: error
|
| 100 |
+
- name: Get the PR number
|
| 101 |
+
id: find-pr-id
|
| 102 |
+
run: |
|
| 103 |
+
PR_NUMBER=$(jq --raw-output .issue.number "$GITHUB_EVENT_PATH")
|
| 104 |
+
|
| 105 |
+
echo "PR_Number: $PR_NUMBER"
|
| 106 |
+
echo "PR_NUMBER=$PR_NUMBER" >> "$GITHUB_OUTPUT"
|
| 107 |
+
- name: Notify the user with a comment once the APK is uploaded
|
| 108 |
+
uses: peter-evans/create-or-update-comment@v2
|
| 109 |
+
with:
|
| 110 |
+
issue-number: ${{ steps.find-pr-id.outputs.PR_NUMBER }}
|
| 111 |
+
body: |
|
| 112 |
+
Requested APKs have been built. Please find them from the links below.
|
| 113 |
+
|
| 114 |
+
FDroid Flavour: ${{ steps.artifact-upload-fdroid.outputs.artifact-url }}
|
| 115 |
+
Play Flavour: ${{ steps.artifact-upload-play.outputs.artifact-url }}
|
| 116 |
+
|
| 117 |
+
PS: you should be logged in to access the artifacts.
|
.github/workflows/android-debug-artifact-release.yml
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: Android Release CI
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
release:
|
| 5 |
+
types: [published, created]
|
| 6 |
+
|
| 7 |
+
jobs:
|
| 8 |
+
apk:
|
| 9 |
+
runs-on: ubuntu-latest
|
| 10 |
+
steps:
|
| 11 |
+
- uses: actions/checkout@v4
|
| 12 |
+
- name: Set up JDK 17
|
| 13 |
+
uses: actions/setup-java@v4
|
| 14 |
+
with:
|
| 15 |
+
distribution: "temurin"
|
| 16 |
+
java-version: 17
|
| 17 |
+
- name: Set up NDK
|
| 18 |
+
uses: nttld/setup-ndk@afb4c9964b521afb97c864b7d40b11e6911bd410
|
| 19 |
+
with:
|
| 20 |
+
ndk-version: r28c
|
| 21 |
+
link-to-sdk: true
|
| 22 |
+
local-cache: true
|
| 23 |
+
- name: Install Rust
|
| 24 |
+
uses: dtolnay/rust-toolchain@stable
|
| 25 |
+
with:
|
| 26 |
+
toolchain: stable
|
| 27 |
+
- name: Cache Rust dependencies
|
| 28 |
+
uses: actions/cache@v4
|
| 29 |
+
with:
|
| 30 |
+
path: |
|
| 31 |
+
~/.cargo/bin/
|
| 32 |
+
~/.cargo/registry/index/
|
| 33 |
+
~/.cargo/registry/cache/
|
| 34 |
+
~/.cargo/git/db/
|
| 35 |
+
file_operations/target/
|
| 36 |
+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
| 37 |
+
restore-keys: |
|
| 38 |
+
${{ runner.os }}-cargo-
|
| 39 |
+
- name: Setup Rust for Android
|
| 40 |
+
run: |
|
| 41 |
+
cd file_operations
|
| 42 |
+
chmod +x setup_rust_android.sh
|
| 43 |
+
./setup_rust_android.sh
|
| 44 |
+
- name: Verify Rust setup
|
| 45 |
+
run: |
|
| 46 |
+
cd file_operations
|
| 47 |
+
echo "🔍 Verifying Rust Android targets..."
|
| 48 |
+
rustup target list --installed | grep android || echo "No Android targets found"
|
| 49 |
+
echo "🔍 Verifying cargo configuration..."
|
| 50 |
+
if [ -f .cargo/config.toml ]; then
|
| 51 |
+
echo "✅ .cargo/config.toml exists"
|
| 52 |
+
else
|
| 53 |
+
echo "❌ .cargo/config.toml missing"
|
| 54 |
+
exit 1
|
| 55 |
+
fi
|
| 56 |
+
- name: Build with Gradle
|
| 57 |
+
uses: gradle/actions/setup-gradle@v3
|
| 58 |
+
with:
|
| 59 |
+
arguments: assembleDebug
|
| 60 |
+
- name: Upload fdroid artifact
|
| 61 |
+
uses: actions/upload-artifact@v4
|
| 62 |
+
with:
|
| 63 |
+
name: Amaze-Fdroid-debug
|
| 64 |
+
path: app/build/outputs/apk/fdroid/debug/app-fdroid-debug.apk
|
| 65 |
+
- name: Upload play artifact
|
| 66 |
+
uses: actions/upload-artifact@v4
|
| 67 |
+
with:
|
| 68 |
+
name: Amaze-Play-debug
|
| 69 |
+
path: app/build/outputs/apk/play/debug/app-play-debug.apk
|
.github/workflows/android-feature.yml
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: Android Feature CI
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
pull_request:
|
| 5 |
+
branches:
|
| 6 |
+
- 'master'
|
| 7 |
+
- 'release/*'
|
| 8 |
+
- 'hotfix/*'
|
| 9 |
+
|
| 10 |
+
concurrency:
|
| 11 |
+
group: build-${{ github.event.pull_request.number || github.ref }}
|
| 12 |
+
cancel-in-progress: true
|
| 13 |
+
|
| 14 |
+
jobs:
|
| 15 |
+
check_spotless:
|
| 16 |
+
name: Check spotless
|
| 17 |
+
runs-on: ubuntu-latest
|
| 18 |
+
steps:
|
| 19 |
+
- uses: actions/checkout@v4
|
| 20 |
+
- name: Set up JDK 17
|
| 21 |
+
uses: actions/setup-java@v4
|
| 22 |
+
with:
|
| 23 |
+
distribution: "temurin"
|
| 24 |
+
java-version: 17
|
| 25 |
+
- name: Set up NDK
|
| 26 |
+
id: setup-ndk
|
| 27 |
+
uses: nttld/setup-ndk@afb4c9964b521afb97c864b7d40b11e6911bd410
|
| 28 |
+
with:
|
| 29 |
+
ndk-version: r28c
|
| 30 |
+
link-to-sdk: true
|
| 31 |
+
local-cache: true
|
| 32 |
+
- name: Check formatting using spotless
|
| 33 |
+
uses: gradle/actions/setup-gradle@v3
|
| 34 |
+
with:
|
| 35 |
+
arguments: spotlessCheck --stacktrace
|
| 36 |
+
env:
|
| 37 |
+
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
|
| 38 |
+
|
| 39 |
+
build:
|
| 40 |
+
name: Build debug and run Jacoco tests
|
| 41 |
+
runs-on: ubuntu-latest
|
| 42 |
+
steps:
|
| 43 |
+
- uses: actions/checkout@v4
|
| 44 |
+
- name: Set up JDK 17
|
| 45 |
+
uses: actions/setup-java@v4
|
| 46 |
+
with:
|
| 47 |
+
distribution: "temurin"
|
| 48 |
+
java-version: 17
|
| 49 |
+
- name: Install Rust
|
| 50 |
+
uses: dtolnay/rust-toolchain@stable
|
| 51 |
+
with:
|
| 52 |
+
toolchain: stable
|
| 53 |
+
- name: Cache Rust dependencies
|
| 54 |
+
uses: actions/cache@v4
|
| 55 |
+
with:
|
| 56 |
+
path: |
|
| 57 |
+
~/.cargo/bin/
|
| 58 |
+
~/.cargo/registry/index/
|
| 59 |
+
~/.cargo/registry/cache/
|
| 60 |
+
~/.cargo/git/db/
|
| 61 |
+
file_operations/target/
|
| 62 |
+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
| 63 |
+
restore-keys: |
|
| 64 |
+
${{ runner.os }}-cargo-
|
| 65 |
+
- name: Setup Rust for Android
|
| 66 |
+
run: |
|
| 67 |
+
cd file_operations
|
| 68 |
+
chmod +x setup_rust_android.sh
|
| 69 |
+
./setup_rust_android.sh
|
| 70 |
+
- name: Verify Rust setup
|
| 71 |
+
run: |
|
| 72 |
+
cd file_operations
|
| 73 |
+
echo "🔍 Verifying Rust Android targets..."
|
| 74 |
+
rustup target list --installed | grep android || echo "No Android targets found"
|
| 75 |
+
echo "🔍 Verifying cargo configuration..."
|
| 76 |
+
if [ -f .cargo/config.toml ]; then
|
| 77 |
+
echo "✅ .cargo/config.toml exists"
|
| 78 |
+
else
|
| 79 |
+
echo "❌ .cargo/config.toml missing"
|
| 80 |
+
exit 1
|
| 81 |
+
fi
|
| 82 |
+
- name: Build with Gradle
|
| 83 |
+
uses: gradle/actions/setup-gradle@v3
|
| 84 |
+
with:
|
| 85 |
+
arguments: assembledebug --stacktrace
|
| 86 |
+
- name: Run test cases
|
| 87 |
+
uses: gradle/actions/setup-gradle@v3
|
| 88 |
+
with:
|
| 89 |
+
arguments: jacocoTestPlayDebugUnitTestReport --stacktrace --info
|
.github/workflows/android-main.yml
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: Android Main CI
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
push:
|
| 5 |
+
branches:
|
| 6 |
+
- 'master'
|
| 7 |
+
- 'release/*'
|
| 8 |
+
- 'hotfix/*'
|
| 9 |
+
|
| 10 |
+
concurrency:
|
| 11 |
+
group: build-${{ github.event.pull_request.number || github.ref }}
|
| 12 |
+
cancel-in-progress: true
|
| 13 |
+
|
| 14 |
+
jobs:
|
| 15 |
+
check_spotless:
|
| 16 |
+
name: Check spotless
|
| 17 |
+
runs-on: ubuntu-latest
|
| 18 |
+
steps:
|
| 19 |
+
- uses: actions/checkout@v4
|
| 20 |
+
- name: Set up JDK 17
|
| 21 |
+
uses: actions/setup-java@v4
|
| 22 |
+
with:
|
| 23 |
+
distribution: "temurin"
|
| 24 |
+
java-version: 17
|
| 25 |
+
- name: Set up NDK
|
| 26 |
+
uses: nttld/setup-ndk@afb4c9964b521afb97c864b7d40b11e6911bd410
|
| 27 |
+
with:
|
| 28 |
+
ndk-version: r28c
|
| 29 |
+
link-to-sdk: true
|
| 30 |
+
local-cache: true
|
| 31 |
+
- name: Check formatting using spotless
|
| 32 |
+
uses: gradle/actions/setup-gradle@v3
|
| 33 |
+
with:
|
| 34 |
+
arguments: spotlessCheck
|
| 35 |
+
|
| 36 |
+
build:
|
| 37 |
+
name: Build debug, Jacoco test and publish to codacy
|
| 38 |
+
runs-on: ubuntu-latest
|
| 39 |
+
steps:
|
| 40 |
+
- uses: actions/checkout@v4
|
| 41 |
+
with:
|
| 42 |
+
fetch-depth: 0
|
| 43 |
+
- name: Set up JDK 17
|
| 44 |
+
uses: actions/setup-java@v4
|
| 45 |
+
with:
|
| 46 |
+
distribution: "temurin"
|
| 47 |
+
java-version: 17
|
| 48 |
+
- name: Install Rust
|
| 49 |
+
uses: dtolnay/rust-toolchain@stable
|
| 50 |
+
with:
|
| 51 |
+
toolchain: stable
|
| 52 |
+
- name: Cache Rust dependencies
|
| 53 |
+
uses: actions/cache@v4
|
| 54 |
+
with:
|
| 55 |
+
path: |
|
| 56 |
+
~/.cargo/bin/
|
| 57 |
+
~/.cargo/registry/index/
|
| 58 |
+
~/.cargo/registry/cache/
|
| 59 |
+
~/.cargo/git/db/
|
| 60 |
+
file_operations/target/
|
| 61 |
+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
| 62 |
+
restore-keys: |
|
| 63 |
+
${{ runner.os }}-cargo-
|
| 64 |
+
- name: Setup Rust for Android
|
| 65 |
+
run: |
|
| 66 |
+
cd file_operations
|
| 67 |
+
chmod +x setup_rust_android.sh
|
| 68 |
+
./setup_rust_android.sh
|
| 69 |
+
- name: Verify Rust setup
|
| 70 |
+
run: |
|
| 71 |
+
cd file_operations
|
| 72 |
+
echo "🔍 Verifying Rust Android targets..."
|
| 73 |
+
rustup target list --installed | grep android || echo "No Android targets found"
|
| 74 |
+
echo "🔍 Verifying cargo configuration..."
|
| 75 |
+
if [ -f .cargo/config.toml ]; then
|
| 76 |
+
echo "✅ .cargo/config.toml exists"
|
| 77 |
+
else
|
| 78 |
+
echo "❌ .cargo/config.toml missing"
|
| 79 |
+
exit 1
|
| 80 |
+
fi
|
| 81 |
+
- name: Build with Gradle
|
| 82 |
+
uses: gradle/actions/setup-gradle@v3
|
| 83 |
+
with:
|
| 84 |
+
arguments: assembledebug
|
| 85 |
+
- name: Run test cases
|
| 86 |
+
uses: gradle/actions/setup-gradle@v3
|
| 87 |
+
with:
|
| 88 |
+
arguments: jacocoTestPlayDebugUnitTestReport
|
| 89 |
+
- name: Publish test cases
|
| 90 |
+
run: |
|
| 91 |
+
export CODACY_PROJECT_TOKEN=${{ secrets.CODACY_TOKEN }}
|
| 92 |
+
bash <(curl -Ls https://coverage.codacy.com/get.sh)
|
| 93 |
+
- name: Publish on Telegram
|
| 94 |
+
run: |
|
| 95 |
+
COMMIT_COUNT=$(git rev-list --count ${GITHUB_REF})
|
| 96 |
+
VERSION_NAME=$(echo ${GITHUB_REF##*/} | sed 's/release\///' | sed 's/hotfix\///')
|
| 97 |
+
cp app/build/outputs/apk/fdroid/debug/app-fdroid-debug.apk app/build/outputs/apk/fdroid/debug/amaze-fdroid-$(echo $VERSION_NAME)-$(echo $COMMIT_COUNT).apk
|
| 98 |
+
cp app/build/outputs/apk/play/debug/app-play-debug.apk app/build/outputs/apk/play/debug/amaze-play-$(echo $VERSION_NAME)-$(echo $COMMIT_COUNT).apk
|
| 99 |
+
echo $(curl -v -F "chat_id=${{ secrets.TELEGRAM_CHAT_ID }}" -F document=@app/build/outputs/apk/fdroid/debug/amaze-fdroid-$(echo $VERSION_NAME)-$(echo $COMMIT_COUNT).apk https://api.telegram.org/${{ secrets.AMAZE_BOT_ID }}:${{ secrets.TELEGRAM_INTEGRATION_KEY }}/sendDocument)
|
| 100 |
+
echo $(curl -v -F "chat_id=${{ secrets.TELEGRAM_CHAT_ID }}" -F document=@app/build/outputs/apk/play/debug/amaze-play-$(echo $VERSION_NAME)-$(echo $COMMIT_COUNT).apk https://api.telegram.org/${{ secrets.AMAZE_BOT_ID }}:${{ secrets.TELEGRAM_INTEGRATION_KEY }}/sendDocument)
|
| 101 |
+
|
| 102 |
+
|
| 103 |
+
test_emulator:
|
| 104 |
+
timeout-minutes: 30 # Emulator can get stuck
|
| 105 |
+
runs-on: ubuntu-latest
|
| 106 |
+
strategy:
|
| 107 |
+
fail-fast: true
|
| 108 |
+
matrix:
|
| 109 |
+
api-level: [ 21, 28 ]
|
| 110 |
+
steps:
|
| 111 |
+
- name: checkout
|
| 112 |
+
uses: actions/checkout@v4
|
| 113 |
+
- name: Java 17
|
| 114 |
+
uses: actions/setup-java@v4
|
| 115 |
+
with:
|
| 116 |
+
distribution: "temurin"
|
| 117 |
+
java-version: 17
|
| 118 |
+
- name: Enable KVM
|
| 119 |
+
run: |
|
| 120 |
+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
|
| 121 |
+
sudo udevadm control --reload-rules
|
| 122 |
+
sudo udevadm trigger --name-match=kvm
|
| 123 |
+
- name: Gradle cache
|
| 124 |
+
uses: gradle/actions/setup-gradle@v3
|
| 125 |
+
- name: AVD cache
|
| 126 |
+
uses: actions/cache@v4
|
| 127 |
+
id: avd-cache
|
| 128 |
+
with:
|
| 129 |
+
path: |
|
| 130 |
+
~/.android/avd/*
|
| 131 |
+
~/.android/adb*
|
| 132 |
+
~/.android/debug.keystore
|
| 133 |
+
key: avd-${{ matrix.api-level }}
|
| 134 |
+
- name: create AVD and generate snapshot for caching
|
| 135 |
+
if: steps.avd-cache.outputs.cache-hit != 'true'
|
| 136 |
+
uses: reactivecircus/android-emulator-runner@v2
|
| 137 |
+
with:
|
| 138 |
+
api-level: ${{ matrix.api-level }}
|
| 139 |
+
force-avd-creation: false
|
| 140 |
+
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
|
| 141 |
+
disable-animations: false
|
| 142 |
+
sdcard-path-or-size: 100M
|
| 143 |
+
arch: x86_64
|
| 144 |
+
ram-size: 2048M
|
| 145 |
+
channel: canary
|
| 146 |
+
script: echo "Generated AVD snapshot for caching."
|
| 147 |
+
|
| 148 |
+
- name: run tests
|
| 149 |
+
uses: reactivecircus/android-emulator-runner@v2
|
| 150 |
+
with:
|
| 151 |
+
api-level: ${{ matrix.api-level }}
|
| 152 |
+
force-avd-creation: false
|
| 153 |
+
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
|
| 154 |
+
disable-animations: true
|
| 155 |
+
sdcard-path-or-size: 100M
|
| 156 |
+
arch: x86_64
|
| 157 |
+
ram-size: 2048M
|
| 158 |
+
channel: canary
|
| 159 |
+
script: |
|
| 160 |
+
adb logcat -c
|
| 161 |
+
adb logcat *:E &
|
| 162 |
+
./gradlew :app:connectedCheck
|
| 163 |
+
|
.gitignore
ADDED
|
@@ -0,0 +1,333 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
# Created by https://www.toptal.com/developers/gitignore/api/android,androidstudio,c
|
| 3 |
+
# Edit at https://www.toptal.com/developers/gitignore?templates=android,androidstudio,c
|
| 4 |
+
|
| 5 |
+
### Android ###
|
| 6 |
+
# Built application files
|
| 7 |
+
*.apk
|
| 8 |
+
*.aar
|
| 9 |
+
*.ap_
|
| 10 |
+
*.aab
|
| 11 |
+
|
| 12 |
+
# Files for the ART/Dalvik VM
|
| 13 |
+
*.dex
|
| 14 |
+
|
| 15 |
+
# Java class files
|
| 16 |
+
*.class
|
| 17 |
+
|
| 18 |
+
# Generated files
|
| 19 |
+
bin/
|
| 20 |
+
gen/
|
| 21 |
+
out/
|
| 22 |
+
# Uncomment the following line in case you need and you don't have the release build type files in your app
|
| 23 |
+
# release/
|
| 24 |
+
|
| 25 |
+
# Gradle files
|
| 26 |
+
.gradle/
|
| 27 |
+
build/
|
| 28 |
+
|
| 29 |
+
# Local configuration file (sdk path, etc)
|
| 30 |
+
local.properties
|
| 31 |
+
|
| 32 |
+
# Proguard folder generated by Eclipse
|
| 33 |
+
proguard/
|
| 34 |
+
|
| 35 |
+
# Log Files
|
| 36 |
+
*.log
|
| 37 |
+
|
| 38 |
+
# Android Studio Navigation editor temp files
|
| 39 |
+
.navigation/
|
| 40 |
+
|
| 41 |
+
# Android Studio captures folder
|
| 42 |
+
captures/
|
| 43 |
+
|
| 44 |
+
# IntelliJ
|
| 45 |
+
*.iml
|
| 46 |
+
.idea/workspace.xml
|
| 47 |
+
.idea/tasks.xml
|
| 48 |
+
.idea/gradle.xml
|
| 49 |
+
.idea/assetWizardSettings.xml
|
| 50 |
+
.idea/dictionaries
|
| 51 |
+
.idea/libraries
|
| 52 |
+
.idea/jarRepositories.xml
|
| 53 |
+
# Android Studio 3 in .gitignore file.
|
| 54 |
+
.idea/caches
|
| 55 |
+
.idea/modules.xml
|
| 56 |
+
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
|
| 57 |
+
.idea/navEditor.xml
|
| 58 |
+
|
| 59 |
+
# Keystore files
|
| 60 |
+
# Uncomment the following lines if you do not want to check your keystore files in.
|
| 61 |
+
#*.jks
|
| 62 |
+
#*.keystore
|
| 63 |
+
|
| 64 |
+
# External native build folder generated in Android Studio 2.2 and later
|
| 65 |
+
.externalNativeBuild
|
| 66 |
+
.cxx/
|
| 67 |
+
|
| 68 |
+
# Google Services (e.g. APIs or Firebase)
|
| 69 |
+
# google-services.json
|
| 70 |
+
|
| 71 |
+
# Freeline
|
| 72 |
+
freeline.py
|
| 73 |
+
freeline/
|
| 74 |
+
freeline_project_description.json
|
| 75 |
+
|
| 76 |
+
# fastlane
|
| 77 |
+
fastlane/report.xml
|
| 78 |
+
fastlane/Preview.html
|
| 79 |
+
fastlane/screenshots
|
| 80 |
+
fastlane/test_output
|
| 81 |
+
fastlane/readme.md
|
| 82 |
+
|
| 83 |
+
# Version control
|
| 84 |
+
vcs.xml
|
| 85 |
+
|
| 86 |
+
# lint
|
| 87 |
+
lint/intermediates/
|
| 88 |
+
lint/generated/
|
| 89 |
+
lint/outputs/
|
| 90 |
+
lint/tmp/
|
| 91 |
+
# lint/reports/
|
| 92 |
+
|
| 93 |
+
# Android Profiling
|
| 94 |
+
*.hprof
|
| 95 |
+
|
| 96 |
+
### Android Patch ###
|
| 97 |
+
gen-external-apklibs
|
| 98 |
+
output.json
|
| 99 |
+
|
| 100 |
+
# Replacement of .externalNativeBuild directories introduced
|
| 101 |
+
# with Android Studio 3.5.
|
| 102 |
+
|
| 103 |
+
### C ###
|
| 104 |
+
# Prerequisites
|
| 105 |
+
*.d
|
| 106 |
+
|
| 107 |
+
# Object files
|
| 108 |
+
*.o
|
| 109 |
+
*.ko
|
| 110 |
+
*.obj
|
| 111 |
+
*.elf
|
| 112 |
+
|
| 113 |
+
# Linker output
|
| 114 |
+
*.ilk
|
| 115 |
+
*.map
|
| 116 |
+
*.exp
|
| 117 |
+
|
| 118 |
+
# Precompiled Headers
|
| 119 |
+
*.gch
|
| 120 |
+
*.pch
|
| 121 |
+
|
| 122 |
+
# Libraries
|
| 123 |
+
*.lib
|
| 124 |
+
*.a
|
| 125 |
+
*.la
|
| 126 |
+
*.lo
|
| 127 |
+
|
| 128 |
+
# Shared objects (inc. Windows DLLs)
|
| 129 |
+
*.dll
|
| 130 |
+
*.so
|
| 131 |
+
*.so.*
|
| 132 |
+
*.dylib
|
| 133 |
+
|
| 134 |
+
# Executables
|
| 135 |
+
*.exe
|
| 136 |
+
*.out
|
| 137 |
+
*.app
|
| 138 |
+
*.i*86
|
| 139 |
+
*.x86_64
|
| 140 |
+
*.hex
|
| 141 |
+
|
| 142 |
+
# Debug files
|
| 143 |
+
*.dSYM/
|
| 144 |
+
*.su
|
| 145 |
+
*.idb
|
| 146 |
+
*.pdb
|
| 147 |
+
|
| 148 |
+
# Kernel Module Compile Results
|
| 149 |
+
*.mod*
|
| 150 |
+
*.cmd
|
| 151 |
+
.tmp_versions/
|
| 152 |
+
modules.order
|
| 153 |
+
Module.symvers
|
| 154 |
+
Mkfile.old
|
| 155 |
+
dkms.conf
|
| 156 |
+
|
| 157 |
+
### AndroidStudio ###
|
| 158 |
+
# Covers files to be ignored for android development using Android Studio.
|
| 159 |
+
|
| 160 |
+
# Built application files
|
| 161 |
+
|
| 162 |
+
# Files for the ART/Dalvik VM
|
| 163 |
+
|
| 164 |
+
# Java class files
|
| 165 |
+
|
| 166 |
+
# Generated files
|
| 167 |
+
|
| 168 |
+
# Gradle files
|
| 169 |
+
.gradle
|
| 170 |
+
|
| 171 |
+
# Signing files
|
| 172 |
+
.signing/
|
| 173 |
+
|
| 174 |
+
# Local configuration file (sdk path, etc)
|
| 175 |
+
|
| 176 |
+
# Proguard folder generated by Eclipse
|
| 177 |
+
|
| 178 |
+
# Log Files
|
| 179 |
+
|
| 180 |
+
# Android Studio
|
| 181 |
+
/*/build/
|
| 182 |
+
/*/local.properties
|
| 183 |
+
/*/out
|
| 184 |
+
/*/*/build
|
| 185 |
+
/*/*/production
|
| 186 |
+
*.ipr
|
| 187 |
+
*~
|
| 188 |
+
*.swp
|
| 189 |
+
|
| 190 |
+
# Keystore files
|
| 191 |
+
*.jks
|
| 192 |
+
*.keystore
|
| 193 |
+
|
| 194 |
+
# Google Services (e.g. APIs or Firebase)
|
| 195 |
+
# google-services.json
|
| 196 |
+
|
| 197 |
+
# Android Patch
|
| 198 |
+
|
| 199 |
+
# External native build folder generated in Android Studio 2.2 and later
|
| 200 |
+
|
| 201 |
+
# NDK
|
| 202 |
+
obj/
|
| 203 |
+
|
| 204 |
+
# IntelliJ IDEA
|
| 205 |
+
*.iws
|
| 206 |
+
/out/
|
| 207 |
+
|
| 208 |
+
# User-specific configurations
|
| 209 |
+
.idea/caches/
|
| 210 |
+
.idea/libraries/
|
| 211 |
+
.idea/shelf/
|
| 212 |
+
.idea/.name
|
| 213 |
+
.idea/compiler.xml
|
| 214 |
+
.idea/copyright/profiles_settings.xml
|
| 215 |
+
.idea/encodings.xml
|
| 216 |
+
.idea/misc.xml
|
| 217 |
+
.idea/scopes/scope_settings.xml
|
| 218 |
+
.idea/vcs.xml
|
| 219 |
+
.idea/jsLibraryMappings.xml
|
| 220 |
+
.idea/datasources.xml
|
| 221 |
+
.idea/dataSources.ids
|
| 222 |
+
.idea/sqlDataSources.xml
|
| 223 |
+
.idea/dynamic.xml
|
| 224 |
+
.idea/uiDesigner.xml
|
| 225 |
+
|
| 226 |
+
# OS-specific files
|
| 227 |
+
.DS_Store
|
| 228 |
+
.DS_Store?
|
| 229 |
+
._*
|
| 230 |
+
.Spotlight-V100
|
| 231 |
+
.Trashes
|
| 232 |
+
ehthumbs.db
|
| 233 |
+
Thumbs.db
|
| 234 |
+
|
| 235 |
+
# Legacy Eclipse project files
|
| 236 |
+
.classpath
|
| 237 |
+
.project
|
| 238 |
+
.cproject
|
| 239 |
+
.settings/
|
| 240 |
+
|
| 241 |
+
# Mobile Tools for Java (J2ME)
|
| 242 |
+
.mtj.tmp/
|
| 243 |
+
|
| 244 |
+
# Package Files #
|
| 245 |
+
*.war
|
| 246 |
+
*.ear
|
| 247 |
+
|
| 248 |
+
# virtual machine crash logs (Reference: http://www.java.com/en/download/help/error_hotspot.xml)
|
| 249 |
+
hs_err_pid*
|
| 250 |
+
|
| 251 |
+
## Plugin-specific files:
|
| 252 |
+
|
| 253 |
+
# mpeltonen/sbt-idea plugin
|
| 254 |
+
.idea_modules/
|
| 255 |
+
|
| 256 |
+
# JIRA plugin
|
| 257 |
+
atlassian-ide-plugin.xml
|
| 258 |
+
|
| 259 |
+
# Mongo Explorer plugin
|
| 260 |
+
.idea/mongoSettings.xml
|
| 261 |
+
|
| 262 |
+
# Crashlytics plugin (for Android Studio and IntelliJ)
|
| 263 |
+
com_crashlytics_export_strings.xml
|
| 264 |
+
crashlytics.properties
|
| 265 |
+
crashlytics-build.properties
|
| 266 |
+
fabric.properties
|
| 267 |
+
|
| 268 |
+
### AndroidStudio Patch ###
|
| 269 |
+
|
| 270 |
+
!/gradle/wrapper/gradle-wrapper.jar
|
| 271 |
+
|
| 272 |
+
# End of https://www.toptal.com/developers/gitignore/api/android,androidstudio,c
|
| 273 |
+
|
| 274 |
+
|
| 275 |
+
# Windows image file caches
|
| 276 |
+
Thumbs.db
|
| 277 |
+
ehthumbs.db
|
| 278 |
+
|
| 279 |
+
# Folder config file
|
| 280 |
+
Desktop.ini
|
| 281 |
+
|
| 282 |
+
# Recycle Bin used on file shares
|
| 283 |
+
$RECYCLE.BIN/
|
| 284 |
+
|
| 285 |
+
# Windows Installer files
|
| 286 |
+
*.cab
|
| 287 |
+
*.msi
|
| 288 |
+
*.msm
|
| 289 |
+
*.msp
|
| 290 |
+
|
| 291 |
+
# =========================
|
| 292 |
+
# Operating System Files
|
| 293 |
+
# =========================
|
| 294 |
+
|
| 295 |
+
# OSX
|
| 296 |
+
# =========================
|
| 297 |
+
|
| 298 |
+
.DS_Store
|
| 299 |
+
.AppleDouble
|
| 300 |
+
.LSOverride
|
| 301 |
+
|
| 302 |
+
# Icon must ends with two \r.
|
| 303 |
+
Icon
|
| 304 |
+
|
| 305 |
+
|
| 306 |
+
# Thumbnails
|
| 307 |
+
._*
|
| 308 |
+
|
| 309 |
+
# Files that might appear on external disk
|
| 310 |
+
.Spotlight-V100
|
| 311 |
+
.Trashes
|
| 312 |
+
|
| 313 |
+
# Android Studio
|
| 314 |
+
.idea/*
|
| 315 |
+
#.idea/workspace.xml - remove # and delete .idea if it better suit your needs.
|
| 316 |
+
.gradle/
|
| 317 |
+
build/
|
| 318 |
+
.settings
|
| 319 |
+
bin/
|
| 320 |
+
gen/
|
| 321 |
+
.classpath
|
| 322 |
+
local.properties
|
| 323 |
+
.project
|
| 324 |
+
.idea/
|
| 325 |
+
projectFilesBackup
|
| 326 |
+
captures
|
| 327 |
+
*.iml
|
| 328 |
+
|
| 329 |
+
/app/src/main/res/values-in/strings.xml
|
| 330 |
+
/app/src/main/res/values-iw/strings.xml
|
| 331 |
+
|
| 332 |
+
# sign config
|
| 333 |
+
signing.properties
|
.tx/config
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[main]
|
| 2 |
+
host = https://www.transifex.com
|
| 3 |
+
|
| 4 |
+
[o:amaze:p:amaze-file-manager:r:full_description]
|
| 5 |
+
file_filter = fastlane/metadata/android/<lang>/full_description.txt
|
| 6 |
+
source_file = fastlane/metadata/android/en-US/full_description.txt
|
| 7 |
+
source_lang = en_US
|
| 8 |
+
type = TXT
|
| 9 |
+
lang_map = af_ZA: af-ZA, am_ET: am-ET, ar_AE: ar-AE, ar_BH: ar-BH, ar_DZ: ar-DZ, ar_EG: ar-EG, ar_IQ: ar-IQ, ar_JO: ar-JO, ar_KW: ar-KW, ar_LB: ar-LB, ar_LY: ar-LY, ar_MA: ar-MA, ar_OM: ar-OM, ar_QA: ar-QA, ar_SA: ar-SA, ar_SY: ar-SY, ar_TN: ar-TN, ar_YE: ar-YE, arn_CL: arn-CL, as_IN: as-IN, az_AZ: az-AZ, ba_RU: ba-RU, be_BY: be-BY, bg_BG: bg-BG, bn_BD: bn-BD, bn_IN: bn-IN, bo_CN: bo-CN, br_FR: br-FR, bs_BA: bs-BA, ca_ES: ca-ES, co_FR: co-FR, cs_CZ: cs-CZ, cy_GB: cy-GB, da_DK: da-DK, de_AT: de-AT, de_CH: de-CH, de_DE: de-DE, de_LI: de-LI, de_LU: de-LU, dsb_DE: dsb-DE, dv_MV: dv-MV, el_GR: el-GR, en_AU: en-AU, en_BZ: en-BZ, en_CA: en-CA, en_GB: en-GB, en_IE: en-IE, en_IN: en-IN, en_JM: en-JM, en_MY: en-MY, en_NZ: en-NZ, en_PH: en-PH, en_SG: en-SG, en_TT: en-TT, en_US: en-US, en_ZA: en-ZA, en_ZW: en-ZW, es_AR: es-AR, es_BO: es-BO, es_CL: es-CL, es_CO: es-CO, es_CR: es-CR, es_DO: es-DO, es_EC: es-EC, es_ES: es-ES, es_GT: es-GT, es_HN: es-HN, es_MX: es-MX, es_NI: es-NI, es_PA: es-PA, es_PE: es-PE, es_PR: es-PR, es_PY: es-PY, es_SV: es-SV, es_US: es-US, es_UY: es-UY, es_VE: es-VE, et_EE: et-EE, eu_ES: eu-ES, fa_IR: fa-IR, fi_FI: fi-FI, fil_PH: fil-PH, fo_FO: fo-FO, fr_BE: fr-BE, fr_CA: fr-CA, fr_CH: fr-CH, fr_FR: fr-FR, fr_LU: fr-LU, fr_MC: fr-MC, fy_NL: fy-NL, ga_IE: ga-IE, gd_GB: gd-GB, gl_ES: gl-ES, gsw_FR: gsw-FR, gu_IN: gu-IN, ha_NG: ha-NG, he: he, he_IL: he-IL, hi_IN: hi-IN, hr_BA: hr-BA, hr_HR: hr-HR, hsb_DE: hsb-DE, hu_HU: hu-HU, hy_AM: hy-AM, id: in, id_ID: in-ID, ig_NG: ig-NG, ii_CN: ii-CN, is_IS: is-IS, it_CH: it-CH, it_IT: it-IT, iu_CA: iu-CA, ja_JP: ja-JP, ka_GE: ka-GE, kk_KZ: kk-KZ, kl_GL: kl-GL, km_KH: km-KH, kn_IN: kn-IN, ko_KR: ko-KR, kok_IN: kok-IN, ky_KG: ky-KG, lb_LU: lb-LU, lo_LA: lo-LA, lt_LT: lt-LT, lv_LV: lv-LV, mi_NZ: mi-NZ, mk_MK: mk-MK, ml_IN: ml-IN, mn_CN: mn-CN, mn_MN: mn-MN, moh_CA: moh-CA, mr_IN: mr-IN, ms_BN: ms-BN, ms_MY: ms-MY, mt_MT: mt-MT, nb_NO: nb-NO, ne_NP: ne-NP, nl_BE: nl-BE, nl_NL: nl-NL, nn_NO: nn-NO, nso_ZA: nso-ZA, oc_FR: oc-FR, or_IN: or-IN, pa_IN: pa-IN, pl_PL: pl-PL, prs_AF: prs-AF, ps_AF: ps-AF, pt_BR: pt-BR, pt_PT: pt-PT, qut_GT: qut-GT, quz_BO: quz-BO, quz_EC: quz-EC, quz_PE: quz-PE, rm_CH: rm-CH, ro_RO: ro-RO, ru_RU: ru-RU, rw_RW: rw-RW, sa_IN: sa-IN, sah_RU: sah-RU, se_FI: se-FI, se_NO: se-NO, se_SE: se-SE, si_LK: si-LK, sk_SK: sk-SK, sl_SI: sl-SI, sma_NO: sma-NO, sma_SE: sma-SE, smj_NO: smj-NO, smj_SE: smj-SE, smn_FI: smn-FI, sms_FI: sms-FI, sq_AL: sq-AL, sr: sr, sv_FI: sv-FI, sv_SE: sv-SE, sw_KE: sw-KE, syr_SY: syr-SY, ta_IN: ta-IN, te_IN: te-IN, tg_TJ: tg-TJ, th_TH: th-TH, tk_TM: tk-TM, tn_ZA: tn-ZA, tr_TR: tr-TR, tt_RU: tt-RU, tzm_DZ: tzm-DZ, ug_CN: ug-CN, uk_UA: uk-UA, ur_PK: ur-PK, uz_UZ: uz-UZ, vi_VN: vi-VN, wo_SN: wo-SN, xh_ZA: xh-ZA, yo_NG: yo-NG, zh_CN: zh-CN, zh_HK: zh-HK, zh_MO: zh-MO, zh_SG: zh-SG, zh_TW: zh-TW, zu_ZA: zu-ZA
|
| 10 |
+
|
| 11 |
+
[o:amaze:p:amaze-file-manager:r:short_description]
|
| 12 |
+
file_filter = fastlane/metadata/android/<lang>/short_description.txt
|
| 13 |
+
source_file = fastlane/metadata/android/en-US/short_description.txt
|
| 14 |
+
source_lang = en_US
|
| 15 |
+
type = TXT
|
| 16 |
+
lang_map = af_ZA: af-ZA, am_ET: am-ET, ar_AE: ar-AE, ar_BH: ar-BH, ar_DZ: ar-DZ, ar_EG: ar-EG, ar_IQ: ar-IQ, ar_JO: ar-JO, ar_KW: ar-KW, ar_LB: ar-LB, ar_LY: ar-LY, ar_MA: ar-MA, ar_OM: ar-OM, ar_QA: ar-QA, ar_SA: ar-SA, ar_SY: ar-SY, ar_TN: ar-TN, ar_YE: ar-YE, arn_CL: arn-CL, as_IN: as-IN, az_AZ: az-AZ, ba_RU: ba-RU, be_BY: be-BY, bg_BG: bg-BG, bn_BD: bn-BD, bn_IN: bn-IN, bo_CN: bo-CN, br_FR: br-FR, bs_BA: bs-BA, ca_ES: ca-ES, co_FR: co-FR, cs_CZ: cs-CZ, cy_GB: cy-GB, da_DK: da-DK, de_AT: de-AT, de_CH: de-CH, de_DE: de-DE, de_LI: de-LI, de_LU: de-LU, dsb_DE: dsb-DE, dv_MV: dv-MV, el_GR: el-GR, en_AU: en-AU, en_BZ: en-BZ, en_CA: en-CA, en_GB: en-GB, en_IE: en-IE, en_IN: en-IN, en_JM: en-JM, en_MY: en-MY, en_NZ: en-NZ, en_PH: en-PH, en_SG: en-SG, en_TT: en-TT, en_US: en-US, en_ZA: en-ZA, en_ZW: en-ZW, es_AR: es-AR, es_BO: es-BO, es_CL: es-CL, es_CO: es-CO, es_CR: es-CR, es_DO: es-DO, es_EC: es-EC, es_ES: es-ES, es_GT: es-GT, es_HN: es-HN, es_MX: es-MX, es_NI: es-NI, es_PA: es-PA, es_PE: es-PE, es_PR: es-PR, es_PY: es-PY, es_SV: es-SV, es_US: es-US, es_UY: es-UY, es_VE: es-VE, et_EE: et-EE, eu_ES: eu-ES, fa_IR: fa-IR, fi_FI: fi-FI, fil_PH: fil-PH, fo_FO: fo-FO, fr_BE: fr-BE, fr_CA: fr-CA, fr_CH: fr-CH, fr_FR: fr-FR, fr_LU: fr-LU, fr_MC: fr-MC, fy_NL: fy-NL, ga_IE: ga-IE, gd_GB: gd-GB, gl_ES: gl-ES, gsw_FR: gsw-FR, gu_IN: gu-IN, ha_NG: ha-NG, he: he, he_IL: he-IL, hi_IN: hi-IN, hr_BA: hr-BA, hr_HR: hr-HR, hsb_DE: hsb-DE, hu_HU: hu-HU, hy_AM: hy-AM, id: in, id_ID: in-ID, ig_NG: ig-NG, ii_CN: ii-CN, is_IS: is-IS, it_CH: it-CH, it_IT: it-IT, iu_CA: iu-CA, ja_JP: ja-JP, ka_GE: ka-GE, kk_KZ: kk-KZ, kl_GL: kl-GL, km_KH: km-KH, kn_IN: kn-IN, ko_KR: ko-KR, kok_IN: kok-IN, ky_KG: ky-KG, lb_LU: lb-LU, lo_LA: lo-LA, lt_LT: lt-LT, lv_LV: lv-LV, mi_NZ: mi-NZ, mk_MK: mk-MK, ml_IN: ml-IN, mn_CN: mn-CN, mn_MN: mn-MN, moh_CA: moh-CA, mr_IN: mr-IN, ms_BN: ms-BN, ms_MY: ms-MY, mt_MT: mt-MT, nb_NO: nb-NO, ne_NP: ne-NP, nl_BE: nl-BE, nl_NL: nl-NL, nn_NO: nn-NO, nso_ZA: nso-ZA, oc_FR: oc-FR, or_IN: or-IN, pa_IN: pa-IN, pl_PL: pl-PL, prs_AF: prs-AF, ps_AF: ps-AF, pt_BR: pt-BR, pt_PT: pt-PT, qut_GT: qut-GT, quz_BO: quz-BO, quz_EC: quz-EC, quz_PE: quz-PE, rm_CH: rm-CH, ro_RO: ro-RO, ru_RU: ru-RU, rw_RW: rw-RW, sa_IN: sa-IN, sah_RU: sah-RU, se_FI: se-FI, se_NO: se-NO, se_SE: se-SE, si_LK: si-LK, sk_SK: sk-SK, sl_SI: sl-SI, sma_NO: sma-NO, sma_SE: sma-SE, smj_NO: smj-NO, smj_SE: smj-SE, smn_FI: smn-FI, sms_FI: sms-FI, sq_AL: sq-AL, sr: sr, sv_FI: sv-FI, sv_SE: sv-SE, sw_KE: sw-KE, syr_SY: syr-SY, ta_IN: ta-IN, te_IN: te-IN, tg_TJ: tg-TJ, th_TH: th-TH, tk_TM: tk-TM, tn_ZA: tn-ZA, tr_TR: tr-TR, tt_RU: tt-RU, tzm_DZ: tzm-DZ, ug_CN: ug-CN, uk_UA: uk-UA, ur_PK: ur-PK, uz_UZ: uz-UZ, vi_VN: vi-VN, wo_SN: wo-SN, xh_ZA: xh-ZA, yo_NG: yo-NG, zh_CN: zh-CN, zh_HK: zh-HK, zh_MO: zh-MO, zh_SG: zh-SG, zh_TW: zh-TW, zu_ZA: zu-ZA
|
| 17 |
+
|
| 18 |
+
[o:amaze:p:amaze-file-manager:r:strings]
|
| 19 |
+
file_filter = app/src/main/res/values-<lang>/strings.xml
|
| 20 |
+
source_file = app/src/main/res/values/strings.xml
|
| 21 |
+
source_lang = en_US
|
| 22 |
+
type = ANDROID
|
| 23 |
+
lang_map = ast_ES: ast-rES, fa_IR: fa-rIR, hi_IN: hi-rIN, hu: hu-rHU, it_IT: it-rIT, ko_KR: ko-rKR, my_MM: my-rMM, pt_BR: pt-rBR, pt_PT: pt-rPT, sv_SE: sv, tr_TR: tr-rTR, zh-Hans: zh-rHN, zh_CN: zh-rCN, zh_HK: zh-rHK, zh_TW: zh-rTW
|
CODE_OF_CONDUCT.md
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
# Contributor Covenant Code of Conduct
|
| 3 |
+
|
| 4 |
+
## Our Pledge
|
| 5 |
+
|
| 6 |
+
We as members, contributors, and leaders pledge to make participation in our
|
| 7 |
+
community a harassment-free experience for everyone, regardless of age, body
|
| 8 |
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
| 9 |
+
identity and expression, level of experience, education, socio-economic status,
|
| 10 |
+
nationality, personal appearance, race, caste, color, religion, or sexual
|
| 11 |
+
identity and orientation.
|
| 12 |
+
|
| 13 |
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
| 14 |
+
diverse, inclusive, and healthy community.
|
| 15 |
+
|
| 16 |
+
## Our Standards
|
| 17 |
+
|
| 18 |
+
Examples of behavior that contributes to a positive environment for our
|
| 19 |
+
community include:
|
| 20 |
+
|
| 21 |
+
* Demonstrating empathy and kindness toward other people
|
| 22 |
+
* Being respectful of differing opinions, viewpoints, and experiences
|
| 23 |
+
* Giving and gracefully accepting constructive feedback
|
| 24 |
+
* Accepting responsibility and apologizing to those affected by our mistakes,
|
| 25 |
+
and learning from the experience
|
| 26 |
+
* Focusing on what is best not just for us as individuals, but for the overall
|
| 27 |
+
community
|
| 28 |
+
|
| 29 |
+
Examples of unacceptable behavior include:
|
| 30 |
+
|
| 31 |
+
* The use of sexualized language or imagery, and sexual attention or advances of
|
| 32 |
+
any kind
|
| 33 |
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
| 34 |
+
* Public or private harassment
|
| 35 |
+
* Publishing others' private information, such as a physical or email address,
|
| 36 |
+
without their explicit permission
|
| 37 |
+
* Other conduct which could reasonably be considered inappropriate in a
|
| 38 |
+
professional setting
|
| 39 |
+
|
| 40 |
+
## Enforcement Responsibilities
|
| 41 |
+
|
| 42 |
+
Community leaders are responsible for clarifying and enforcing our standards of
|
| 43 |
+
acceptable behavior and will take appropriate and fair corrective action in
|
| 44 |
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
| 45 |
+
or harmful.
|
| 46 |
+
|
| 47 |
+
Community leaders have the right and responsibility to remove, edit, or reject
|
| 48 |
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
| 49 |
+
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
| 50 |
+
decisions when appropriate.
|
| 51 |
+
|
| 52 |
+
## Scope
|
| 53 |
+
|
| 54 |
+
This Code of Conduct applies within all community spaces, and also applies when
|
| 55 |
+
an individual is officially representing the community in public spaces.
|
| 56 |
+
Examples of representing our community include using an official e-mail address,
|
| 57 |
+
posting via an official social media account, or acting as an appointed
|
| 58 |
+
representative at an online or offline event.
|
| 59 |
+
|
| 60 |
+
## Enforcement
|
| 61 |
+
|
| 62 |
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
| 63 |
+
reported to the community leaders responsible for enforcement at
|
| 64 |
+
[support@teamamaze.xyz].
|
| 65 |
+
All complaints will be reviewed and investigated promptly and fairly.
|
| 66 |
+
|
| 67 |
+
All community leaders are obligated to respect the privacy and security of the
|
| 68 |
+
reporter of any incident.
|
| 69 |
+
|
| 70 |
+
## Enforcement Guidelines
|
| 71 |
+
|
| 72 |
+
Community leaders will follow these Community Impact Guidelines in determining
|
| 73 |
+
the consequences for any action they deem in violation of this Code of Conduct:
|
| 74 |
+
|
| 75 |
+
### 1. Correction
|
| 76 |
+
|
| 77 |
+
**Community Impact**: Use of inappropriate language or other behavior deemed
|
| 78 |
+
unprofessional or unwelcome in the community.
|
| 79 |
+
|
| 80 |
+
**Consequence**: A private, written warning from community leaders, providing
|
| 81 |
+
clarity around the nature of the violation and an explanation of why the
|
| 82 |
+
behavior was inappropriate. A public apology may be requested.
|
| 83 |
+
|
| 84 |
+
### 2. Warning
|
| 85 |
+
|
| 86 |
+
**Community Impact**: A violation through a single incident or series of
|
| 87 |
+
actions.
|
| 88 |
+
|
| 89 |
+
**Consequence**: A warning with consequences for continued behavior. No
|
| 90 |
+
interaction with the people involved, including unsolicited interaction with
|
| 91 |
+
those enforcing the Code of Conduct, for a specified period of time. This
|
| 92 |
+
includes avoiding interactions in community spaces as well as external channels
|
| 93 |
+
like social media. Violating these terms may lead to a temporary or permanent
|
| 94 |
+
ban.
|
| 95 |
+
|
| 96 |
+
### 3. Temporary Ban
|
| 97 |
+
|
| 98 |
+
**Community Impact**: A serious violation of community standards, including
|
| 99 |
+
sustained inappropriate behavior.
|
| 100 |
+
|
| 101 |
+
**Consequence**: A temporary ban from any sort of interaction or public
|
| 102 |
+
communication with the community for a specified period of time. No public or
|
| 103 |
+
private interaction with the people involved, including unsolicited interaction
|
| 104 |
+
with those enforcing the Code of Conduct, is allowed during this period.
|
| 105 |
+
Violating these terms may lead to a permanent ban.
|
| 106 |
+
|
| 107 |
+
### 4. Permanent Ban
|
| 108 |
+
|
| 109 |
+
**Community Impact**: Demonstrating a pattern of violation of community
|
| 110 |
+
standards, including sustained inappropriate behavior, harassment of an
|
| 111 |
+
individual, or aggression toward or disparagement of classes of individuals.
|
| 112 |
+
|
| 113 |
+
**Consequence**: A permanent ban from any sort of public interaction within the
|
| 114 |
+
community.
|
| 115 |
+
|
| 116 |
+
## Attribution
|
| 117 |
+
|
| 118 |
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
| 119 |
+
version 2.1, available at
|
| 120 |
+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
| 121 |
+
|
| 122 |
+
Community Impact Guidelines were inspired by
|
| 123 |
+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
| 124 |
+
|
| 125 |
+
For answers to common questions about this code of conduct, see the FAQ at
|
| 126 |
+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
|
| 127 |
+
[https://www.contributor-covenant.org/translations][translations].
|
| 128 |
+
|
| 129 |
+
[homepage]: https://www.contributor-covenant.org
|
| 130 |
+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
| 131 |
+
[Mozilla CoC]: https://github.com/mozilla/diversity
|
| 132 |
+
[FAQ]: https://www.contributor-covenant.org/faq
|
| 133 |
+
[translations]: https://www.contributor-covenant.org/translations
|
| 134 |
+
|
CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Contributing to Amaze
|
| 2 |
+
|
| 3 |
+
Happy to see you in here! Amaze was created with a vision to provide all the basic and advanced features a file manager in Android is supposed to have, with a friendly material design. As with any other open source project, contributions are the key to achieve this goal of ours. :)
|
| 4 |
+
|
| 5 |
+
Contributions are always welcome!
|
| 6 |
+
|
| 7 |
+
> ### Imposter's syndrome disclaimer: We want your help. No, really! Any contribution counts, no matter how small it be!
|
| 8 |
+
|
| 9 |
+
# How to contribute?
|
| 10 |
+
|
| 11 |
+
- **Translation**: We use [Transifex](https://www.transifex.com/amaze/amaze-file-manager/) for our translations, feel free to contribute translations there.
|
| 12 |
+
- **Monetary Contributions**: You can do monetary contributions via [OpenCollective](https://opencollective.com/TeamAmaze), [LiberaPay](https://liberapay.com/Team-Amaze/donate) or PayPal](https://www.paypal.me/vishalnehra).
|
| 13 |
+
- **Bug Reports**: Reporting bugs clearly & concisely helps us improve Amaze. It would be great for us to pinpoint the cause of a bug if there are logs attached to the bug report. Or clearcut steps to reproduce the issue you are facing. Yes, good bug reports are considered as contributions too!
|
| 14 |
+
- **Code Contributions**: This file discusses about code contributions.
|
| 15 |
+
|
| 16 |
+
To start contributing, we assume you know how to use git and write and debug Android apps.
|
| 17 |
+
|
| 18 |
+
## How to get started?
|
| 19 |
+
|
| 20 |
+
- You can use GitHub web interface to fork `TeamAmaze/AmazeFileManager` to `<YOUR-USERNAME>/AmazeFileManager`.
|
| 21 |
+
- The next step is to import it into Android Studio by `New Project -> Get from Version Control`.
|
| 22 |
+
- There you can paste the link to your fork.
|
| 23 |
+
- Let Android Studio import the project & download all the necessary dependencies
|
| 24 |
+
- Now you can build & run the project on an emulator/real device.
|
| 25 |
+
|
| 26 |
+
## What to do next?
|
| 27 |
+
|
| 28 |
+
- Go to [issues]() section & have a look at [good-first-issues](https://github.com/TeamAmaze/AmazeFileManager/issues?q=is%3Aopen+is%3Aissue+label%3A%22Issue-Easy+%28good+first+issue%29%22). These are low hanging fruits ready to be picked up!
|
| 29 |
+
- Have a look at [NPE Crashes](https://github.com/TeamAmaze/AmazeFileManager/issues?q=is%3Aopen+is%3Aissue+label%3ACrash-NullPointerException) too. These must be literally one line fixes to bugs.
|
| 30 |
+
- Or if you wanna work on a feature, please make sure no one's working on it by commenting on the thread (we'll assign it to you then).
|
| 31 |
+
- Once you have made all the necessary changes, and everything works as expected, please run `./gradlew spotlessCheck` on your local and handle any resulting formatting issues. Most of them can be fixed by running `./gradlew spotlessApply` (others would need lil manual changes)
|
| 32 |
+
- If everything looks good, push it to your fork & make a PR (please make sure to fill the PR template!)
|
| 33 |
+
- We'll look into your PR soon, give feedback, and upon the code working as expected (i.e, fixes the bug/implements feature), the code get merged to the next release branch! Yay!
|
| 34 |
+
|
| 35 |
+
If we feel your PR is a significant help to us, we'll award you a bounty with any of your preferred mode of payment.
|
| 36 |
+
|
| 37 |
+
## Points to note
|
| 38 |
+
|
| 39 |
+
- Please follow [Android/JAVA code style](https://source.android.com/docs/setup/contribute/code-style) for writing any code. Please see [this](https://github.com/TeamAmaze/AmazeFileManager/issues/986) issue too.
|
| 40 |
+
- Also, follow [Android Material Design guidelines](https://m3.material.io/get-started) in case you make changes to any UI element.
|
| 41 |
+
- The `file_operations` module contains native code in Rust. Please see [file_operations/src/main/rust/README.md](file_operations/src/main/rust/README.md) for more details on how to work with it.
|
| 42 |
+
|
| 43 |
+
## PS: please make sure to
|
| 44 |
+
|
| 45 |
+
- Follow best practices & to write _clean code_.
|
| 46 |
+
- Before opening a PR, run `./gradlew spotlessCheck` on your local and handle any resulting formatting issues. Most of them can be fixed by running `./gradlew spotlessApply` (others would need lil manual changes)
|
| 47 |
+
- Fill in the pull request template clearly (for eg: `fixes #XXXX` for bugfixes)
|
| 48 |
+
- Once you've opened PR, look out for CI builds (`Checks` section on the top of your PR). If it's all green, you're good to go! Else, please fix the issues specified in the logs (you can get logs by clicking on the failed workflow & then the failed action).
|
| 49 |
+
- Include tests (either Unit tests or automated tests like [Robolectric](http://robolectric.org/)/[Espresso](https://developer.android.com/training/testing/espresso/)) if possible to your PR
|
| 50 |
+
|
| 51 |
+
### Finally!
|
| 52 |
+
|
| 53 |
+
- We have our day time work, so except security vulnerabilities, your submission may be left cold for a lil while before being picked up by us :)
|
| 54 |
+
- Please be patient with us while we review our code. Try to avoid favoritism, hate speech & adhere to our [code of conduct](https://github.com/TeamAmaze/AmazeFileManager/blob/release/4.0/CODE_OF_CONDUCT.md).
|
| 55 |
+
|
| 56 |
+
## Ready to roll? Start [forking](https://github.com/TeamAmaze/AmazeFileManager/fork)! ;)
|
LICENSE.txt
ADDED
|
@@ -0,0 +1,674 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
GNU GENERAL PUBLIC LICENSE
|
| 2 |
+
Version 3, 29 June 2007
|
| 3 |
+
|
| 4 |
+
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
| 5 |
+
Everyone is permitted to copy and distribute verbatim copies
|
| 6 |
+
of this license document, but changing it is not allowed.
|
| 7 |
+
|
| 8 |
+
Preamble
|
| 9 |
+
|
| 10 |
+
The GNU General Public License is a free, copyleft license for
|
| 11 |
+
software and other kinds of works.
|
| 12 |
+
|
| 13 |
+
The licenses for most software and other practical works are designed
|
| 14 |
+
to take away your freedom to share and change the works. By contrast,
|
| 15 |
+
the GNU General Public License is intended to guarantee your freedom to
|
| 16 |
+
share and change all versions of a program--to make sure it remains free
|
| 17 |
+
software for all its users. We, the Free Software Foundation, use the
|
| 18 |
+
GNU General Public License for most of our software; it applies also to
|
| 19 |
+
any other work released this way by its authors. You can apply it to
|
| 20 |
+
your programs, too.
|
| 21 |
+
|
| 22 |
+
When we speak of free software, we are referring to freedom, not
|
| 23 |
+
price. Our General Public Licenses are designed to make sure that you
|
| 24 |
+
have the freedom to distribute copies of free software (and charge for
|
| 25 |
+
them if you wish), that you receive source code or can get it if you
|
| 26 |
+
want it, that you can change the software or use pieces of it in new
|
| 27 |
+
free programs, and that you know you can do these things.
|
| 28 |
+
|
| 29 |
+
To protect your rights, we need to prevent others from denying you
|
| 30 |
+
these rights or asking you to surrender the rights. Therefore, you have
|
| 31 |
+
certain responsibilities if you distribute copies of the software, or if
|
| 32 |
+
you modify it: responsibilities to respect the freedom of others.
|
| 33 |
+
|
| 34 |
+
For example, if you distribute copies of such a program, whether
|
| 35 |
+
gratis or for a fee, you must pass on to the recipients the same
|
| 36 |
+
freedoms that you received. You must make sure that they, too, receive
|
| 37 |
+
or can get the source code. And you must show them these terms so they
|
| 38 |
+
know their rights.
|
| 39 |
+
|
| 40 |
+
Developers that use the GNU GPL protect your rights with two steps:
|
| 41 |
+
(1) assert copyright on the software, and (2) offer you this License
|
| 42 |
+
giving you legal permission to copy, distribute and/or modify it.
|
| 43 |
+
|
| 44 |
+
For the developers' and authors' protection, the GPL clearly explains
|
| 45 |
+
that there is no warranty for this free software. For both users' and
|
| 46 |
+
authors' sake, the GPL requires that modified versions be marked as
|
| 47 |
+
changed, so that their problems will not be attributed erroneously to
|
| 48 |
+
authors of previous versions.
|
| 49 |
+
|
| 50 |
+
Some devices are designed to deny users access to install or run
|
| 51 |
+
modified versions of the software inside them, although the manufacturer
|
| 52 |
+
can do so. This is fundamentally incompatible with the aim of
|
| 53 |
+
protecting users' freedom to change the software. The systematic
|
| 54 |
+
pattern of such abuse occurs in the area of products for individuals to
|
| 55 |
+
use, which is precisely where it is most unacceptable. Therefore, we
|
| 56 |
+
have designed this version of the GPL to prohibit the practice for those
|
| 57 |
+
products. If such problems arise substantially in other domains, we
|
| 58 |
+
stand ready to extend this provision to those domains in future versions
|
| 59 |
+
of the GPL, as needed to protect the freedom of users.
|
| 60 |
+
|
| 61 |
+
Finally, every program is threatened constantly by software patents.
|
| 62 |
+
States should not allow patents to restrict development and use of
|
| 63 |
+
software on general-purpose computers, but in those that do, we wish to
|
| 64 |
+
avoid the special danger that patents applied to a free program could
|
| 65 |
+
make it effectively proprietary. To prevent this, the GPL assures that
|
| 66 |
+
patents cannot be used to render the program non-free.
|
| 67 |
+
|
| 68 |
+
The precise terms and conditions for copying, distribution and
|
| 69 |
+
modification follow.
|
| 70 |
+
|
| 71 |
+
TERMS AND CONDITIONS
|
| 72 |
+
|
| 73 |
+
0. Definitions.
|
| 74 |
+
|
| 75 |
+
"This License" refers to version 3 of the GNU General Public License.
|
| 76 |
+
|
| 77 |
+
"Copyright" also means copyright-like laws that apply to other kinds of
|
| 78 |
+
works, such as semiconductor masks.
|
| 79 |
+
|
| 80 |
+
"The Program" refers to any copyrightable work licensed under this
|
| 81 |
+
License. Each licensee is addressed as "you". "Licensees" and
|
| 82 |
+
"recipients" may be individuals or organizations.
|
| 83 |
+
|
| 84 |
+
To "modify" a work means to copy from or adapt all or part of the work
|
| 85 |
+
in a fashion requiring copyright permission, other than the making of an
|
| 86 |
+
exact copy. The resulting work is called a "modified version" of the
|
| 87 |
+
earlier work or a work "based on" the earlier work.
|
| 88 |
+
|
| 89 |
+
A "covered work" means either the unmodified Program or a work based
|
| 90 |
+
on the Program.
|
| 91 |
+
|
| 92 |
+
To "propagate" a work means to do anything with it that, without
|
| 93 |
+
permission, would make you directly or secondarily liable for
|
| 94 |
+
infringement under applicable copyright law, except executing it on a
|
| 95 |
+
computer or modifying a private copy. Propagation includes copying,
|
| 96 |
+
distribution (with or without modification), making available to the
|
| 97 |
+
public, and in some countries other activities as well.
|
| 98 |
+
|
| 99 |
+
To "convey" a work means any kind of propagation that enables other
|
| 100 |
+
parties to make or receive copies. Mere interaction with a user through
|
| 101 |
+
a computer network, with no transfer of a copy, is not conveying.
|
| 102 |
+
|
| 103 |
+
An interactive user interface displays "Appropriate Legal Notices"
|
| 104 |
+
to the extent that it includes a convenient and prominently visible
|
| 105 |
+
feature that (1) displays an appropriate copyright notice, and (2)
|
| 106 |
+
tells the user that there is no warranty for the work (except to the
|
| 107 |
+
extent that warranties are provided), that licensees may convey the
|
| 108 |
+
work under this License, and how to view a copy of this License. If
|
| 109 |
+
the interface presents a list of user commands or options, such as a
|
| 110 |
+
menu, a prominent item in the list meets this criterion.
|
| 111 |
+
|
| 112 |
+
1. Source Code.
|
| 113 |
+
|
| 114 |
+
The "source code" for a work means the preferred form of the work
|
| 115 |
+
for making modifications to it. "Object code" means any non-source
|
| 116 |
+
form of a work.
|
| 117 |
+
|
| 118 |
+
A "Standard Interface" means an interface that either is an official
|
| 119 |
+
standard defined by a recognized standards body, or, in the case of
|
| 120 |
+
interfaces specified for a particular programming language, one that
|
| 121 |
+
is widely used among developers working in that language.
|
| 122 |
+
|
| 123 |
+
The "System Libraries" of an executable work include anything, other
|
| 124 |
+
than the work as a whole, that (a) is included in the normal form of
|
| 125 |
+
packaging a Major Component, but which is not part of that Major
|
| 126 |
+
Component, and (b) serves only to enable use of the work with that
|
| 127 |
+
Major Component, or to implement a Standard Interface for which an
|
| 128 |
+
implementation is available to the public in source code form. A
|
| 129 |
+
"Major Component", in this context, means a major essential component
|
| 130 |
+
(kernel, window system, and so on) of the specific operating system
|
| 131 |
+
(if any) on which the executable work runs, or a compiler used to
|
| 132 |
+
produce the work, or an object code interpreter used to run it.
|
| 133 |
+
|
| 134 |
+
The "Corresponding Source" for a work in object code form means all
|
| 135 |
+
the source code needed to generate, install, and (for an executable
|
| 136 |
+
work) run the object code and to modify the work, including scripts to
|
| 137 |
+
control those activities. However, it does not include the work's
|
| 138 |
+
System Libraries, or general-purpose tools or generally available free
|
| 139 |
+
programs which are used unmodified in performing those activities but
|
| 140 |
+
which are not part of the work. For example, Corresponding Source
|
| 141 |
+
includes interface definition files associated with source files for
|
| 142 |
+
the work, and the source code for shared libraries and dynamically
|
| 143 |
+
linked subprograms that the work is specifically designed to require,
|
| 144 |
+
such as by intimate data communication or control flow between those
|
| 145 |
+
subprograms and other parts of the work.
|
| 146 |
+
|
| 147 |
+
The Corresponding Source need not include anything that users
|
| 148 |
+
can regenerate automatically from other parts of the Corresponding
|
| 149 |
+
Source.
|
| 150 |
+
|
| 151 |
+
The Corresponding Source for a work in source code form is that
|
| 152 |
+
same work.
|
| 153 |
+
|
| 154 |
+
2. Basic Permissions.
|
| 155 |
+
|
| 156 |
+
All rights granted under this License are granted for the term of
|
| 157 |
+
copyright on the Program, and are irrevocable provided the stated
|
| 158 |
+
conditions are met. This License explicitly affirms your unlimited
|
| 159 |
+
permission to run the unmodified Program. The output from running a
|
| 160 |
+
covered work is covered by this License only if the output, given its
|
| 161 |
+
content, constitutes a covered work. This License acknowledges your
|
| 162 |
+
rights of fair use or other equivalent, as provided by copyright law.
|
| 163 |
+
|
| 164 |
+
You may make, run and propagate covered works that you do not
|
| 165 |
+
convey, without conditions so long as your license otherwise remains
|
| 166 |
+
in force. You may convey covered works to others for the sole purpose
|
| 167 |
+
of having them make modifications exclusively for you, or provide you
|
| 168 |
+
with facilities for running those works, provided that you comply with
|
| 169 |
+
the terms of this License in conveying all material for which you do
|
| 170 |
+
not control copyright. Those thus making or running the covered works
|
| 171 |
+
for you must do so exclusively on your behalf, under your direction
|
| 172 |
+
and control, on terms that prohibit them from making any copies of
|
| 173 |
+
your copyrighted material outside their relationship with you.
|
| 174 |
+
|
| 175 |
+
Conveying under any other circumstances is permitted solely under
|
| 176 |
+
the conditions stated below. Sublicensing is not allowed; section 10
|
| 177 |
+
makes it unnecessary.
|
| 178 |
+
|
| 179 |
+
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
| 180 |
+
|
| 181 |
+
No covered work shall be deemed part of an effective technological
|
| 182 |
+
measure under any applicable law fulfilling obligations under article
|
| 183 |
+
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
| 184 |
+
similar laws prohibiting or restricting circumvention of such
|
| 185 |
+
measures.
|
| 186 |
+
|
| 187 |
+
When you convey a covered work, you waive any legal power to forbid
|
| 188 |
+
circumvention of technological measures to the extent such circumvention
|
| 189 |
+
is effected by exercising rights under this License with respect to
|
| 190 |
+
the covered work, and you disclaim any intention to limit operation or
|
| 191 |
+
modification of the work as a means of enforcing, against the work's
|
| 192 |
+
users, your or third parties' legal rights to forbid circumvention of
|
| 193 |
+
technological measures.
|
| 194 |
+
|
| 195 |
+
4. Conveying Verbatim Copies.
|
| 196 |
+
|
| 197 |
+
You may convey verbatim copies of the Program's source code as you
|
| 198 |
+
receive it, in any medium, provided that you conspicuously and
|
| 199 |
+
appropriately publish on each copy an appropriate copyright notice;
|
| 200 |
+
keep intact all notices stating that this License and any
|
| 201 |
+
non-permissive terms added in accord with section 7 apply to the code;
|
| 202 |
+
keep intact all notices of the absence of any warranty; and give all
|
| 203 |
+
recipients a copy of this License along with the Program.
|
| 204 |
+
|
| 205 |
+
You may charge any price or no price for each copy that you convey,
|
| 206 |
+
and you may offer support or warranty protection for a fee.
|
| 207 |
+
|
| 208 |
+
5. Conveying Modified Source Versions.
|
| 209 |
+
|
| 210 |
+
You may convey a work based on the Program, or the modifications to
|
| 211 |
+
produce it from the Program, in the form of source code under the
|
| 212 |
+
terms of section 4, provided that you also meet all of these conditions:
|
| 213 |
+
|
| 214 |
+
a) The work must carry prominent notices stating that you modified
|
| 215 |
+
it, and giving a relevant date.
|
| 216 |
+
|
| 217 |
+
b) The work must carry prominent notices stating that it is
|
| 218 |
+
released under this License and any conditions added under section
|
| 219 |
+
7. This requirement modifies the requirement in section 4 to
|
| 220 |
+
"keep intact all notices".
|
| 221 |
+
|
| 222 |
+
c) You must license the entire work, as a whole, under this
|
| 223 |
+
License to anyone who comes into possession of a copy. This
|
| 224 |
+
License will therefore apply, along with any applicable section 7
|
| 225 |
+
additional terms, to the whole of the work, and all its parts,
|
| 226 |
+
regardless of how they are packaged. This License gives no
|
| 227 |
+
permission to license the work in any other way, but it does not
|
| 228 |
+
invalidate such permission if you have separately received it.
|
| 229 |
+
|
| 230 |
+
d) If the work has interactive user interfaces, each must display
|
| 231 |
+
Appropriate Legal Notices; however, if the Program has interactive
|
| 232 |
+
interfaces that do not display Appropriate Legal Notices, your
|
| 233 |
+
work need not make them do so.
|
| 234 |
+
|
| 235 |
+
A compilation of a covered work with other separate and independent
|
| 236 |
+
works, which are not by their nature extensions of the covered work,
|
| 237 |
+
and which are not combined with it such as to form a larger program,
|
| 238 |
+
in or on a volume of a storage or distribution medium, is called an
|
| 239 |
+
"aggregate" if the compilation and its resulting copyright are not
|
| 240 |
+
used to limit the access or legal rights of the compilation's users
|
| 241 |
+
beyond what the individual works permit. Inclusion of a covered work
|
| 242 |
+
in an aggregate does not cause this License to apply to the other
|
| 243 |
+
parts of the aggregate.
|
| 244 |
+
|
| 245 |
+
6. Conveying Non-Source Forms.
|
| 246 |
+
|
| 247 |
+
You may convey a covered work in object code form under the terms
|
| 248 |
+
of sections 4 and 5, provided that you also convey the
|
| 249 |
+
machine-readable Corresponding Source under the terms of this License,
|
| 250 |
+
in one of these ways:
|
| 251 |
+
|
| 252 |
+
a) Convey the object code in, or embodied in, a physical product
|
| 253 |
+
(including a physical distribution medium), accompanied by the
|
| 254 |
+
Corresponding Source fixed on a durable physical medium
|
| 255 |
+
customarily used for software interchange.
|
| 256 |
+
|
| 257 |
+
b) Convey the object code in, or embodied in, a physical product
|
| 258 |
+
(including a physical distribution medium), accompanied by a
|
| 259 |
+
written offer, valid for at least three years and valid for as
|
| 260 |
+
long as you offer spare parts or customer support for that product
|
| 261 |
+
model, to give anyone who possesses the object code either (1) a
|
| 262 |
+
copy of the Corresponding Source for all the software in the
|
| 263 |
+
product that is covered by this License, on a durable physical
|
| 264 |
+
medium customarily used for software interchange, for a price no
|
| 265 |
+
more than your reasonable cost of physically performing this
|
| 266 |
+
conveying of source, or (2) access to copy the
|
| 267 |
+
Corresponding Source from a network server at no charge.
|
| 268 |
+
|
| 269 |
+
c) Convey individual copies of the object code with a copy of the
|
| 270 |
+
written offer to provide the Corresponding Source. This
|
| 271 |
+
alternative is allowed only occasionally and noncommercially, and
|
| 272 |
+
only if you received the object code with such an offer, in accord
|
| 273 |
+
with subsection 6b.
|
| 274 |
+
|
| 275 |
+
d) Convey the object code by offering access from a designated
|
| 276 |
+
place (gratis or for a charge), and offer equivalent access to the
|
| 277 |
+
Corresponding Source in the same way through the same place at no
|
| 278 |
+
further charge. You need not require recipients to copy the
|
| 279 |
+
Corresponding Source along with the object code. If the place to
|
| 280 |
+
copy the object code is a network server, the Corresponding Source
|
| 281 |
+
may be on a different server (operated by you or a third party)
|
| 282 |
+
that supports equivalent copying facilities, provided you maintain
|
| 283 |
+
clear directions next to the object code saying where to find the
|
| 284 |
+
Corresponding Source. Regardless of what server hosts the
|
| 285 |
+
Corresponding Source, you remain obligated to ensure that it is
|
| 286 |
+
available for as long as needed to satisfy these requirements.
|
| 287 |
+
|
| 288 |
+
e) Convey the object code using peer-to-peer transmission, provided
|
| 289 |
+
you inform other peers where the object code and Corresponding
|
| 290 |
+
Source of the work are being offered to the general public at no
|
| 291 |
+
charge under subsection 6d.
|
| 292 |
+
|
| 293 |
+
A separable portion of the object code, whose source code is excluded
|
| 294 |
+
from the Corresponding Source as a System Library, need not be
|
| 295 |
+
included in conveying the object code work.
|
| 296 |
+
|
| 297 |
+
A "User Product" is either (1) a "consumer product", which means any
|
| 298 |
+
tangible personal property which is normally used for personal, family,
|
| 299 |
+
or household purposes, or (2) anything designed or sold for incorporation
|
| 300 |
+
into a dwelling. In determining whether a product is a consumer product,
|
| 301 |
+
doubtful cases shall be resolved in favor of coverage. For a particular
|
| 302 |
+
product received by a particular user, "normally used" refers to a
|
| 303 |
+
typical or common use of that class of product, regardless of the status
|
| 304 |
+
of the particular user or of the way in which the particular user
|
| 305 |
+
actually uses, or expects or is expected to use, the product. A product
|
| 306 |
+
is a consumer product regardless of whether the product has substantial
|
| 307 |
+
commercial, industrial or non-consumer uses, unless such uses represent
|
| 308 |
+
the only significant mode of use of the product.
|
| 309 |
+
|
| 310 |
+
"Installation Information" for a User Product means any methods,
|
| 311 |
+
procedures, authorization keys, or other information required to install
|
| 312 |
+
and execute modified versions of a covered work in that User Product from
|
| 313 |
+
a modified version of its Corresponding Source. The information must
|
| 314 |
+
suffice to ensure that the continued functioning of the modified object
|
| 315 |
+
code is in no case prevented or interfered with solely because
|
| 316 |
+
modification has been made.
|
| 317 |
+
|
| 318 |
+
If you convey an object code work under this section in, or with, or
|
| 319 |
+
specifically for use in, a User Product, and the conveying occurs as
|
| 320 |
+
part of a transaction in which the right of possession and use of the
|
| 321 |
+
User Product is transferred to the recipient in perpetuity or for a
|
| 322 |
+
fixed term (regardless of how the transaction is characterized), the
|
| 323 |
+
Corresponding Source conveyed under this section must be accompanied
|
| 324 |
+
by the Installation Information. But this requirement does not apply
|
| 325 |
+
if neither you nor any third party retains the ability to install
|
| 326 |
+
modified object code on the User Product (for example, the work has
|
| 327 |
+
been installed in ROM).
|
| 328 |
+
|
| 329 |
+
The requirement to provide Installation Information does not include a
|
| 330 |
+
requirement to continue to provide support service, warranty, or updates
|
| 331 |
+
for a work that has been modified or installed by the recipient, or for
|
| 332 |
+
the User Product in which it has been modified or installed. Access to a
|
| 333 |
+
network may be denied when the modification itself materially and
|
| 334 |
+
adversely affects the operation of the network or violates the rules and
|
| 335 |
+
protocols for communication across the network.
|
| 336 |
+
|
| 337 |
+
Corresponding Source conveyed, and Installation Information provided,
|
| 338 |
+
in accord with this section must be in a format that is publicly
|
| 339 |
+
documented (and with an implementation available to the public in
|
| 340 |
+
source code form), and must require no special password or key for
|
| 341 |
+
unpacking, reading or copying.
|
| 342 |
+
|
| 343 |
+
7. Additional Terms.
|
| 344 |
+
|
| 345 |
+
"Additional permissions" are terms that supplement the terms of this
|
| 346 |
+
License by making exceptions from one or more of its conditions.
|
| 347 |
+
Additional permissions that are applicable to the entire Program shall
|
| 348 |
+
be treated as though they were included in this License, to the extent
|
| 349 |
+
that they are valid under applicable law. If additional permissions
|
| 350 |
+
apply only to part of the Program, that part may be used separately
|
| 351 |
+
under those permissions, but the entire Program remains governed by
|
| 352 |
+
this License without regard to the additional permissions.
|
| 353 |
+
|
| 354 |
+
When you convey a copy of a covered work, you may at your option
|
| 355 |
+
remove any additional permissions from that copy, or from any part of
|
| 356 |
+
it. (Additional permissions may be written to require their own
|
| 357 |
+
removal in certain cases when you modify the work.) You may place
|
| 358 |
+
additional permissions on material, added by you to a covered work,
|
| 359 |
+
for which you have or can give appropriate copyright permission.
|
| 360 |
+
|
| 361 |
+
Notwithstanding any other provision of this License, for material you
|
| 362 |
+
add to a covered work, you may (if authorized by the copyright holders of
|
| 363 |
+
that material) supplement the terms of this License with terms:
|
| 364 |
+
|
| 365 |
+
a) Disclaiming warranty or limiting liability differently from the
|
| 366 |
+
terms of sections 15 and 16 of this License; or
|
| 367 |
+
|
| 368 |
+
b) Requiring preservation of specified reasonable legal notices or
|
| 369 |
+
author attributions in that material or in the Appropriate Legal
|
| 370 |
+
Notices displayed by works containing it; or
|
| 371 |
+
|
| 372 |
+
c) Prohibiting misrepresentation of the origin of that material, or
|
| 373 |
+
requiring that modified versions of such material be marked in
|
| 374 |
+
reasonable ways as different from the original version; or
|
| 375 |
+
|
| 376 |
+
d) Limiting the use for publicity purposes of names of licensors or
|
| 377 |
+
authors of the material; or
|
| 378 |
+
|
| 379 |
+
e) Declining to grant rights under trademark law for use of some
|
| 380 |
+
trade names, trademarks, or service marks; or
|
| 381 |
+
|
| 382 |
+
f) Requiring indemnification of licensors and authors of that
|
| 383 |
+
material by anyone who conveys the material (or modified versions of
|
| 384 |
+
it) with contractual assumptions of liability to the recipient, for
|
| 385 |
+
any liability that these contractual assumptions directly impose on
|
| 386 |
+
those licensors and authors.
|
| 387 |
+
|
| 388 |
+
All other non-permissive additional terms are considered "further
|
| 389 |
+
restrictions" within the meaning of section 10. If the Program as you
|
| 390 |
+
received it, or any part of it, contains a notice stating that it is
|
| 391 |
+
governed by this License along with a term that is a further
|
| 392 |
+
restriction, you may remove that term. If a license document contains
|
| 393 |
+
a further restriction but permits relicensing or conveying under this
|
| 394 |
+
License, you may add to a covered work material governed by the terms
|
| 395 |
+
of that license document, provided that the further restriction does
|
| 396 |
+
not survive such relicensing or conveying.
|
| 397 |
+
|
| 398 |
+
If you add terms to a covered work in accord with this section, you
|
| 399 |
+
must place, in the relevant source files, a statement of the
|
| 400 |
+
additional terms that apply to those files, or a notice indicating
|
| 401 |
+
where to find the applicable terms.
|
| 402 |
+
|
| 403 |
+
Additional terms, permissive or non-permissive, may be stated in the
|
| 404 |
+
form of a separately written license, or stated as exceptions;
|
| 405 |
+
the above requirements apply either way.
|
| 406 |
+
|
| 407 |
+
8. Termination.
|
| 408 |
+
|
| 409 |
+
You may not propagate or modify a covered work except as expressly
|
| 410 |
+
provided under this License. Any attempt otherwise to propagate or
|
| 411 |
+
modify it is void, and will automatically terminate your rights under
|
| 412 |
+
this License (including any patent licenses granted under the third
|
| 413 |
+
paragraph of section 11).
|
| 414 |
+
|
| 415 |
+
However, if you cease all violation of this License, then your
|
| 416 |
+
license from a particular copyright holder is reinstated (a)
|
| 417 |
+
provisionally, unless and until the copyright holder explicitly and
|
| 418 |
+
finally terminates your license, and (b) permanently, if the copyright
|
| 419 |
+
holder fails to notify you of the violation by some reasonable means
|
| 420 |
+
prior to 60 days after the cessation.
|
| 421 |
+
|
| 422 |
+
Moreover, your license from a particular copyright holder is
|
| 423 |
+
reinstated permanently if the copyright holder notifies you of the
|
| 424 |
+
violation by some reasonable means, this is the first time you have
|
| 425 |
+
received notice of violation of this License (for any work) from that
|
| 426 |
+
copyright holder, and you cure the violation prior to 30 days after
|
| 427 |
+
your receipt of the notice.
|
| 428 |
+
|
| 429 |
+
Termination of your rights under this section does not terminate the
|
| 430 |
+
licenses of parties who have received copies or rights from you under
|
| 431 |
+
this License. If your rights have been terminated and not permanently
|
| 432 |
+
reinstated, you do not qualify to receive new licenses for the same
|
| 433 |
+
material under section 10.
|
| 434 |
+
|
| 435 |
+
9. Acceptance Not Required for Having Copies.
|
| 436 |
+
|
| 437 |
+
You are not required to accept this License in order to receive or
|
| 438 |
+
run a copy of the Program. Ancillary propagation of a covered work
|
| 439 |
+
occurring solely as a consequence of using peer-to-peer transmission
|
| 440 |
+
to receive a copy likewise does not require acceptance. However,
|
| 441 |
+
nothing other than this License grants you permission to propagate or
|
| 442 |
+
modify any covered work. These actions infringe copyright if you do
|
| 443 |
+
not accept this License. Therefore, by modifying or propagating a
|
| 444 |
+
covered work, you indicate your acceptance of this License to do so.
|
| 445 |
+
|
| 446 |
+
10. Automatic Licensing of Downstream Recipients.
|
| 447 |
+
|
| 448 |
+
Each time you convey a covered work, the recipient automatically
|
| 449 |
+
receives a license from the original licensors, to run, modify and
|
| 450 |
+
propagate that work, subject to this License. You are not responsible
|
| 451 |
+
for enforcing compliance by third parties with this License.
|
| 452 |
+
|
| 453 |
+
An "entity transaction" is a transaction transferring control of an
|
| 454 |
+
organization, or substantially all assets of one, or subdividing an
|
| 455 |
+
organization, or merging organizations. If propagation of a covered
|
| 456 |
+
work results from an entity transaction, each party to that
|
| 457 |
+
transaction who receives a copy of the work also receives whatever
|
| 458 |
+
licenses to the work the party's predecessor in interest had or could
|
| 459 |
+
give under the previous paragraph, plus a right to possession of the
|
| 460 |
+
Corresponding Source of the work from the predecessor in interest, if
|
| 461 |
+
the predecessor has it or can get it with reasonable efforts.
|
| 462 |
+
|
| 463 |
+
You may not impose any further restrictions on the exercise of the
|
| 464 |
+
rights granted or affirmed under this License. For example, you may
|
| 465 |
+
not impose a license fee, royalty, or other charge for exercise of
|
| 466 |
+
rights granted under this License, and you may not initiate litigation
|
| 467 |
+
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
| 468 |
+
any patent claim is infringed by making, using, selling, offering for
|
| 469 |
+
sale, or importing the Program or any portion of it.
|
| 470 |
+
|
| 471 |
+
11. Patents.
|
| 472 |
+
|
| 473 |
+
A "contributor" is a copyright holder who authorizes use under this
|
| 474 |
+
License of the Program or a work on which the Program is based. The
|
| 475 |
+
work thus licensed is called the contributor's "contributor version".
|
| 476 |
+
|
| 477 |
+
A contributor's "essential patent claims" are all patent claims
|
| 478 |
+
owned or controlled by the contributor, whether already acquired or
|
| 479 |
+
hereafter acquired, that would be infringed by some manner, permitted
|
| 480 |
+
by this License, of making, using, or selling its contributor version,
|
| 481 |
+
but do not include claims that would be infringed only as a
|
| 482 |
+
consequence of further modification of the contributor version. For
|
| 483 |
+
purposes of this definition, "control" includes the right to grant
|
| 484 |
+
patent sublicenses in a manner consistent with the requirements of
|
| 485 |
+
this License.
|
| 486 |
+
|
| 487 |
+
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
| 488 |
+
patent license under the contributor's essential patent claims, to
|
| 489 |
+
make, use, sell, offer for sale, import and otherwise run, modify and
|
| 490 |
+
propagate the contents of its contributor version.
|
| 491 |
+
|
| 492 |
+
In the following three paragraphs, a "patent license" is any express
|
| 493 |
+
agreement or commitment, however denominated, not to enforce a patent
|
| 494 |
+
(such as an express permission to practice a patent or covenant not to
|
| 495 |
+
sue for patent infringement). To "grant" such a patent license to a
|
| 496 |
+
party means to make such an agreement or commitment not to enforce a
|
| 497 |
+
patent against the party.
|
| 498 |
+
|
| 499 |
+
If you convey a covered work, knowingly relying on a patent license,
|
| 500 |
+
and the Corresponding Source of the work is not available for anyone
|
| 501 |
+
to copy, free of charge and under the terms of this License, through a
|
| 502 |
+
publicly available network server or other readily accessible means,
|
| 503 |
+
then you must either (1) cause the Corresponding Source to be so
|
| 504 |
+
available, or (2) arrange to deprive yourself of the benefit of the
|
| 505 |
+
patent license for this particular work, or (3) arrange, in a manner
|
| 506 |
+
consistent with the requirements of this License, to extend the patent
|
| 507 |
+
license to downstream recipients. "Knowingly relying" means you have
|
| 508 |
+
actual knowledge that, but for the patent license, your conveying the
|
| 509 |
+
covered work in a country, or your recipient's use of the covered work
|
| 510 |
+
in a country, would infringe one or more identifiable patents in that
|
| 511 |
+
country that you have reason to believe are valid.
|
| 512 |
+
|
| 513 |
+
If, pursuant to or in connection with a single transaction or
|
| 514 |
+
arrangement, you convey, or propagate by procuring conveyance of, a
|
| 515 |
+
covered work, and grant a patent license to some of the parties
|
| 516 |
+
receiving the covered work authorizing them to use, propagate, modify
|
| 517 |
+
or convey a specific copy of the covered work, then the patent license
|
| 518 |
+
you grant is automatically extended to all recipients of the covered
|
| 519 |
+
work and works based on it.
|
| 520 |
+
|
| 521 |
+
A patent license is "discriminatory" if it does not include within
|
| 522 |
+
the scope of its coverage, prohibits the exercise of, or is
|
| 523 |
+
conditioned on the non-exercise of one or more of the rights that are
|
| 524 |
+
specifically granted under this License. You may not convey a covered
|
| 525 |
+
work if you are a party to an arrangement with a third party that is
|
| 526 |
+
in the business of distributing software, under which you make payment
|
| 527 |
+
to the third party based on the extent of your activity of conveying
|
| 528 |
+
the work, and under which the third party grants, to any of the
|
| 529 |
+
parties who would receive the covered work from you, a discriminatory
|
| 530 |
+
patent license (a) in connection with copies of the covered work
|
| 531 |
+
conveyed by you (or copies made from those copies), or (b) primarily
|
| 532 |
+
for and in connection with specific products or compilations that
|
| 533 |
+
contain the covered work, unless you entered into that arrangement,
|
| 534 |
+
or that patent license was granted, prior to 28 March 2007.
|
| 535 |
+
|
| 536 |
+
Nothing in this License shall be construed as excluding or limiting
|
| 537 |
+
any implied license or other defenses to infringement that may
|
| 538 |
+
otherwise be available to you under applicable patent law.
|
| 539 |
+
|
| 540 |
+
12. No Surrender of Others' Freedom.
|
| 541 |
+
|
| 542 |
+
If conditions are imposed on you (whether by court order, agreement or
|
| 543 |
+
otherwise) that contradict the conditions of this License, they do not
|
| 544 |
+
excuse you from the conditions of this License. If you cannot convey a
|
| 545 |
+
covered work so as to satisfy simultaneously your obligations under this
|
| 546 |
+
License and any other pertinent obligations, then as a consequence you may
|
| 547 |
+
not convey it at all. For example, if you agree to terms that obligate you
|
| 548 |
+
to collect a royalty for further conveying from those to whom you convey
|
| 549 |
+
the Program, the only way you could satisfy both those terms and this
|
| 550 |
+
License would be to refrain entirely from conveying the Program.
|
| 551 |
+
|
| 552 |
+
13. Use with the GNU Affero General Public License.
|
| 553 |
+
|
| 554 |
+
Notwithstanding any other provision of this License, you have
|
| 555 |
+
permission to link or combine any covered work with a work licensed
|
| 556 |
+
under version 3 of the GNU Affero General Public License into a single
|
| 557 |
+
combined work, and to convey the resulting work. The terms of this
|
| 558 |
+
License will continue to apply to the part which is the covered work,
|
| 559 |
+
but the special requirements of the GNU Affero General Public License,
|
| 560 |
+
section 13, concerning interaction through a network will apply to the
|
| 561 |
+
combination as such.
|
| 562 |
+
|
| 563 |
+
14. Revised Versions of this License.
|
| 564 |
+
|
| 565 |
+
The Free Software Foundation may publish revised and/or new versions of
|
| 566 |
+
the GNU General Public License from time to time. Such new versions will
|
| 567 |
+
be similar in spirit to the present version, but may differ in detail to
|
| 568 |
+
address new problems or concerns.
|
| 569 |
+
|
| 570 |
+
Each version is given a distinguishing version number. If the
|
| 571 |
+
Program specifies that a certain numbered version of the GNU General
|
| 572 |
+
Public License "or any later version" applies to it, you have the
|
| 573 |
+
option of following the terms and conditions either of that numbered
|
| 574 |
+
version or of any later version published by the Free Software
|
| 575 |
+
Foundation. If the Program does not specify a version number of the
|
| 576 |
+
GNU General Public License, you may choose any version ever published
|
| 577 |
+
by the Free Software Foundation.
|
| 578 |
+
|
| 579 |
+
If the Program specifies that a proxy can decide which future
|
| 580 |
+
versions of the GNU General Public License can be used, that proxy's
|
| 581 |
+
public statement of acceptance of a version permanently authorizes you
|
| 582 |
+
to choose that version for the Program.
|
| 583 |
+
|
| 584 |
+
Later license versions may give you additional or different
|
| 585 |
+
permissions. However, no additional obligations are imposed on any
|
| 586 |
+
author or copyright holder as a result of your choosing to follow a
|
| 587 |
+
later version.
|
| 588 |
+
|
| 589 |
+
15. Disclaimer of Warranty.
|
| 590 |
+
|
| 591 |
+
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
| 592 |
+
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
| 593 |
+
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
| 594 |
+
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
| 595 |
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
| 596 |
+
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
| 597 |
+
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
| 598 |
+
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
| 599 |
+
|
| 600 |
+
16. Limitation of Liability.
|
| 601 |
+
|
| 602 |
+
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
| 603 |
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
| 604 |
+
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
| 605 |
+
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
| 606 |
+
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
| 607 |
+
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
| 608 |
+
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
| 609 |
+
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
| 610 |
+
SUCH DAMAGES.
|
| 611 |
+
|
| 612 |
+
17. Interpretation of Sections 15 and 16.
|
| 613 |
+
|
| 614 |
+
If the disclaimer of warranty and limitation of liability provided
|
| 615 |
+
above cannot be given local legal effect according to their terms,
|
| 616 |
+
reviewing courts shall apply local law that most closely approximates
|
| 617 |
+
an absolute waiver of all civil liability in connection with the
|
| 618 |
+
Program, unless a warranty or assumption of liability accompanies a
|
| 619 |
+
copy of the Program in return for a fee.
|
| 620 |
+
|
| 621 |
+
END OF TERMS AND CONDITIONS
|
| 622 |
+
|
| 623 |
+
How to Apply These Terms to Your New Programs
|
| 624 |
+
|
| 625 |
+
If you develop a new program, and you want it to be of the greatest
|
| 626 |
+
possible use to the public, the best way to achieve this is to make it
|
| 627 |
+
free software which everyone can redistribute and change under these terms.
|
| 628 |
+
|
| 629 |
+
To do so, attach the following notices to the program. It is safest
|
| 630 |
+
to attach them to the start of each source file to most effectively
|
| 631 |
+
state the exclusion of warranty; and each file should have at least
|
| 632 |
+
the "copyright" line and a pointer to where the full notice is found.
|
| 633 |
+
|
| 634 |
+
<one line to give the program's name and a brief idea of what it does.>
|
| 635 |
+
Copyright (C) <year> <name of author>
|
| 636 |
+
|
| 637 |
+
This program is free software: you can redistribute it and/or modify
|
| 638 |
+
it under the terms of the GNU General Public License as published by
|
| 639 |
+
the Free Software Foundation, either version 3 of the License, or
|
| 640 |
+
(at your option) any later version.
|
| 641 |
+
|
| 642 |
+
This program is distributed in the hope that it will be useful,
|
| 643 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 644 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 645 |
+
GNU General Public License for more details.
|
| 646 |
+
|
| 647 |
+
You should have received a copy of the GNU General Public License
|
| 648 |
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 649 |
+
|
| 650 |
+
Also add information on how to contact you by electronic and paper mail.
|
| 651 |
+
|
| 652 |
+
If the program does terminal interaction, make it output a short
|
| 653 |
+
notice like this when it starts in an interactive mode:
|
| 654 |
+
|
| 655 |
+
<program> Copyright (C) <year> <name of author>
|
| 656 |
+
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
| 657 |
+
This is free software, and you are welcome to redistribute it
|
| 658 |
+
under certain conditions; type `show c' for details.
|
| 659 |
+
|
| 660 |
+
The hypothetical commands `show w' and `show c' should show the appropriate
|
| 661 |
+
parts of the General Public License. Of course, your program's commands
|
| 662 |
+
might be different; for a GUI interface, you would use an "about box".
|
| 663 |
+
|
| 664 |
+
You should also get your employer (if you work as a programmer) or school,
|
| 665 |
+
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
| 666 |
+
For more information on this, and how to apply and follow the GNU GPL, see
|
| 667 |
+
<http://www.gnu.org/licenses/>.
|
| 668 |
+
|
| 669 |
+
The GNU General Public License does not permit incorporating your program
|
| 670 |
+
into proprietary programs. If your program is a subroutine library, you
|
| 671 |
+
may consider it more useful to permit linking proprietary applications with
|
| 672 |
+
the library. If this is what you want to do, use the GNU Lesser General
|
| 673 |
+
Public License instead of this License. But first, please read
|
| 674 |
+
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
README.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+

|
| 2 |
+
[](https://app.codacy.com/gh/TeamAmaze/AmazeFileManager?utm_source=github.com&utm_medium=referral&utm_content=TeamAmaze/AmazeFileManager&utm_campaign=Badge_Grade_Settings)
|
| 3 |
+
[](https://www.codacy.com/gh/TeamAmaze/AmazeFileManager?utm_source=github.com&utm_medium=referral&utm_content=TeamAmaze/AmazeFileManager&utm_campaign=Badge_Coverage)
|
| 4 |
+
[](https://www.appbrain.com/app/amaze-file-manager/com.amaze.filemanager)
|
| 5 |
+
[](https://github.com/TeamAmaze/AmazeFileManager/releases)
|
| 6 |
+
[](https://apt.izzysoft.de/fdroid/index/apk/com.amaze.filemanager)
|
| 7 |
+
[](https://t.me/AmazeFileManager)
|
| 8 |
+
[](http://forum.xda-developers.com/android/apps-games/app-amaze-file-managermaterial-theme-t2937314)
|
| 9 |
+
[](https://liberapay.com/Team-Amaze/donate)
|
| 10 |
+
|
| 11 |
+
# <a href="https://teamamaze.xyz">Amaze File Manager</a>
|
| 12 |
+
|
| 13 |
+
Simple and attractive Material Design file manager for Android
|
| 14 |
+
|
| 15 |
+
Overview
|
| 16 |
+
---
|
| 17 |
+
|
| 18 |
+
<img src="icon.png" align="right" width="40%" height="100%"></img>
|
| 19 |
+
|
| 20 |
+
<div style="display:flex;">
|
| 21 |
+
|
| 22 |
+
- Open Source, light and smooth
|
| 23 |
+
- Based on Material Design guidelines
|
| 24 |
+
- Basic features like cut, copy, delete, compress, extract etc. easily accessible
|
| 25 |
+
- Work on multiple tabs at same time
|
| 26 |
+
- Multiple themes with cool icons
|
| 27 |
+
- Navigation drawer for quick navigation
|
| 28 |
+
- App Manager to open, backup, or directly uninstall any app
|
| 29 |
+
- Quickly access history, access bookmarks or search for any file
|
| 30 |
+
- Root explorer for advanced users
|
| 31 |
+
- AES Encryption and Decryption of files for security (Jellybean v4.3+)
|
| 32 |
+
- Cloud services support (Jellybean v4.3+ / requires additional plug-in)
|
| 33 |
+
- Inbuilt Database Reader, Zip/Rar Reader, Apk Reader, Text Reader
|
| 34 |
+
- No ads or In-app purchases
|
| 35 |
+
- lots more...
|
| 36 |
+
|
| 37 |
+
</div>
|
| 38 |
+
|
| 39 |
+
Downloads
|
| 40 |
+
---
|
| 41 |
+
|
| 42 |
+
[<img alt="Get it on Google Play" height="80" src="https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png">](https://play.google.com/store/apps/details?id=com.amaze.filemanager)
|
| 43 |
+
[<img alt="Get it on F-Droid" height="80" src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png">](https://f-droid.org/packages/com.amaze.filemanager/)
|
| 44 |
+
[<img alt="Get it on IzzyOnDroid" height="80" src="https://gitlab.com/IzzyOnDroid/repo/-/raw/master/assets/IzzyOnDroid.png">](https://apt.izzysoft.de/fdroid/index/apk/com.amaze.filemanager)
|
| 45 |
+
[<img alt="Get it on GitHub" height="80" src="https://i.ibb.co/q0mdc4Z/get-it-on-github.png">](https://github.com/TeamAmaze/AmazeFileManager/releases/latest)
|
| 46 |
+
[<img alt="Get it on AFH" height="50px" src="https://www.androidfilehost.com/images/afh.png">](https://www.androidfilehost.com/?w=files&flid=73967)
|
| 47 |
+
|
| 48 |
+
Contribute
|
| 49 |
+
---
|
| 50 |
+
You can contribute via one of the following ways:
|
| 51 |
+
- Help us with the translations of either [Amaze File Manager](https://app.transifex.com/amaze/amaze-file-manager) or [Amaze Utilities](https://crowdin.com/project/amaze-file-utilities)
|
| 52 |
+
- [Contribute](https://github.com/TeamAmaze/AmazeFileManager/blob/release/4.0/CONTRIBUTING.md) directly to the code, help us in fixing the bugs / implement new features.
|
| 53 |
+
|
| 54 |
+
_If we feel your contribution is a significant help to us, we'll award you a bounty with any of your preferred mode of payment._
|
| 55 |
+
|
| 56 |
+
Support
|
| 57 |
+
---
|
| 58 |
+
<a href="https://opencollective.com/TeamAmaze"><img width="20%" alt="OpenCollective" src="opencollective.svg" ></a>
|
| 59 |
+
<a href="https://www.paypal.me/vishalnehra"><img width="20%" src="paypal.svg" alt="PayPal"></a>
|
| 60 |
+
<a href="https://liberapay.com/Team-Amaze/donate"><img src="https://upload.wikimedia.org/wikipedia/commons/2/27/Liberapay_logo_v2_white-on-yellow.svg" alt="Liberapay" width="80px" ></a>
|
| 61 |
+
Or buy the [Cloud Plugin](https://play.google.com/store/apps/details?id=com.filemanager.amazecloud) supports Google Drive™, Dropbox, OneDrive and Box accounts.
|
| 62 |
+
Try our app - [Amaze File Utilities](https://play.google.com/store/apps/details?id=com.amaze.fileutilities) ([Fdroid](https://f-droid.org/en/packages/com.amaze.fileutilities/))
|
| 63 |
+
1. List videos / images / music documents in your device in a interactive UI where you're able to group / sort and quickly jump to any headers.
|
| 64 |
+
2. Open videos / images / music / documents (pdf / docx / epub) with inbuilt player.
|
| 65 |
+
3. Share / delete / cast on your tv
|
| 66 |
+
4. Analyse internal storage for junk files, duplicate files, large videos / old downloads / screenshots or recordings.
|
| 67 |
+
5. Analyse and group images between memes, low light / blurry / selfies / group pics.
|
| 68 |
+
7. Transfer files directly between two mobile devices on same wifi network using high speed peer to peer network
|
| 69 |
+
8. Gesture support in image / video player, play in background, picture in picture mode, download subtitles within the player.
|
| 70 |
+
|
| 71 |
+
Warning
|
| 72 |
+
---
|
| 73 |
+
|
| 74 |
+
Basic r/w operations might not work on external memory on Kitkat devices. Don't use cut/paste from or to external SD Card. You might lose your files.
|
| 75 |
+
|
| 76 |
+
***Under the license we are not responsible for damages.***
|
| 77 |
+
|
| 78 |
+
See our [Privacy Policy](https://github.com/TeamAmaze/AmazeFileManager/wiki/Privacy-Policy)
|
| 79 |
+
|
| 80 |
+
Vendors/Developers
|
| 81 |
+
----
|
| 82 |
+
The device vendors/ROM developers are free to include Amaze apk pre-installed in system. There is no fee required; *but you must comply with the license* (for more information read the [GNU GPL v3](https://www.gnu.org/licenses/gpl-3.0.en.html) or newer).
|
| 83 |
+
|
| 84 |
+
We strongly recommend using apk signed by us (either Play Store version or from AFH link above) so that users would be able to update directly from Play Store after distribution. Furthermore, a change in digital signature will break plug-ins.
|
| 85 |
+
|
| 86 |
+
### License:
|
| 87 |
+
|
| 88 |
+
Copyright (C) 2014-2018 Arpit Khurana <arpitkh96@gmail.com>
|
| 89 |
+
Copyright (C) 2014-2024 Vishal Nehra <vishalmeham2@gmail.com>
|
| 90 |
+
Copyright (C) 2017-2024 Emmanuel Messulam <emmanuelbendavid@gmail.com>
|
| 91 |
+
Copyright (C) 2018-2024 Raymond Lai <airwave209gt at gmail.com>
|
| 92 |
+
Copyright (C) 2019-2024 Vishnu Sanal T <t.v.s10123 at gmail.com>
|
| 93 |
+
This file is part of Amaze File Manager.
|
| 94 |
+
Amaze File Manager is free software: you can redistribute it and/or modify
|
| 95 |
+
it under the terms of the GNU General Public License as published by
|
| 96 |
+
the Free Software Foundation, either version 3 of the License, or
|
| 97 |
+
(at your option) any later version.
|
| 98 |
+
This program is distributed in the hope that it will be useful,
|
| 99 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 100 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 101 |
+
GNU General Public License for more details.
|
| 102 |
+
You should have received a copy of the GNU General Public License
|
| 103 |
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
SECURITY.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Security Policy
|
| 2 |
+
|
| 3 |
+
## Supported Versions
|
| 4 |
+
|
| 5 |
+
`v3.8.5` supports Android 4.0 and above.
|
| 6 |
+
`v4.x.x` would only support Android 4.4 and above.
|
| 7 |
+
|
| 8 |
+
Android devices that runs Android versions less that Android 4.4
|
| 9 |
+
(Android KitKat) would not receive any more updates (the latest
|
| 10 |
+
supported version would be `v3.8.5`).
|
| 11 |
+
|
| 12 |
+
## Reporting a Vulnerability
|
| 13 |
+
|
| 14 |
+
Feel free to contact us via `support@teamamaze.xyz`.
|
| 15 |
+
|
| 16 |
+
Please CC the maintainers too:
|
| 17 |
+
- `vishalmeham2@gmail.com`
|
| 18 |
+
- `airwave209gt@gmail.com`
|
| 19 |
+
- `emmanuelbendavid@gmail.com`
|
| 20 |
+
- `t.v.s10123@gmail.com`
|
amaze.license.spotless.txt
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright (C) 2014-$YEAR Arpit Khurana <arpitkh96@gmail.com>, Vishal Nehra <vishalmeham2@gmail.com>,
|
| 3 |
+
* Emmanuel Messulam<emmanuelbendavid@gmail.com>, Raymond Lai <airwave209gt at gmail.com> and Contributors.
|
| 4 |
+
*
|
| 5 |
+
* This file is part of Amaze File Manager.
|
| 6 |
+
*
|
| 7 |
+
* Amaze File Manager is free software: you can redistribute it and/or modify
|
| 8 |
+
* it under the terms of the GNU General Public License as published by
|
| 9 |
+
* the Free Software Foundation, either version 3 of the License, or
|
| 10 |
+
* (at your option) any later version.
|
| 11 |
+
*
|
| 12 |
+
* This program is distributed in the hope that it will be useful,
|
| 13 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 |
+
* GNU General Public License for more details.
|
| 16 |
+
*
|
| 17 |
+
* You should have received a copy of the GNU General Public License
|
| 18 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 19 |
+
*/
|
| 20 |
+
|
app/.gitignore
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/build
|
| 2 |
+
.attach_pid*
|
app/build.gradle
ADDED
|
@@ -0,0 +1,342 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
apply plugin: 'com.android.application'
|
| 2 |
+
apply plugin: 'kotlin-android'
|
| 3 |
+
apply plugin: 'kotlin-kapt'
|
| 4 |
+
apply plugin: 'kotlin-parcelize'
|
| 5 |
+
apply plugin: "com.mxalbert.gradle.jacoco-android"
|
| 6 |
+
apply plugin: "com.starter.easylauncher"
|
| 7 |
+
apply plugin: 'com.google.devtools.ksp'
|
| 8 |
+
|
| 9 |
+
android {
|
| 10 |
+
namespace "com.amaze.filemanager"
|
| 11 |
+
compileSdk libs.versions.compileSdk.get().toInteger()
|
| 12 |
+
packagingOptions {
|
| 13 |
+
resources {
|
| 14 |
+
excludes += ['proguard-project.txt', 'project.properties', 'META-INF/LICENSE.txt', 'META-INF/LICENSE', 'META-INF/NOTICE.txt', 'META-INF/NOTICE', 'META-INF/DEPENDENCIES.txt', 'META-INF/DEPENDENCIES', 'META-INF/versions/9/OSGI-INF/MANIFEST.MF']
|
| 15 |
+
}
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
defaultConfig {
|
| 19 |
+
applicationId "com.amaze.filemanager"
|
| 20 |
+
minSdkVersion libs.versions.minSdk.get().toInteger()
|
| 21 |
+
targetSdkVersion libs.versions.targetSdk.get().toInteger()
|
| 22 |
+
versionCode 123
|
| 23 |
+
versionName "3.11.1"
|
| 24 |
+
multiDexEnabled true
|
| 25 |
+
|
| 26 |
+
vectorDrawables.useSupportLibrary = true
|
| 27 |
+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
| 28 |
+
|
| 29 |
+
javaCompileOptions {
|
| 30 |
+
annotationProcessorOptions {
|
| 31 |
+
arguments += ["room.schemaLocation" : "$projectDir/src/test/resources/schemas".toString(),
|
| 32 |
+
"room.incremental" : "true",
|
| 33 |
+
"room.expandProjection": "true"]
|
| 34 |
+
}
|
| 35 |
+
}
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
signingConfigs {
|
| 39 |
+
release
|
| 40 |
+
config
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
buildTypes {
|
| 44 |
+
debug {
|
| 45 |
+
applicationIdSuffix ".debug"
|
| 46 |
+
minifyEnabled false
|
| 47 |
+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.cfg'
|
| 48 |
+
testProguardFile 'tests-proguard.cfg'
|
| 49 |
+
buildConfigField "String", "CRYPTO_IV", "\"LxbHiJhhUXcj\""
|
| 50 |
+
buildConfigField "String", "FTP_SERVER_KEYSTORE_PASSWORD", "\"vishal007\""
|
| 51 |
+
debuggable true //For "debug" banner on icon
|
| 52 |
+
enableUnitTestCoverage true
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
release {
|
| 56 |
+
signingConfig signingConfigs.release
|
| 57 |
+
|
| 58 |
+
minifyEnabled true
|
| 59 |
+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.cfg'
|
| 60 |
+
buildConfigField "String", "CRYPTO_IV", "\"LxbHiJhhUXcj\""
|
| 61 |
+
buildConfigField "String", "FTP_SERVER_KEYSTORE_PASSWORD", "\"vishal007\""
|
| 62 |
+
}
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
buildFeatures {
|
| 66 |
+
viewBinding true
|
| 67 |
+
buildConfig true
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
flavorDimensions = ['static']
|
| 71 |
+
|
| 72 |
+
productFlavors {
|
| 73 |
+
fdroid {
|
| 74 |
+
dimension 'static'
|
| 75 |
+
buildConfigField "boolean", "IS_VERSION_FDROID", "true"
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
play {
|
| 79 |
+
dimension 'static'
|
| 80 |
+
buildConfigField "boolean", "IS_VERSION_FDROID", "false"
|
| 81 |
+
signingConfig signingConfigs.config
|
| 82 |
+
}
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
dependenciesInfo {
|
| 86 |
+
// Disables dependency metadata when building APKs.
|
| 87 |
+
includeInApk = false
|
| 88 |
+
// Disables dependency metadata when building Android App Bundles.
|
| 89 |
+
includeInBundle = false
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
sourceSets {
|
| 93 |
+
test.java.srcDirs += '../testShared/src/test/java'
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
compileOptions {
|
| 97 |
+
sourceCompatibility JavaVersion.VERSION_17
|
| 98 |
+
targetCompatibility JavaVersion.VERSION_17
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
kotlinOptions {
|
| 102 |
+
jvmTarget = '17'
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
testOptions {
|
| 106 |
+
unitTests {
|
| 107 |
+
includeAndroidResources = true
|
| 108 |
+
returnDefaultValues = true
|
| 109 |
+
}
|
| 110 |
+
}
|
| 111 |
+
lint {
|
| 112 |
+
abortOnError false
|
| 113 |
+
}
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
dependencies {
|
| 117 |
+
|
| 118 |
+
modules {
|
| 119 |
+
module("org.bouncycastle:bcprov-jdk15on") {
|
| 120 |
+
replacedBy("org.bouncycastle:bcprov-jdk18on")
|
| 121 |
+
}
|
| 122 |
+
module("org.bouncycastle:bcpkix-jdk15on") {
|
| 123 |
+
replacedBy("org.bouncycastle:bcpkix-jdk18on")
|
| 124 |
+
}
|
| 125 |
+
module("org.bouncycastle:bcprov-jdk15to18") {
|
| 126 |
+
replacedBy("org.bouncycastle:bcprov-jdk18on")
|
| 127 |
+
}
|
| 128 |
+
module("org.bouncycastle:bcpkix-jdk15to18") {
|
| 129 |
+
replacedBy("org.bouncycastle:bcpkix-jdk18on")
|
| 130 |
+
}
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
| 134 |
+
implementation libs.systembarTint
|
| 135 |
+
|
| 136 |
+
implementation libs.androidX.vectordrawable.animated
|
| 137 |
+
implementation libs.androidX.legacySupportV13
|
| 138 |
+
implementation libs.androidX.material
|
| 139 |
+
implementation libs.androidX.fragment
|
| 140 |
+
implementation libs.androidX.appcompat
|
| 141 |
+
implementation libs.androidX.preference
|
| 142 |
+
implementation libs.androidX.core
|
| 143 |
+
implementation libs.androidX.palette
|
| 144 |
+
implementation libs.androidX.cardview
|
| 145 |
+
implementation libs.androidX.constraintLayout
|
| 146 |
+
implementation libs.androidX.multidex //Multiple dex files
|
| 147 |
+
implementation libs.androidX.biometric
|
| 148 |
+
implementation libs.room.runtime
|
| 149 |
+
implementation libs.room.rxjava2
|
| 150 |
+
|
| 151 |
+
ksp libs.room.compiler
|
| 152 |
+
ksp libs.androidX.annotation
|
| 153 |
+
|
| 154 |
+
//For tests
|
| 155 |
+
testImplementation libs.junit//tests the app logic
|
| 156 |
+
testImplementation libs.robolectric//tests android interaction
|
| 157 |
+
testImplementation libs.robolectric.shadows.httpclient//tests android interaction
|
| 158 |
+
testImplementation libs.androidX.test.core
|
| 159 |
+
testImplementation libs.androidX.test.runner
|
| 160 |
+
testImplementation libs.androidX.test.rules
|
| 161 |
+
testImplementation libs.androidX.test.ext.junit
|
| 162 |
+
testImplementation libs.androidX.fragment.testing
|
| 163 |
+
testImplementation libs.mockito.core
|
| 164 |
+
testImplementation libs.mockito.inline
|
| 165 |
+
testImplementation libs.mockito.kotlin
|
| 166 |
+
testImplementation libs.apache.sshd
|
| 167 |
+
testImplementation libs.awaitility
|
| 168 |
+
testImplementation libs.jsoup
|
| 169 |
+
testImplementation libs.room.migration
|
| 170 |
+
testImplementation libs.mockk
|
| 171 |
+
testImplementation libs.kotlin.coroutine.test
|
| 172 |
+
testImplementation libs.androidX.core.testing
|
| 173 |
+
kspTest libs.auto.service
|
| 174 |
+
testImplementation 'ch.qos.logback:logback-classic:1.4.14'
|
| 175 |
+
|
| 176 |
+
androidTestImplementation libs.junit //tests the app logic
|
| 177 |
+
androidTestImplementation libs.androidX.test.expresso
|
| 178 |
+
androidTestImplementation libs.androidX.test.core
|
| 179 |
+
androidTestImplementation libs.androidX.test.runner
|
| 180 |
+
androidTestImplementation libs.androidX.test.rules
|
| 181 |
+
androidTestImplementation libs.androidX.test.ext.junit
|
| 182 |
+
androidTestImplementation libs.androidX.test.uiautomator
|
| 183 |
+
androidTestImplementation libs.androidX.fragment.testing
|
| 184 |
+
androidTestImplementation libs.commons.net
|
| 185 |
+
androidTestImplementation libs.awaitility
|
| 186 |
+
|
| 187 |
+
//Detect memory leaks
|
| 188 |
+
debugImplementation libs.leakcanary.android
|
| 189 |
+
|
| 190 |
+
implementation libs.commons.compress
|
| 191 |
+
|
| 192 |
+
implementation libs.materialdialogs.core
|
| 193 |
+
implementation libs.materialdialogs.commons
|
| 194 |
+
|
| 195 |
+
implementation libs.apache.mina.core
|
| 196 |
+
implementation libs.apache.ftpserver.ftplet.api
|
| 197 |
+
implementation libs.apache.ftpserver.core
|
| 198 |
+
|
| 199 |
+
implementation libs.eventbus
|
| 200 |
+
|
| 201 |
+
implementation libs.libsu.core
|
| 202 |
+
implementation libs.libsu.io
|
| 203 |
+
|
| 204 |
+
playImplementation libs.cloudrail.si.android
|
| 205 |
+
playImplementation libs.junrar
|
| 206 |
+
playImplementation libs.google.play.billing
|
| 207 |
+
|
| 208 |
+
implementation libs.mpAndroidChart//Nice charts and graphs
|
| 209 |
+
|
| 210 |
+
implementation libs.concurrent.trees//Concurrent tries
|
| 211 |
+
|
| 212 |
+
//SFTP
|
| 213 |
+
implementation libs.sshj
|
| 214 |
+
//smb
|
| 215 |
+
implementation libs.jcifs.ng
|
| 216 |
+
//FTP
|
| 217 |
+
implementation libs.commons.net
|
| 218 |
+
//OkHttp
|
| 219 |
+
implementation libs.okhttp
|
| 220 |
+
|
| 221 |
+
implementation libs.bcpkix.jdk18on
|
| 222 |
+
implementation libs.bcprov.jdk18on
|
| 223 |
+
|
| 224 |
+
//Glide: loads icons seemlessly
|
| 225 |
+
implementation libs.glide
|
| 226 |
+
implementation (libs.glide.recyclerView) {
|
| 227 |
+
// Excludes the support library because it's already included by Glide.
|
| 228 |
+
transitive = false
|
| 229 |
+
}
|
| 230 |
+
ksp libs.glide.ksp
|
| 231 |
+
|
| 232 |
+
implementation libs.speedDial
|
| 233 |
+
|
| 234 |
+
//Simple library show
|
| 235 |
+
implementation(libs.aboutLibraries) {
|
| 236 |
+
transitive = true
|
| 237 |
+
}
|
| 238 |
+
|
| 239 |
+
//zip4j: support password-protected zips
|
| 240 |
+
implementation libs.zip4j
|
| 241 |
+
|
| 242 |
+
implementation libs.xz
|
| 243 |
+
|
| 244 |
+
implementation libs.rxandroid
|
| 245 |
+
// Because RxAndroid releases are few and far between, it is recommended you also
|
| 246 |
+
// explicitly depend on RxJava's latest version for bug fixes and new features.
|
| 247 |
+
// (see https://github.com/ReactiveX/RxJava/releases for latest 3.x.x version)
|
| 248 |
+
implementation libs.rxjava
|
| 249 |
+
|
| 250 |
+
implementation project(':commons_compress_7z')
|
| 251 |
+
implementation project(':file_operations')
|
| 252 |
+
implementation project(':portscanner')
|
| 253 |
+
|
| 254 |
+
implementation libs.kotlin.stdlib.jdk8
|
| 255 |
+
implementation libs.acra.core
|
| 256 |
+
implementation libs.slf4j.api
|
| 257 |
+
implementation libs.logback.android
|
| 258 |
+
testImplementation libs.logback.classic
|
| 259 |
+
|
| 260 |
+
implementation libs.gson
|
| 261 |
+
implementation libs.amaze.trashBin
|
| 262 |
+
}
|
| 263 |
+
|
| 264 |
+
kotlin {
|
| 265 |
+
jvmToolchain(17)
|
| 266 |
+
}
|
| 267 |
+
|
| 268 |
+
configurations.configureEach {
|
| 269 |
+
resolutionStrategy {
|
| 270 |
+
dependencySubstitution {
|
| 271 |
+
substitute module("commons-logging:commons-logging-api:1.1") using module("commons-logging:commons-logging:1.1.1")
|
| 272 |
+
substitute module("com.android.support:support-annotations:27.1.1") using module("com.android.support:support-annotations:27.0.2")
|
| 273 |
+
// These two lines are added to prevent possible class clashes between awaitility (which uses hamcrest 2.1) and junit (which uses hamcrest 1.3).
|
| 274 |
+
substitute module('org.hamcrest:hamcrest-core:1.3') using module("org.hamcrest:hamcrest:2.1")
|
| 275 |
+
substitute module('org.hamcrest:hamcrest-library:1.3') using module("org.hamcrest:hamcrest:2.1")
|
| 276 |
+
}
|
| 277 |
+
}
|
| 278 |
+
}
|
| 279 |
+
|
| 280 |
+
configurations.testImplementation {
|
| 281 |
+
exclude module: 'logback-android'
|
| 282 |
+
}
|
| 283 |
+
|
| 284 |
+
tasks.register('supportOldLangCodes')
|
| 285 |
+
|
| 286 |
+
[['id', 'in'], ['yi', 'ji'], ['he', 'iw']].forEach { sourceCode, destinationCode ->
|
| 287 |
+
def copyTask = tasks.create('copyStrings' + sourceCode + 'Into' + destinationCode, Copy) {
|
| 288 |
+
description('copying values-' + sourceCode + ' strings into values-' + destinationCode)
|
| 289 |
+
from('src/main/res/values-' + sourceCode)
|
| 290 |
+
into('src/main/res/values-' + destinationCode)
|
| 291 |
+
include('strings.xml')
|
| 292 |
+
}
|
| 293 |
+
supportOldLangCodes.dependsOn copyTask
|
| 294 |
+
rootProject.tasks.named('spotlessJava').configure { dependsOn copyTask }
|
| 295 |
+
rootProject.tasks.named('spotlessKotlin').configure { dependsOn copyTask }
|
| 296 |
+
}
|
| 297 |
+
|
| 298 |
+
project.afterEvaluate {
|
| 299 |
+
preBuild.dependsOn supportOldLangCodes
|
| 300 |
+
}
|
| 301 |
+
|
| 302 |
+
clean.dependsOn supportOldLangCodes
|
| 303 |
+
clean.mustRunAfter supportOldLangCodes
|
| 304 |
+
|
| 305 |
+
jacoco {
|
| 306 |
+
toolVersion = libs.versions.jacoco.get()
|
| 307 |
+
}
|
| 308 |
+
|
| 309 |
+
tasks.withType(Test).configureEach {
|
| 310 |
+
jacoco.includeNoLocationClasses = true
|
| 311 |
+
jacoco.excludes = ['jdk.internal.*']
|
| 312 |
+
}
|
| 313 |
+
|
| 314 |
+
Properties props = new Properties()
|
| 315 |
+
def propFile = new File('signing.properties')
|
| 316 |
+
|
| 317 |
+
if (propFile.canRead()) {
|
| 318 |
+
props.load(new FileInputStream(propFile))
|
| 319 |
+
|
| 320 |
+
if (props != null &&
|
| 321 |
+
props.containsKey('STORE_FILE') &&
|
| 322 |
+
props.containsKey('STORE_PASSWORD') &&
|
| 323 |
+
props.containsKey('KEY_ALIAS') &&
|
| 324 |
+
props.containsKey('KEY_PASSWORD')) {
|
| 325 |
+
android.signingConfigs.release.storeFile = file(props['STORE_FILE'])
|
| 326 |
+
android.signingConfigs.release.storePassword = props['STORE_PASSWORD']
|
| 327 |
+
android.signingConfigs.release.keyAlias = props['KEY_ALIAS']
|
| 328 |
+
android.signingConfigs.release.keyPassword = props['KEY_PASSWORD']
|
| 329 |
+
} else {
|
| 330 |
+
println 'signing.properties found but some entries are missing'
|
| 331 |
+
android.buildTypes.release.signingConfig = null
|
| 332 |
+
}
|
| 333 |
+
} else {
|
| 334 |
+
println 'signing.properties not found'
|
| 335 |
+
android.buildTypes.release.signingConfig = null
|
| 336 |
+
}
|
| 337 |
+
repositories {
|
| 338 |
+
google()
|
| 339 |
+
mavenCentral()
|
| 340 |
+
maven { url "https://jitpack.io" }
|
| 341 |
+
maven { url "https://jcenter.bintray.com" }
|
| 342 |
+
}
|
app/proguard.cfg
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Add project specific ProGuard rules here.
|
| 2 |
+
# By default, the flags in this file are appended to flags specified
|
| 3 |
+
# in /Users/panavtec/Documents/android-sdk-macosx/tools/proguard/proguard-android.txt
|
| 4 |
+
# You can edit the include path and order by changing the ProGuard
|
| 5 |
+
# include property in project.properties.
|
| 6 |
+
#
|
| 7 |
+
# For more details, see
|
| 8 |
+
# http://developer.android.com/guide/developing/tools/proguard.html
|
| 9 |
+
|
| 10 |
+
-dontobfuscate
|
| 11 |
+
-optimizationpasses 5
|
| 12 |
+
|
| 13 |
+
#From here Apache Commons
|
| 14 |
+
-keep class org.apache.http.**
|
| 15 |
+
-keep interface org.apache.http.**
|
| 16 |
+
|
| 17 |
+
-dontwarn org.apache.commons.**
|
| 18 |
+
|
| 19 |
+
#From here Apache mira
|
| 20 |
+
-dontwarn javax.security.sasl.*
|
| 21 |
+
-dontwarn org.ietf.jgss.*
|
| 22 |
+
-dontwarn org.apache.mina.core.session.DefaultIoSessionDataStructureFactory$DefaultIoSessionAttributeMap #Java 8 not implememnted
|
| 23 |
+
-dontwarn org.apache.mina.util.ExpiringMap #Java 8 not implememnted
|
| 24 |
+
-keepclassmembers class * implements org.apache.mina.core.service.IoProcessor {
|
| 25 |
+
public <init>(java.util.concurrent.ExecutorService);
|
| 26 |
+
public <init>(java.util.concurrent.Executor);
|
| 27 |
+
public <init>();
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
#From here jcifs
|
| 31 |
+
-dontwarn javax.servlet.**
|
| 32 |
+
-dontwarn jcifs.http.NetworkExplorer
|
| 33 |
+
|
| 34 |
+
-keep,allowoptimization,allowobfuscation class eu.masconsult.android_ntlm.* {*;}
|
| 35 |
+
|
| 36 |
+
#From here org.codehaus
|
| 37 |
+
-keep class org.codehaus.jackson.** { *; }
|
| 38 |
+
|
| 39 |
+
-dontwarn org.codehaus.**
|
| 40 |
+
|
| 41 |
+
-keep class org.w3c.dom.bootstrap.** { *; }
|
| 42 |
+
-keep class org.joda.time.** { *; }
|
| 43 |
+
|
| 44 |
+
#From here Apache regexp
|
| 45 |
+
-dontwarn org.apache.regexp.REDemo
|
| 46 |
+
-dontwarn org.apache.regexp.REDemo$1
|
| 47 |
+
|
| 48 |
+
#From here Apache ftpsever
|
| 49 |
+
-dontwarn org.apache.ftpserver.**
|
| 50 |
+
|
| 51 |
+
#From here MPAndroidChart
|
| 52 |
+
-keep class com.github.mikephil.charting.** { *; }
|
| 53 |
+
|
| 54 |
+
-dontwarn io.realm.**
|
| 55 |
+
#From here retrolambda
|
| 56 |
+
-dontwarn java.lang.invoke.*
|
| 57 |
+
-dontwarn **$$Lambda$*
|
| 58 |
+
|
| 59 |
+
#From here Glide
|
| 60 |
+
-keep public class * implements com.bumptech.glide.module.GlideModule
|
| 61 |
+
-keep public class * extends com.bumptech.glide.AppGlideModule
|
| 62 |
+
-keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
|
| 63 |
+
**[] $VALUES;
|
| 64 |
+
public *;
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
#From here AboutLibraries
|
| 68 |
+
-keepclasseswithmembers class **.R$* {
|
| 69 |
+
public static final int define_*;
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
#From here CloudRail
|
| 73 |
+
-keep class com.cloudrail.** { *; }
|
| 74 |
+
|
| 75 |
+
#From here BouncyCastle
|
| 76 |
+
-keep class org.bouncycastle.crypto.* {*;}
|
| 77 |
+
-keep class org.bouncycastle.crypto.agreement.** {*;}
|
| 78 |
+
-keep class org.bouncycastle.crypto.digests.* {*;}
|
| 79 |
+
-keep class org.bouncycastle.crypto.ec.* {*;}
|
| 80 |
+
-keep class org.bouncycastle.crypto.encodings.* {*;}
|
| 81 |
+
-keep class org.bouncycastle.crypto.engines.* {*;}
|
| 82 |
+
-keep class org.bouncycastle.crypto.macs.* {*;}
|
| 83 |
+
-keep class org.bouncycastle.crypto.modes.* {*;}
|
| 84 |
+
-keep class org.bouncycastle.crypto.paddings.* {*;}
|
| 85 |
+
-keep class org.bouncycastle.crypto.params.* {*;}
|
| 86 |
+
-keep class org.bouncycastle.crypto.prng.* {*;}
|
| 87 |
+
-keep class org.bouncycastle.crypto.signers.* {*;}
|
| 88 |
+
|
| 89 |
+
-keep class org.bouncycastle.jcajce.provider.asymmetric.* {*;}
|
| 90 |
+
-keep class org.bouncycastle.jcajce.provider.asymmetric.util.* {*;}
|
| 91 |
+
-keep class org.bouncycastle.jcajce.provider.asymmetric.dh.* {*;}
|
| 92 |
+
-keep class org.bouncycastle.jcajce.provider.asymmetric.ec.* {*;}
|
| 93 |
+
-keep class org.bouncycastle.jcajce.provider.asymmetric.rsa.* {*;}
|
| 94 |
+
|
| 95 |
+
-keep class org.bouncycastle.jcajce.provider.digest.** {*;}
|
| 96 |
+
-keep class org.bouncycastle.jcajce.provider.keystore.** {*;}
|
| 97 |
+
-keep class org.bouncycastle.jcajce.provider.symmetric.** {*;}
|
| 98 |
+
-keep class org.bouncycastle.jcajce.spec.* {*;}
|
| 99 |
+
-keep class org.bouncycastle.jce.** {*;}
|
| 100 |
+
|
| 101 |
+
-dontwarn org.bouncycastle.jsse.**
|
| 102 |
+
-dontwarn org.bouncycastle.asn1.ASN1ApplicationSpecific
|
| 103 |
+
-dontwarn org.bouncycastle.asn1.DERApplicationSpecific
|
| 104 |
+
-dontwarn org.conscrypt.**
|
| 105 |
+
-dontwarn org.openjsse.**
|
| 106 |
+
-dontwarn sun.security.x509.X509Key
|
| 107 |
+
|
| 108 |
+
-dontwarn javax.naming.**
|
| 109 |
+
|
| 110 |
+
#From here sshj. We are not using GSSAPI to connect to SSH
|
| 111 |
+
-dontwarn net.schmizz.sshj.userauth.method.AuthGssApiWithMic
|
| 112 |
+
#Warning was at SSHClient.authGssApiWithMic, referencing javax.security.auth.login.LoginContext.
|
| 113 |
+
#But we are not using it too
|
| 114 |
+
-dontwarn net.schmizz.sshj.SSHClient
|
| 115 |
+
|
| 116 |
+
|
| 117 |
+
|
| 118 |
+
#From here tests classes
|
| 119 |
+
#Ignore test classes see tests-proguard.cfg
|
| 120 |
+
-dontwarn android.test.**
|
| 121 |
+
-dontwarn org.junit.**
|
| 122 |
+
|
| 123 |
+
#Commons-compress. See #2647.
|
| 124 |
+
#Keep constructors that involves an InputStream
|
| 125 |
+
-keepclassmembers class * extends org.apache.commons.compress.compressors.CompressorInputStream {
|
| 126 |
+
<init>(java.io.InputStream);
|
| 127 |
+
}
|
| 128 |
+
|
| 129 |
+
-keep class com.amaze.trashbin.** { *; }
|
| 130 |
+
-dontwarn ch.qos.logback.core.net.*
|
app/src/androidTest/java/com/amaze/filemanager/asynchronous/services/ftp/FtpServiceEspressoTest.kt
ADDED
|
@@ -0,0 +1,319 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright (C) 2014-2020 Arpit Khurana <arpitkh96@gmail.com>, Vishal Nehra <vishalmeham2@gmail.com>,
|
| 3 |
+
* Emmanuel Messulam<emmanuelbendavid@gmail.com>, Raymond Lai <airwave209gt at gmail.com> and Contributors.
|
| 4 |
+
*
|
| 5 |
+
* This file is part of Amaze File Manager.
|
| 6 |
+
*
|
| 7 |
+
* Amaze File Manager is free software: you can redistribute it and/or modify
|
| 8 |
+
* it under the terms of the GNU General Public License as published by
|
| 9 |
+
* the Free Software Foundation, either version 3 of the License, or
|
| 10 |
+
* (at your option) any later version.
|
| 11 |
+
*
|
| 12 |
+
* This program is distributed in the hope that it will be useful,
|
| 13 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 |
+
* GNU General Public License for more details.
|
| 16 |
+
*
|
| 17 |
+
* You should have received a copy of the GNU General Public License
|
| 18 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
package com.amaze.filemanager.asynchronous.services.ftp
|
| 22 |
+
|
| 23 |
+
import android.content.Intent
|
| 24 |
+
import android.os.Environment
|
| 25 |
+
import android.util.Base64
|
| 26 |
+
import androidx.preference.PreferenceManager
|
| 27 |
+
import androidx.test.core.app.ApplicationProvider
|
| 28 |
+
import androidx.test.ext.junit.runners.AndroidJUnit4
|
| 29 |
+
import androidx.test.rule.ServiceTestRule
|
| 30 |
+
import com.amaze.filemanager.utils.ObtainableServiceBinder
|
| 31 |
+
import com.amaze.filemanager.utils.PasswordUtil
|
| 32 |
+
import org.apache.commons.net.PrintCommandListener
|
| 33 |
+
import org.apache.commons.net.ftp.FTP
|
| 34 |
+
import org.apache.commons.net.ftp.FTPClient
|
| 35 |
+
import org.apache.commons.net.ftp.FTPSClient
|
| 36 |
+
import org.awaitility.Awaitility.await
|
| 37 |
+
import org.junit.After
|
| 38 |
+
import org.junit.Assert.assertArrayEquals
|
| 39 |
+
import org.junit.Assert.assertEquals
|
| 40 |
+
import org.junit.Assert.assertFalse
|
| 41 |
+
import org.junit.Assert.assertNotNull
|
| 42 |
+
import org.junit.Assert.assertTrue
|
| 43 |
+
import org.junit.Rule
|
| 44 |
+
import org.junit.Test
|
| 45 |
+
import org.junit.runner.RunWith
|
| 46 |
+
import java.io.ByteArrayInputStream
|
| 47 |
+
import java.io.ByteArrayOutputStream
|
| 48 |
+
import java.io.File
|
| 49 |
+
import java.io.FileInputStream
|
| 50 |
+
import java.io.FileOutputStream
|
| 51 |
+
import java.io.FileWriter
|
| 52 |
+
import java.net.InetAddress
|
| 53 |
+
import java.net.InetSocketAddress
|
| 54 |
+
import java.net.Socket
|
| 55 |
+
import java.net.SocketException
|
| 56 |
+
import java.security.SecureRandom
|
| 57 |
+
import java.util.concurrent.TimeUnit
|
| 58 |
+
|
| 59 |
+
// Require UIAutomator if need to run test on Android 11
|
| 60 |
+
// in order to obtain MANAGE_EXTERNAL_STORAGE permission
|
| 61 |
+
@RunWith(AndroidJUnit4::class)
|
| 62 |
+
@Suppress("StringLiteralDuplication")
|
| 63 |
+
@androidx.test.filters.Suppress
|
| 64 |
+
class FtpServiceEspressoTest {
|
| 65 |
+
@get:Rule
|
| 66 |
+
var serviceTestRule = ServiceTestRule()
|
| 67 |
+
|
| 68 |
+
private var service: FtpService? = null
|
| 69 |
+
|
| 70 |
+
/**
|
| 71 |
+
* Kill running FtpService if there is one.
|
| 72 |
+
*/
|
| 73 |
+
@After
|
| 74 |
+
fun shutDown() {
|
| 75 |
+
service?.onDestroy()
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
/**
|
| 79 |
+
* Test FTP service
|
| 80 |
+
*/
|
| 81 |
+
@Test
|
| 82 |
+
fun testFtpService() {
|
| 83 |
+
PreferenceManager.getDefaultSharedPreferences(ApplicationProvider.getApplicationContext())
|
| 84 |
+
.edit()
|
| 85 |
+
.putBoolean(FtpService.KEY_PREFERENCE_SECURE, false)
|
| 86 |
+
.putBoolean(FtpService.KEY_PREFERENCE_SAF_FILESYSTEM, false)
|
| 87 |
+
.remove(FtpService.KEY_PREFERENCE_USERNAME)
|
| 88 |
+
.remove(FtpService.KEY_PREFERENCE_PASSWORD)
|
| 89 |
+
.commit()
|
| 90 |
+
service =
|
| 91 |
+
create(
|
| 92 |
+
Intent(FtpService.ACTION_START_FTPSERVER)
|
| 93 |
+
.putExtra(FtpService.TAG_STARTED_BY_TILE, false),
|
| 94 |
+
)
|
| 95 |
+
|
| 96 |
+
await().atMost(10, TimeUnit.SECONDS).until {
|
| 97 |
+
FtpService.isRunning() && isServerReady()
|
| 98 |
+
}
|
| 99 |
+
FTPClient().run {
|
| 100 |
+
addProtocolCommandListener(PrintCommandListener(System.err))
|
| 101 |
+
loginAndVerifyWith(this)
|
| 102 |
+
testUploadWith(this)
|
| 103 |
+
testDownloadWith(this)
|
| 104 |
+
}
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
/**
|
| 108 |
+
* Test FTP service over SSL
|
| 109 |
+
*/
|
| 110 |
+
@Test
|
| 111 |
+
fun testSecureFtpService() {
|
| 112 |
+
PreferenceManager.getDefaultSharedPreferences(ApplicationProvider.getApplicationContext())
|
| 113 |
+
.edit()
|
| 114 |
+
.putBoolean(FtpService.KEY_PREFERENCE_SECURE, true)
|
| 115 |
+
.putBoolean(FtpService.KEY_PREFERENCE_SAF_FILESYSTEM, false)
|
| 116 |
+
.remove(FtpService.KEY_PREFERENCE_USERNAME)
|
| 117 |
+
.remove(FtpService.KEY_PREFERENCE_PASSWORD)
|
| 118 |
+
.commit()
|
| 119 |
+
service =
|
| 120 |
+
create(
|
| 121 |
+
Intent(FtpService.ACTION_START_FTPSERVER)
|
| 122 |
+
.putExtra(FtpService.TAG_STARTED_BY_TILE, false),
|
| 123 |
+
)
|
| 124 |
+
|
| 125 |
+
await().atMost(10, TimeUnit.SECONDS).until {
|
| 126 |
+
FtpService.isRunning() && isServerReady()
|
| 127 |
+
}
|
| 128 |
+
|
| 129 |
+
FTPSClient(true).run {
|
| 130 |
+
addProtocolCommandListener(PrintCommandListener(System.err))
|
| 131 |
+
loginAndVerifyWith(this)
|
| 132 |
+
testUploadWith(this)
|
| 133 |
+
testDownloadWith(this)
|
| 134 |
+
}
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
/**
|
| 138 |
+
* Test to ensure FTP service cannot login anonymously after username/password is set
|
| 139 |
+
*/
|
| 140 |
+
@Test
|
| 141 |
+
fun testUsernameEnabledAnonymousCannotLogin() {
|
| 142 |
+
PreferenceManager.getDefaultSharedPreferences(ApplicationProvider.getApplicationContext())
|
| 143 |
+
.edit()
|
| 144 |
+
.putBoolean(FtpService.KEY_PREFERENCE_SECURE, false)
|
| 145 |
+
.putString(FtpService.KEY_PREFERENCE_USERNAME, "amazeftp")
|
| 146 |
+
.putString(
|
| 147 |
+
FtpService.KEY_PREFERENCE_PASSWORD,
|
| 148 |
+
PasswordUtil.encryptPassword(
|
| 149 |
+
ApplicationProvider.getApplicationContext(),
|
| 150 |
+
"passw0rD",
|
| 151 |
+
),
|
| 152 |
+
)
|
| 153 |
+
.commit()
|
| 154 |
+
service =
|
| 155 |
+
create(
|
| 156 |
+
Intent(FtpService.ACTION_START_FTPSERVER)
|
| 157 |
+
.putExtra(FtpService.TAG_STARTED_BY_TILE, false),
|
| 158 |
+
)
|
| 159 |
+
|
| 160 |
+
await().atMost(10, TimeUnit.SECONDS).until {
|
| 161 |
+
FtpService.isRunning() && isServerReady()
|
| 162 |
+
}
|
| 163 |
+
|
| 164 |
+
FTPClient().run {
|
| 165 |
+
connect("localhost", FtpService.DEFAULT_PORT)
|
| 166 |
+
assertFalse(login("anonymous", "test@example.com"))
|
| 167 |
+
assertTrue(login("amazeftp", "passw0rD"))
|
| 168 |
+
logout()
|
| 169 |
+
}
|
| 170 |
+
}
|
| 171 |
+
|
| 172 |
+
private fun loginAndVerifyWith(ftpClient: FTPClient) {
|
| 173 |
+
ftpClient.connect("localhost", FtpService.DEFAULT_PORT)
|
| 174 |
+
ftpClient.login("anonymous", "test@example.com")
|
| 175 |
+
ftpClient.changeWorkingDirectory("/")
|
| 176 |
+
val files = ftpClient.listFiles()
|
| 177 |
+
assertNotNull(files)
|
| 178 |
+
assertTrue(
|
| 179 |
+
"No files found on device? It is also possible that app doesn't have " +
|
| 180 |
+
"permission to access storage, which may occur on broken Android emulators",
|
| 181 |
+
files.isNotEmpty(),
|
| 182 |
+
)
|
| 183 |
+
var downloadFolderExists = false
|
| 184 |
+
for (f in files) {
|
| 185 |
+
if (f.name.equals("download", ignoreCase = true)) downloadFolderExists = true
|
| 186 |
+
}
|
| 187 |
+
ftpClient.logout()
|
| 188 |
+
ftpClient.disconnect()
|
| 189 |
+
assertTrue(
|
| 190 |
+
"Download folder not found on device. Either storage is not available, " +
|
| 191 |
+
"or something is really wrong with FtpService. Check logcat.",
|
| 192 |
+
downloadFolderExists,
|
| 193 |
+
)
|
| 194 |
+
}
|
| 195 |
+
|
| 196 |
+
private fun testUploadWith(ftpClient: FTPClient) {
|
| 197 |
+
val bytes1 = ByteArray(32)
|
| 198 |
+
val bytes2 = ByteArray(32)
|
| 199 |
+
SecureRandom().run {
|
| 200 |
+
setSeed(System.currentTimeMillis())
|
| 201 |
+
nextBytes(bytes1)
|
| 202 |
+
nextBytes(bytes2)
|
| 203 |
+
}
|
| 204 |
+
|
| 205 |
+
val randomString = Base64.encodeToString(bytes1, Base64.DEFAULT)
|
| 206 |
+
ftpClient.run {
|
| 207 |
+
connect("localhost", FtpService.DEFAULT_PORT)
|
| 208 |
+
login("anonymous", "test@example.com")
|
| 209 |
+
changeWorkingDirectory("/")
|
| 210 |
+
enterLocalPassiveMode()
|
| 211 |
+
setFileType(FTP.ASCII_FILE_TYPE)
|
| 212 |
+
ByteArrayInputStream(randomString.toByteArray(charset("utf-8"))).run {
|
| 213 |
+
this.copyTo(storeFileStream("test.txt"))
|
| 214 |
+
close()
|
| 215 |
+
}
|
| 216 |
+
ByteArrayInputStream(bytes2).run {
|
| 217 |
+
assertTrue(setFileType(FTP.BINARY_FILE_TYPE))
|
| 218 |
+
this.copyTo(storeFileStream("test.bin"))
|
| 219 |
+
close()
|
| 220 |
+
}
|
| 221 |
+
logout()
|
| 222 |
+
disconnect()
|
| 223 |
+
|
| 224 |
+
File(Environment.getExternalStorageDirectory(), "test.txt").run {
|
| 225 |
+
assertTrue(exists())
|
| 226 |
+
val verifyContent = ByteArrayOutputStream()
|
| 227 |
+
FileInputStream(this).copyTo(verifyContent)
|
| 228 |
+
assertEquals(randomString, verifyContent.toString("utf-8"))
|
| 229 |
+
delete()
|
| 230 |
+
}
|
| 231 |
+
|
| 232 |
+
File(Environment.getExternalStorageDirectory(), "test.bin").run {
|
| 233 |
+
assertTrue(exists())
|
| 234 |
+
val verifyContent = ByteArrayOutputStream()
|
| 235 |
+
FileInputStream(this).copyTo(verifyContent)
|
| 236 |
+
assertArrayEquals(bytes2, verifyContent.toByteArray())
|
| 237 |
+
delete()
|
| 238 |
+
}
|
| 239 |
+
}
|
| 240 |
+
}
|
| 241 |
+
|
| 242 |
+
private fun testDownloadWith(ftpClient: FTPClient) {
|
| 243 |
+
val testFile1 = File(Environment.getExternalStorageDirectory(), "test.txt")
|
| 244 |
+
val testFile2 = File(Environment.getExternalStorageDirectory(), "test.bin")
|
| 245 |
+
val bytes1 = ByteArray(32)
|
| 246 |
+
val bytes2 = ByteArray(32)
|
| 247 |
+
SecureRandom().run {
|
| 248 |
+
setSeed(System.currentTimeMillis())
|
| 249 |
+
nextBytes(bytes1)
|
| 250 |
+
nextBytes(bytes2)
|
| 251 |
+
}
|
| 252 |
+
|
| 253 |
+
val randomString = Base64.encodeToString(bytes1, Base64.DEFAULT)
|
| 254 |
+
FileWriter(testFile1).run {
|
| 255 |
+
write(randomString)
|
| 256 |
+
close()
|
| 257 |
+
}
|
| 258 |
+
|
| 259 |
+
FileOutputStream(testFile2).run {
|
| 260 |
+
write(bytes2, 0, bytes2.size)
|
| 261 |
+
close()
|
| 262 |
+
}
|
| 263 |
+
|
| 264 |
+
ftpClient.run {
|
| 265 |
+
connect("localhost", FtpService.DEFAULT_PORT)
|
| 266 |
+
login("anonymous", "test@example.com")
|
| 267 |
+
changeWorkingDirectory("/")
|
| 268 |
+
enterLocalPassiveMode()
|
| 269 |
+
setFileType(FTP.ASCII_FILE_TYPE)
|
| 270 |
+
|
| 271 |
+
ByteArrayOutputStream().run {
|
| 272 |
+
retrieveFile("test.txt", this)
|
| 273 |
+
close()
|
| 274 |
+
assertEquals(randomString, toString("utf-8"))
|
| 275 |
+
}
|
| 276 |
+
|
| 277 |
+
setFileType(FTP.BINARY_FILE_TYPE)
|
| 278 |
+
|
| 279 |
+
ByteArrayOutputStream().run {
|
| 280 |
+
retrieveFile("test.bin", this)
|
| 281 |
+
close()
|
| 282 |
+
assertArrayEquals(bytes2, toByteArray())
|
| 283 |
+
}
|
| 284 |
+
|
| 285 |
+
logout()
|
| 286 |
+
disconnect()
|
| 287 |
+
}
|
| 288 |
+
|
| 289 |
+
testFile1.delete()
|
| 290 |
+
testFile2.delete()
|
| 291 |
+
}
|
| 292 |
+
|
| 293 |
+
private fun create(intent: Intent): FtpService {
|
| 294 |
+
val binder =
|
| 295 |
+
serviceTestRule
|
| 296 |
+
.bindService(
|
| 297 |
+
intent.setClass(
|
| 298 |
+
ApplicationProvider.getApplicationContext(),
|
| 299 |
+
FtpService::class.java,
|
| 300 |
+
),
|
| 301 |
+
)
|
| 302 |
+
return ((binder as ObtainableServiceBinder<FtpService>).service as FtpService).also {
|
| 303 |
+
it.onStartCommand(intent, 0, 0)
|
| 304 |
+
}
|
| 305 |
+
}
|
| 306 |
+
|
| 307 |
+
private fun isServerReady(): Boolean {
|
| 308 |
+
return Socket().let {
|
| 309 |
+
try {
|
| 310 |
+
it.connect(InetSocketAddress(InetAddress.getLocalHost(), FtpService.DEFAULT_PORT))
|
| 311 |
+
true
|
| 312 |
+
} catch (e: SocketException) {
|
| 313 |
+
false
|
| 314 |
+
} finally {
|
| 315 |
+
it.close()
|
| 316 |
+
}
|
| 317 |
+
}
|
| 318 |
+
}
|
| 319 |
+
}
|
app/src/androidTest/java/com/amaze/filemanager/asynchronous/services/ftp/FtpServiceStaticMethodsTest.kt
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright (C) 2014-2020 Arpit Khurana <arpitkh96@gmail.com>, Vishal Nehra <vishalmeham2@gmail.com>,
|
| 3 |
+
* Emmanuel Messulam<emmanuelbendavid@gmail.com>, Raymond Lai <airwave209gt at gmail.com> and Contributors.
|
| 4 |
+
*
|
| 5 |
+
* This file is part of Amaze File Manager.
|
| 6 |
+
*
|
| 7 |
+
* Amaze File Manager is free software: you can redistribute it and/or modify
|
| 8 |
+
* it under the terms of the GNU General Public License as published by
|
| 9 |
+
* the Free Software Foundation, either version 3 of the License, or
|
| 10 |
+
* (at your option) any later version.
|
| 11 |
+
*
|
| 12 |
+
* This program is distributed in the hope that it will be useful,
|
| 13 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 |
+
* GNU General Public License for more details.
|
| 16 |
+
*
|
| 17 |
+
* You should have received a copy of the GNU General Public License
|
| 18 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
package com.amaze.filemanager.asynchronous.services.ftp
|
| 22 |
+
|
| 23 |
+
import android.content.Context
|
| 24 |
+
import android.os.Build.VERSION.SDK_INT
|
| 25 |
+
import android.os.Build.VERSION_CODES.N_MR1
|
| 26 |
+
import androidx.test.core.app.ApplicationProvider
|
| 27 |
+
import androidx.test.ext.junit.runners.AndroidJUnit4
|
| 28 |
+
import androidx.test.filters.SmallTest
|
| 29 |
+
import com.amaze.filemanager.utils.NetworkUtil
|
| 30 |
+
import org.junit.Assert.assertNotNull
|
| 31 |
+
import org.junit.Assert.fail
|
| 32 |
+
import org.junit.Test
|
| 33 |
+
import org.junit.runner.RunWith
|
| 34 |
+
|
| 35 |
+
/**
|
| 36 |
+
* This test is separated from FtpServiceEspressoTest since it does not actually requires the FTP
|
| 37 |
+
* service itself.
|
| 38 |
+
*
|
| 39 |
+
*
|
| 40 |
+
* It is expected that you are not running all the cases in one go. **You have been warned**.
|
| 41 |
+
*/
|
| 42 |
+
@SmallTest
|
| 43 |
+
@RunWith(AndroidJUnit4::class)
|
| 44 |
+
class FtpServiceStaticMethodsTest {
|
| 45 |
+
/** To test [FtpService.getLocalInetAddress] must not return an empty string. */
|
| 46 |
+
@Test
|
| 47 |
+
fun testGetLocalInetAddressMustNotBeEmpty() {
|
| 48 |
+
/* Android emulator's "wifi connectivity" only exists from API 25.
|
| 49 |
+
* On the other hand, we don't do wifi AP in code, either it's not possible
|
| 50 |
+
* for lower APIs, nor we currently have no plans on doing this - see #515, #2720 -
|
| 51 |
+
* therefore we only run this test from API 25 or above.
|
| 52 |
+
* - TranceLove
|
| 53 |
+
*/
|
| 54 |
+
if (SDK_INT >= N_MR1) {
|
| 55 |
+
ApplicationProvider.getApplicationContext<Context>().run {
|
| 56 |
+
if (!NetworkUtil.isConnectedToLocalNetwork(this)) {
|
| 57 |
+
fail("Please connect your device to network to run this test!")
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
NetworkUtil.getLocalInetAddress(this).also {
|
| 61 |
+
assertNotNull(it)
|
| 62 |
+
assertNotNull(it?.hostAddress)
|
| 63 |
+
}
|
| 64 |
+
}
|
| 65 |
+
}
|
| 66 |
+
}
|
| 67 |
+
}
|
app/src/androidTest/java/com/amaze/filemanager/database/UtilsHandlerTest.java
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright (C) 2014-2024 Arpit Khurana <arpitkh96@gmail.com>, Vishal Nehra <vishalmeham2@gmail.com>,
|
| 3 |
+
* Emmanuel Messulam<emmanuelbendavid@gmail.com>, Raymond Lai <airwave209gt at gmail.com> and Contributors.
|
| 4 |
+
*
|
| 5 |
+
* This file is part of Amaze File Manager.
|
| 6 |
+
*
|
| 7 |
+
* Amaze File Manager is free software: you can redistribute it and/or modify
|
| 8 |
+
* it under the terms of the GNU General Public License as published by
|
| 9 |
+
* the Free Software Foundation, either version 3 of the License, or
|
| 10 |
+
* (at your option) any later version.
|
| 11 |
+
*
|
| 12 |
+
* This program is distributed in the hope that it will be useful,
|
| 13 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 |
+
* GNU General Public License for more details.
|
| 16 |
+
*
|
| 17 |
+
* You should have received a copy of the GNU General Public License
|
| 18 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
package com.amaze.filemanager.database;
|
| 22 |
+
|
| 23 |
+
import static org.awaitility.Awaitility.await;
|
| 24 |
+
import static org.junit.Assert.assertEquals;
|
| 25 |
+
|
| 26 |
+
import java.io.File;
|
| 27 |
+
import java.util.List;
|
| 28 |
+
import java.util.concurrent.TimeUnit;
|
| 29 |
+
|
| 30 |
+
import org.junit.After;
|
| 31 |
+
import org.junit.Before;
|
| 32 |
+
import org.junit.Test;
|
| 33 |
+
import org.junit.runner.RunWith;
|
| 34 |
+
|
| 35 |
+
import com.amaze.filemanager.database.models.OperationData;
|
| 36 |
+
import com.amaze.filemanager.filesystem.ftp.NetCopyClientUtils;
|
| 37 |
+
|
| 38 |
+
import android.content.Context;
|
| 39 |
+
import android.os.Environment;
|
| 40 |
+
|
| 41 |
+
import androidx.annotation.NonNull;
|
| 42 |
+
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
| 43 |
+
import androidx.test.filters.Suppress;
|
| 44 |
+
import androidx.test.platform.app.InstrumentationRegistry;
|
| 45 |
+
|
| 46 |
+
@RunWith(AndroidJUnit4.class)
|
| 47 |
+
public class UtilsHandlerTest {
|
| 48 |
+
|
| 49 |
+
private UtilitiesDatabase utilitiesDatabase;
|
| 50 |
+
|
| 51 |
+
private UtilsHandler utilsHandler;
|
| 52 |
+
|
| 53 |
+
@Before
|
| 54 |
+
public void setUp() {
|
| 55 |
+
Context ctx = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
| 56 |
+
utilitiesDatabase = UtilitiesDatabase.initialize(ctx);
|
| 57 |
+
utilsHandler = new UtilsHandler(ctx, utilitiesDatabase);
|
| 58 |
+
utilitiesDatabase.getOpenHelper().getWritableDatabase().execSQL("DELETE FROM sftp;");
|
| 59 |
+
utilitiesDatabase.getOpenHelper().getWritableDatabase().execSQL("DELETE FROM bookmarks;");
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
@After
|
| 63 |
+
public void tearDown() {
|
| 64 |
+
if (utilitiesDatabase.isOpen()) {
|
| 65 |
+
utilitiesDatabase.clearAllTables();
|
| 66 |
+
utilitiesDatabase.close();
|
| 67 |
+
}
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
@Test
|
| 71 |
+
public void testEncodeEncryptUri1() {
|
| 72 |
+
performEncryptUriTest("ssh://test:testP@ssw0rd@127.0.0.1:5460");
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
@Test
|
| 76 |
+
public void testEncodeEncryptUri2() {
|
| 77 |
+
performEncryptUriTest("ssh://test:testP@##word@127.0.0.1:22");
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
@Test
|
| 81 |
+
public void testEncodeEncryptUri3() {
|
| 82 |
+
performEncryptUriTest("ssh://test@example.com:testP@ssw0rd@127.0.0.1:22");
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
@Test
|
| 86 |
+
public void testEncodeEncryptUri4() {
|
| 87 |
+
performEncryptUriTest("ssh://test@example.com:testP@ssw0##$@127.0.0.1:22");
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
@Test
|
| 91 |
+
@Suppress
|
| 92 |
+
public void testRepeatedSaveBookmarkShouldNeverThrowException() {
|
| 93 |
+
OperationData operationData =
|
| 94 |
+
new OperationData(
|
| 95 |
+
UtilsHandler.Operation.BOOKMARKS,
|
| 96 |
+
"My Documents",
|
| 97 |
+
new File(Environment.getExternalStorageDirectory(), "My Documents").getAbsolutePath());
|
| 98 |
+
utilsHandler.addCommonBookmarks();
|
| 99 |
+
await()
|
| 100 |
+
.atMost(10, TimeUnit.SECONDS)
|
| 101 |
+
.until(
|
| 102 |
+
() -> {
|
| 103 |
+
List<String[]> verify = utilsHandler.getBookmarksList();
|
| 104 |
+
assertEquals(5, verify.size());
|
| 105 |
+
return true;
|
| 106 |
+
});
|
| 107 |
+
for (int i = 0; i < 5; i++) {
|
| 108 |
+
utilsHandler.saveToDatabase(operationData);
|
| 109 |
+
await()
|
| 110 |
+
.atMost(10, TimeUnit.SECONDS)
|
| 111 |
+
.until(
|
| 112 |
+
() -> {
|
| 113 |
+
List<String[]> verify = utilsHandler.getBookmarksList();
|
| 114 |
+
assertEquals(6, verify.size());
|
| 115 |
+
return true;
|
| 116 |
+
});
|
| 117 |
+
}
|
| 118 |
+
}
|
| 119 |
+
|
| 120 |
+
private void performEncryptUriTest(@NonNull final String origPath) {
|
| 121 |
+
String encryptedPath = NetCopyClientUtils.INSTANCE.encryptFtpPathAsNecessary(origPath);
|
| 122 |
+
|
| 123 |
+
utilsHandler.saveToDatabase(
|
| 124 |
+
new OperationData(
|
| 125 |
+
UtilsHandler.Operation.SFTP,
|
| 126 |
+
encryptedPath,
|
| 127 |
+
"Test",
|
| 128 |
+
"00:11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:ff",
|
| 129 |
+
null,
|
| 130 |
+
null));
|
| 131 |
+
|
| 132 |
+
await().atMost(10, TimeUnit.SECONDS).until(() -> utilsHandler.getSftpList().size() > 0);
|
| 133 |
+
|
| 134 |
+
List<String[]> result = utilsHandler.getSftpList();
|
| 135 |
+
assertEquals(1, result.size());
|
| 136 |
+
assertEquals("Test", result.get(0)[0]);
|
| 137 |
+
assertEquals(encryptedPath, result.get(0)[1]);
|
| 138 |
+
assertEquals(
|
| 139 |
+
"00:11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:ff",
|
| 140 |
+
utilsHandler.getRemoteHostKey(encryptedPath));
|
| 141 |
+
}
|
| 142 |
+
}
|
app/src/androidTest/java/com/amaze/filemanager/filesystem/HybridFileParcelableTest.java
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright (C) 2014-2024 Arpit Khurana <arpitkh96@gmail.com>, Vishal Nehra <vishalmeham2@gmail.com>,
|
| 3 |
+
* Emmanuel Messulam<emmanuelbendavid@gmail.com>, Raymond Lai <airwave209gt at gmail.com> and Contributors.
|
| 4 |
+
*
|
| 5 |
+
* This file is part of Amaze File Manager.
|
| 6 |
+
*
|
| 7 |
+
* Amaze File Manager is free software: you can redistribute it and/or modify
|
| 8 |
+
* it under the terms of the GNU General Public License as published by
|
| 9 |
+
* the Free Software Foundation, either version 3 of the License, or
|
| 10 |
+
* (at your option) any later version.
|
| 11 |
+
*
|
| 12 |
+
* This program is distributed in the hope that it will be useful,
|
| 13 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 |
+
* GNU General Public License for more details.
|
| 16 |
+
*
|
| 17 |
+
* You should have received a copy of the GNU General Public License
|
| 18 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
package com.amaze.filemanager.filesystem;
|
| 22 |
+
|
| 23 |
+
import static org.junit.Assert.assertEquals;
|
| 24 |
+
|
| 25 |
+
import org.junit.Before;
|
| 26 |
+
import org.junit.Test;
|
| 27 |
+
|
| 28 |
+
import com.amaze.filemanager.fileoperations.filesystem.OpenMode;
|
| 29 |
+
|
| 30 |
+
import android.os.Parcel;
|
| 31 |
+
|
| 32 |
+
/** Created by Rustam Khadipash on 29/3/2018. */
|
| 33 |
+
public class HybridFileParcelableTest {
|
| 34 |
+
private HybridFileParcelable filePath;
|
| 35 |
+
private HybridFileParcelable directory;
|
| 36 |
+
private HybridFileParcelable file;
|
| 37 |
+
|
| 38 |
+
@Before
|
| 39 |
+
public void setUp() {
|
| 40 |
+
filePath = new HybridFileParcelable("/storage/sdcard0/Test1/Test1.txt");
|
| 41 |
+
|
| 42 |
+
directory = new HybridFileParcelable("/storage/sdcard0/Test2", "rw", 123456, 654321, true);
|
| 43 |
+
|
| 44 |
+
file =
|
| 45 |
+
new HybridFileParcelable("/storage/sdcard0/Test3/Test3.txt", "rw", 123456, 654321, false);
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
/** Purpose: Get name of a file / directory Input: no Expected: return file / directory's name */
|
| 49 |
+
@Test
|
| 50 |
+
public void getName() {
|
| 51 |
+
assertEquals("Test1.txt", filePath.getName());
|
| 52 |
+
assertEquals("Test2", directory.getName());
|
| 53 |
+
assertEquals("Test3.txt", file.getName());
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
/**
|
| 57 |
+
* Purpose: Change name of a file / directory Input: setName newName Expected: File / directory's
|
| 58 |
+
* name is changed
|
| 59 |
+
*/
|
| 60 |
+
@Test
|
| 61 |
+
public void setName() {
|
| 62 |
+
filePath.setName("Tset1.txt");
|
| 63 |
+
assertEquals("Tset1.txt", filePath.getName());
|
| 64 |
+
directory.setName("Tset2");
|
| 65 |
+
assertEquals("Tset2", directory.getName());
|
| 66 |
+
file.setName("Tset3.txt");
|
| 67 |
+
assertEquals("Tset3.txt", file.getName());
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
/**
|
| 71 |
+
* Purpose: Get open mode of a file / directory Input: no Expected: return OpenMode.FILE
|
| 72 |
+
*
|
| 73 |
+
* <p>All files and directories in this class have open mode set as OpenMode.FILE
|
| 74 |
+
*/
|
| 75 |
+
@Test
|
| 76 |
+
public void getMode() {
|
| 77 |
+
assertEquals(OpenMode.FILE, filePath.getMode());
|
| 78 |
+
assertEquals(OpenMode.FILE, directory.getMode());
|
| 79 |
+
assertEquals(OpenMode.FILE, file.getMode());
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
/** Purpose: Get link to a file / directory Input: no Expected: return empty string */
|
| 83 |
+
@Test
|
| 84 |
+
public void getLink() {
|
| 85 |
+
assertEquals("", filePath.getLink());
|
| 86 |
+
assertEquals("", directory.getLink());
|
| 87 |
+
assertEquals("", file.getLink());
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
/**
|
| 91 |
+
* Purpose: Set link to a file / directory Input: setLink newLink Expected: File / directory's
|
| 92 |
+
* link is changed
|
| 93 |
+
*/
|
| 94 |
+
@Test
|
| 95 |
+
public void setLink() {
|
| 96 |
+
filePath.setLink("abc");
|
| 97 |
+
assertEquals("abc", filePath.getLink());
|
| 98 |
+
directory.setLink("def");
|
| 99 |
+
assertEquals("def", directory.getLink());
|
| 100 |
+
file.setLink("ghi");
|
| 101 |
+
assertEquals("ghi", file.getLink());
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
/** Purpose: Get creation date of a file / directory Input: no Expected: return date */
|
| 105 |
+
@Test
|
| 106 |
+
public void getDate() {
|
| 107 |
+
assertEquals(0, filePath.getDate());
|
| 108 |
+
assertEquals(123456, directory.getDate());
|
| 109 |
+
assertEquals(123456, file.getDate());
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
/**
|
| 113 |
+
* Purpose: Change creation date of a file / directory Input: setDate newDate Expected: File /
|
| 114 |
+
* directory's creation date is changed
|
| 115 |
+
*/
|
| 116 |
+
@Test
|
| 117 |
+
public void setDate() {
|
| 118 |
+
filePath.setDate(746352);
|
| 119 |
+
assertEquals(746352, filePath.getDate());
|
| 120 |
+
directory.setDate(474587);
|
| 121 |
+
assertEquals(474587, directory.getDate());
|
| 122 |
+
file.setDate(3573335);
|
| 123 |
+
assertEquals(3573335, file.getDate());
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
/** Purpose: Get size of a file / directory Input: no Expected: return size */
|
| 127 |
+
@Test
|
| 128 |
+
public void getSize() {
|
| 129 |
+
assertEquals(0, filePath.getSize());
|
| 130 |
+
assertEquals(654321, directory.getSize());
|
| 131 |
+
assertEquals(654321, file.getSize());
|
| 132 |
+
}
|
| 133 |
+
|
| 134 |
+
/**
|
| 135 |
+
* Purpose: Change size of a file / directory Input: setSize newSize Expected: File / directory's
|
| 136 |
+
* size is changed
|
| 137 |
+
*/
|
| 138 |
+
@Test
|
| 139 |
+
public void setSize() {
|
| 140 |
+
filePath.setSize(3534546);
|
| 141 |
+
assertEquals(3534546, filePath.getSize());
|
| 142 |
+
directory.setSize(1745534);
|
| 143 |
+
assertEquals(1745534, directory.getSize());
|
| 144 |
+
file.setSize(7546543);
|
| 145 |
+
assertEquals(7546543, file.getSize());
|
| 146 |
+
}
|
| 147 |
+
|
| 148 |
+
/** Purpose: Check whether it is a file or directory Input: no Expected: return directory */
|
| 149 |
+
@Test
|
| 150 |
+
public void isDirectory() {
|
| 151 |
+
assertEquals(false, filePath.isDirectory());
|
| 152 |
+
assertEquals(true, directory.isDirectory());
|
| 153 |
+
assertEquals(false, file.isDirectory());
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
/**
|
| 157 |
+
* Purpose: Change type to file / directory Input: setDirectory isDirectory Expected: File /
|
| 158 |
+
* directory's type is changed
|
| 159 |
+
*/
|
| 160 |
+
@Test
|
| 161 |
+
public void setDirectory() {
|
| 162 |
+
filePath.setDirectory(true);
|
| 163 |
+
assertEquals(true, filePath.isDirectory());
|
| 164 |
+
directory.setDirectory(false);
|
| 165 |
+
assertEquals(false, directory.isDirectory());
|
| 166 |
+
file.setDirectory(true);
|
| 167 |
+
assertEquals(true, file.isDirectory());
|
| 168 |
+
}
|
| 169 |
+
|
| 170 |
+
/** Purpose: Get path to a file / directory Input: no Expected: return path */
|
| 171 |
+
@Test
|
| 172 |
+
public void getPath() {
|
| 173 |
+
assertEquals("/storage/sdcard0/Test1/Test1.txt", filePath.getPath());
|
| 174 |
+
assertEquals("/storage/sdcard0/Test2", directory.getPath());
|
| 175 |
+
assertEquals("/storage/sdcard0/Test3/Test3.txt", file.getPath());
|
| 176 |
+
}
|
| 177 |
+
|
| 178 |
+
/** Purpose: Get file / directory's permissions Input: no Expected: return permissions */
|
| 179 |
+
@Test
|
| 180 |
+
public void getPermission() {
|
| 181 |
+
assertEquals(null, filePath.getPermission());
|
| 182 |
+
assertEquals("rw", directory.getPermission());
|
| 183 |
+
assertEquals("rw", file.getPermission());
|
| 184 |
+
}
|
| 185 |
+
|
| 186 |
+
/**
|
| 187 |
+
* Purpose: Change permissions of a file / directory Input: setPermission newPermission Expected:
|
| 188 |
+
* File / directory's permissions are changed
|
| 189 |
+
*/
|
| 190 |
+
@Test
|
| 191 |
+
public void setPermission() {
|
| 192 |
+
filePath.setPermission("rwx");
|
| 193 |
+
assertEquals("rwx", filePath.getPermission());
|
| 194 |
+
directory.setPermission("rwx");
|
| 195 |
+
assertEquals("rwx", directory.getPermission());
|
| 196 |
+
file.setPermission("rwx");
|
| 197 |
+
assertEquals("rwx", file.getPermission());
|
| 198 |
+
}
|
| 199 |
+
|
| 200 |
+
/**
|
| 201 |
+
* Purpose: Write an object into a parcel, send it through an intent and read the object from the
|
| 202 |
+
* parcel Input: writeToParcel parcel object Expected: The parcel can be sent and the object can
|
| 203 |
+
* be extracted from the parcel
|
| 204 |
+
*/
|
| 205 |
+
@Test
|
| 206 |
+
public void writeToParcel() {
|
| 207 |
+
Parcel parcel = Parcel.obtain();
|
| 208 |
+
file.writeToParcel(parcel, file.describeContents());
|
| 209 |
+
parcel.setDataPosition(0);
|
| 210 |
+
|
| 211 |
+
HybridFileParcelable createdFromParcel = HybridFileParcelable.CREATOR.createFromParcel(parcel);
|
| 212 |
+
assertEquals(file.getDate(), createdFromParcel.getDate());
|
| 213 |
+
assertEquals(file.getLink(), createdFromParcel.getLink());
|
| 214 |
+
assertEquals(file.getMode(), createdFromParcel.getMode());
|
| 215 |
+
assertEquals(file.getName(), createdFromParcel.getName());
|
| 216 |
+
assertEquals(file.getPath(), createdFromParcel.getPath());
|
| 217 |
+
assertEquals(file.getPermission(), createdFromParcel.getPermission());
|
| 218 |
+
assertEquals(file.getSize(), createdFromParcel.getSize());
|
| 219 |
+
assertEquals(file.isDirectory(), createdFromParcel.isDirectory());
|
| 220 |
+
}
|
| 221 |
+
}
|
app/src/androidTest/java/com/amaze/filemanager/filesystem/files/CryptUtilTest.java
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright (C) 2014-2024 Arpit Khurana <arpitkh96@gmail.com>, Vishal Nehra <vishalmeham2@gmail.com>,
|
| 3 |
+
* Emmanuel Messulam<emmanuelbendavid@gmail.com>, Raymond Lai <airwave209gt at gmail.com> and Contributors.
|
| 4 |
+
*
|
| 5 |
+
* This file is part of Amaze File Manager.
|
| 6 |
+
*
|
| 7 |
+
* Amaze File Manager is free software: you can redistribute it and/or modify
|
| 8 |
+
* it under the terms of the GNU General Public License as published by
|
| 9 |
+
* the Free Software Foundation, either version 3 of the License, or
|
| 10 |
+
* (at your option) any later version.
|
| 11 |
+
*
|
| 12 |
+
* This program is distributed in the hope that it will be useful,
|
| 13 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 |
+
* GNU General Public License for more details.
|
| 16 |
+
*
|
| 17 |
+
* You should have received a copy of the GNU General Public License
|
| 18 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
package com.amaze.filemanager.filesystem.files;
|
| 22 |
+
|
| 23 |
+
import static org.junit.Assert.assertEquals;
|
| 24 |
+
|
| 25 |
+
import org.junit.Before;
|
| 26 |
+
import org.junit.Test;
|
| 27 |
+
import org.junit.runner.RunWith;
|
| 28 |
+
|
| 29 |
+
import com.amaze.filemanager.BuildConfig;
|
| 30 |
+
import com.amaze.filemanager.utils.PasswordUtil;
|
| 31 |
+
|
| 32 |
+
import android.content.Context;
|
| 33 |
+
import android.util.Base64;
|
| 34 |
+
|
| 35 |
+
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
| 36 |
+
import androidx.test.platform.app.InstrumentationRegistry;
|
| 37 |
+
|
| 38 |
+
@RunWith(AndroidJUnit4.class)
|
| 39 |
+
public class CryptUtilTest {
|
| 40 |
+
|
| 41 |
+
private Context context;
|
| 42 |
+
|
| 43 |
+
@Before
|
| 44 |
+
public void setUp() {
|
| 45 |
+
context = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
@Test
|
| 49 |
+
public void testIvValueIsCorrect() {
|
| 50 |
+
assertEquals("LxbHiJhhUXcj", BuildConfig.CRYPTO_IV);
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
@Test
|
| 54 |
+
public void testEncryptDecrypt() throws Exception {
|
| 55 |
+
String password = "hackme";
|
| 56 |
+
String encrypted = PasswordUtil.INSTANCE.encryptPassword(context, password, Base64.URL_SAFE);
|
| 57 |
+
assertEquals(
|
| 58 |
+
password, PasswordUtil.INSTANCE.decryptPassword(context, encrypted, Base64.URL_SAFE));
|
| 59 |
+
}
|
| 60 |
+
}
|
app/src/androidTest/java/com/amaze/filemanager/filesystem/files/GenericCopyUtilEspressoTest.java
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright (C) 2014-2024 Arpit Khurana <arpitkh96@gmail.com>, Vishal Nehra <vishalmeham2@gmail.com>,
|
| 3 |
+
* Emmanuel Messulam<emmanuelbendavid@gmail.com>, Raymond Lai <airwave209gt at gmail.com> and Contributors.
|
| 4 |
+
*
|
| 5 |
+
* This file is part of Amaze File Manager.
|
| 6 |
+
*
|
| 7 |
+
* Amaze File Manager is free software: you can redistribute it and/or modify
|
| 8 |
+
* it under the terms of the GNU General Public License as published by
|
| 9 |
+
* the Free Software Foundation, either version 3 of the License, or
|
| 10 |
+
* (at your option) any later version.
|
| 11 |
+
*
|
| 12 |
+
* This program is distributed in the hope that it will be useful,
|
| 13 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 |
+
* GNU General Public License for more details.
|
| 16 |
+
*
|
| 17 |
+
* You should have received a copy of the GNU General Public License
|
| 18 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
package com.amaze.filemanager.filesystem.files;
|
| 22 |
+
|
| 23 |
+
import static org.junit.Assert.assertArrayEquals;
|
| 24 |
+
import static org.junit.Assert.assertEquals;
|
| 25 |
+
|
| 26 |
+
import java.io.BufferedInputStream;
|
| 27 |
+
import java.io.BufferedOutputStream;
|
| 28 |
+
import java.io.File;
|
| 29 |
+
import java.io.FileInputStream;
|
| 30 |
+
import java.io.FileOutputStream;
|
| 31 |
+
import java.io.IOException;
|
| 32 |
+
import java.nio.channels.Channels;
|
| 33 |
+
import java.security.DigestInputStream;
|
| 34 |
+
import java.security.MessageDigest;
|
| 35 |
+
import java.security.NoSuchAlgorithmException;
|
| 36 |
+
|
| 37 |
+
import org.junit.Before;
|
| 38 |
+
import org.junit.Test;
|
| 39 |
+
import org.junit.runner.RunWith;
|
| 40 |
+
|
| 41 |
+
import com.amaze.filemanager.asynchronous.management.ServiceWatcherUtil;
|
| 42 |
+
import com.amaze.filemanager.test.DummyFileGenerator;
|
| 43 |
+
import com.amaze.filemanager.utils.ProgressHandler;
|
| 44 |
+
|
| 45 |
+
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
| 46 |
+
import androidx.test.platform.app.InstrumentationRegistry;
|
| 47 |
+
|
| 48 |
+
@RunWith(AndroidJUnit4.class)
|
| 49 |
+
public class GenericCopyUtilEspressoTest {
|
| 50 |
+
|
| 51 |
+
private GenericCopyUtil copyUtil;
|
| 52 |
+
|
| 53 |
+
private File file1, file2;
|
| 54 |
+
|
| 55 |
+
@Before
|
| 56 |
+
public void setUp() throws IOException {
|
| 57 |
+
copyUtil =
|
| 58 |
+
new GenericCopyUtil(
|
| 59 |
+
InstrumentationRegistry.getInstrumentation().getTargetContext(), new ProgressHandler());
|
| 60 |
+
file1 = File.createTempFile("test", "bin");
|
| 61 |
+
file2 = File.createTempFile("test", "bin");
|
| 62 |
+
file1.deleteOnExit();
|
| 63 |
+
file2.deleteOnExit();
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
@Test
|
| 67 |
+
public void testCopyFile1() throws IOException, NoSuchAlgorithmException {
|
| 68 |
+
doTestCopyFile1(512);
|
| 69 |
+
doTestCopyFile1(10 * 1024 * 1024);
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
@Test
|
| 73 |
+
public void testCopyFile2() throws IOException, NoSuchAlgorithmException {
|
| 74 |
+
doTestCopyFile2(512);
|
| 75 |
+
doTestCopyFile2(10 * 1024 * 1024);
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
@Test
|
| 79 |
+
public void testCopyFile3() throws IOException, NoSuchAlgorithmException {
|
| 80 |
+
doTestCopyFile3(512);
|
| 81 |
+
doTestCopyFile3(10 * 1024 * 1024);
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
// doCopy(ReadableByteChannel in, WritableByteChannel out)
|
| 85 |
+
private void doTestCopyFile1(int size) throws IOException, NoSuchAlgorithmException {
|
| 86 |
+
byte[] checksum = DummyFileGenerator.createFile(file1, size);
|
| 87 |
+
copyUtil.doCopy(
|
| 88 |
+
new FileInputStream(file1).getChannel(),
|
| 89 |
+
Channels.newChannel(new FileOutputStream(file2)),
|
| 90 |
+
ServiceWatcherUtil.UPDATE_POSITION);
|
| 91 |
+
assertEquals(file1.length(), file2.length());
|
| 92 |
+
assertSha1Equals(checksum, file2);
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
// copy(FileChannel in, FileChannel out)
|
| 96 |
+
private void doTestCopyFile2(int size) throws IOException, NoSuchAlgorithmException {
|
| 97 |
+
byte[] checksum = DummyFileGenerator.createFile(file1, size);
|
| 98 |
+
copyUtil.copyFile(
|
| 99 |
+
new FileInputStream(file1).getChannel(),
|
| 100 |
+
new FileOutputStream(file2).getChannel(),
|
| 101 |
+
ServiceWatcherUtil.UPDATE_POSITION);
|
| 102 |
+
assertEquals(file1.length(), file2.length());
|
| 103 |
+
assertSha1Equals(checksum, file2);
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
// copy(BufferedInputStream in, BufferedOutputStream out)
|
| 107 |
+
private void doTestCopyFile3(int size) throws IOException, NoSuchAlgorithmException {
|
| 108 |
+
byte[] checksum = DummyFileGenerator.createFile(file1, size);
|
| 109 |
+
copyUtil.copyFile(
|
| 110 |
+
new BufferedInputStream(new FileInputStream(file1)),
|
| 111 |
+
new BufferedOutputStream(new FileOutputStream(file2)),
|
| 112 |
+
ServiceWatcherUtil.UPDATE_POSITION);
|
| 113 |
+
assertEquals(file1.length(), file2.length());
|
| 114 |
+
assertSha1Equals(checksum, file2);
|
| 115 |
+
}
|
| 116 |
+
|
| 117 |
+
private void assertSha1Equals(byte[] expected, File file)
|
| 118 |
+
throws NoSuchAlgorithmException, IOException {
|
| 119 |
+
MessageDigest md = MessageDigest.getInstance("SHA-1");
|
| 120 |
+
DigestInputStream in = new DigestInputStream(new FileInputStream(file), md);
|
| 121 |
+
byte[] buffer = new byte[GenericCopyUtil.DEFAULT_BUFFER_SIZE];
|
| 122 |
+
while (in.read(buffer) > -1) {}
|
| 123 |
+
in.close();
|
| 124 |
+
assertArrayEquals(expected, md.digest());
|
| 125 |
+
}
|
| 126 |
+
}
|
app/src/androidTest/java/com/amaze/filemanager/ssh/SshClientUtilTest.java
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright (C) 2014-2024 Arpit Khurana <arpitkh96@gmail.com>, Vishal Nehra <vishalmeham2@gmail.com>,
|
| 3 |
+
* Emmanuel Messulam<emmanuelbendavid@gmail.com>, Raymond Lai <airwave209gt at gmail.com> and Contributors.
|
| 4 |
+
*
|
| 5 |
+
* This file is part of Amaze File Manager.
|
| 6 |
+
*
|
| 7 |
+
* Amaze File Manager is free software: you can redistribute it and/or modify
|
| 8 |
+
* it under the terms of the GNU General Public License as published by
|
| 9 |
+
* the Free Software Foundation, either version 3 of the License, or
|
| 10 |
+
* (at your option) any later version.
|
| 11 |
+
*
|
| 12 |
+
* This program is distributed in the hope that it will be useful,
|
| 13 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 |
+
* GNU General Public License for more details.
|
| 16 |
+
*
|
| 17 |
+
* You should have received a copy of the GNU General Public License
|
| 18 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
package com.amaze.filemanager.ssh;
|
| 22 |
+
|
| 23 |
+
import static org.junit.Assert.assertEquals;
|
| 24 |
+
import static org.junit.Assert.assertTrue;
|
| 25 |
+
|
| 26 |
+
import org.junit.Test;
|
| 27 |
+
import org.junit.runner.RunWith;
|
| 28 |
+
|
| 29 |
+
import com.amaze.filemanager.filesystem.ftp.NetCopyClientUtils;
|
| 30 |
+
|
| 31 |
+
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
| 32 |
+
|
| 33 |
+
@RunWith(AndroidJUnit4.class)
|
| 34 |
+
public class SshClientUtilTest {
|
| 35 |
+
|
| 36 |
+
@Test
|
| 37 |
+
public void testEncryptDecryptUriWithNoPassword() {
|
| 38 |
+
String uri = "ssh://testuser@127.0.0.1:22";
|
| 39 |
+
assertEquals(uri, NetCopyClientUtils.INSTANCE.encryptFtpPathAsNecessary(uri));
|
| 40 |
+
assertEquals(uri, NetCopyClientUtils.INSTANCE.encryptFtpPathAsNecessary(uri));
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
@Test
|
| 44 |
+
public void testEncryptDecryptPasswordWithMinusSign1() {
|
| 45 |
+
String uri = "ssh://testuser:abcd-efgh@127.0.0.1:22";
|
| 46 |
+
String result = NetCopyClientUtils.INSTANCE.encryptFtpPathAsNecessary(uri);
|
| 47 |
+
assertTrue(result.contains("ssh://testuser:"));
|
| 48 |
+
assertTrue(result.contains("@127.0.0.1:22"));
|
| 49 |
+
String verify = NetCopyClientUtils.INSTANCE.decryptFtpPathAsNecessary(result);
|
| 50 |
+
assertEquals(uri, verify);
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
@Test
|
| 54 |
+
public void testEncryptDecryptPasswordWithMinusSign2() {
|
| 55 |
+
String uri = "ssh://testuser:---------------@127.0.0.1:22";
|
| 56 |
+
String result = NetCopyClientUtils.INSTANCE.encryptFtpPathAsNecessary(uri);
|
| 57 |
+
assertTrue(result.contains("ssh://testuser:"));
|
| 58 |
+
assertTrue(result.contains("@127.0.0.1:22"));
|
| 59 |
+
String verify = NetCopyClientUtils.INSTANCE.decryptFtpPathAsNecessary(result);
|
| 60 |
+
assertEquals(uri, verify);
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
@Test
|
| 64 |
+
public void testEncryptDecryptPasswordWithMinusSign3() {
|
| 65 |
+
String uri = "ssh://testuser:--agdiuhdpost15@127.0.0.1:22";
|
| 66 |
+
String result = NetCopyClientUtils.INSTANCE.encryptFtpPathAsNecessary(uri);
|
| 67 |
+
assertTrue(result.contains("ssh://testuser:"));
|
| 68 |
+
assertTrue(result.contains("@127.0.0.1:22"));
|
| 69 |
+
String verify = NetCopyClientUtils.INSTANCE.decryptFtpPathAsNecessary(result);
|
| 70 |
+
assertEquals(uri, verify);
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
@Test
|
| 74 |
+
public void testEncryptDecryptPasswordWithMinusSign4() {
|
| 75 |
+
String uri = "ssh://testuser:t-h-i-s-i-s-p-a-s-s-w-o-r-d-@127.0.0.1:22";
|
| 76 |
+
String result = NetCopyClientUtils.INSTANCE.encryptFtpPathAsNecessary(uri);
|
| 77 |
+
assertTrue(result.contains("ssh://testuser:"));
|
| 78 |
+
assertTrue(result.contains("@127.0.0.1:22"));
|
| 79 |
+
String verify = NetCopyClientUtils.INSTANCE.decryptFtpPathAsNecessary(result);
|
| 80 |
+
assertEquals(uri, verify);
|
| 81 |
+
}
|
| 82 |
+
}
|
app/src/androidTest/java/com/amaze/filemanager/test/DummyFileGenerator.java
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright (C) 2014-2024 Arpit Khurana <arpitkh96@gmail.com>, Vishal Nehra <vishalmeham2@gmail.com>,
|
| 3 |
+
* Emmanuel Messulam<emmanuelbendavid@gmail.com>, Raymond Lai <airwave209gt at gmail.com> and Contributors.
|
| 4 |
+
*
|
| 5 |
+
* This file is part of Amaze File Manager.
|
| 6 |
+
*
|
| 7 |
+
* Amaze File Manager is free software: you can redistribute it and/or modify
|
| 8 |
+
* it under the terms of the GNU General Public License as published by
|
| 9 |
+
* the Free Software Foundation, either version 3 of the License, or
|
| 10 |
+
* (at your option) any later version.
|
| 11 |
+
*
|
| 12 |
+
* This program is distributed in the hope that it will be useful,
|
| 13 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 |
+
* GNU General Public License for more details.
|
| 16 |
+
*
|
| 17 |
+
* You should have received a copy of the GNU General Public License
|
| 18 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
package com.amaze.filemanager.test;
|
| 22 |
+
|
| 23 |
+
import static com.amaze.filemanager.filesystem.files.GenericCopyUtil.DEFAULT_BUFFER_SIZE;
|
| 24 |
+
|
| 25 |
+
import java.io.File;
|
| 26 |
+
import java.io.FileOutputStream;
|
| 27 |
+
import java.io.IOException;
|
| 28 |
+
import java.security.DigestOutputStream;
|
| 29 |
+
import java.security.MessageDigest;
|
| 30 |
+
import java.security.NoSuchAlgorithmException;
|
| 31 |
+
import java.security.SecureRandom;
|
| 32 |
+
import java.util.Random;
|
| 33 |
+
|
| 34 |
+
import androidx.annotation.NonNull;
|
| 35 |
+
import androidx.annotation.RestrictTo;
|
| 36 |
+
import androidx.annotation.VisibleForTesting;
|
| 37 |
+
|
| 38 |
+
/**
|
| 39 |
+
* Generate file of specified size using randomly generated bytes.
|
| 40 |
+
*
|
| 41 |
+
* <p>Because of the need that both Espresso and Robolectric tests depends on it, it needs to be
|
| 42 |
+
* placed at the main source tree, and hide it using {@link VisibleForTesting}.
|
| 43 |
+
*/
|
| 44 |
+
@VisibleForTesting(otherwise = VisibleForTesting.NONE)
|
| 45 |
+
@RestrictTo(RestrictTo.Scope.TESTS)
|
| 46 |
+
public abstract class DummyFileGenerator {
|
| 47 |
+
|
| 48 |
+
/**
|
| 49 |
+
* @param destFile File to be generated with random bytes
|
| 50 |
+
* @param size file size
|
| 51 |
+
* @return SHA1 checksum of the generated file, as byte array
|
| 52 |
+
* @throws IOException in case any I/O error occurred
|
| 53 |
+
*/
|
| 54 |
+
@VisibleForTesting(otherwise = VisibleForTesting.NONE)
|
| 55 |
+
@RestrictTo(RestrictTo.Scope.TESTS)
|
| 56 |
+
public static byte[] createFile(@NonNull File destFile, int size) throws IOException {
|
| 57 |
+
Random rand = new SecureRandom();
|
| 58 |
+
MessageDigest md = null;
|
| 59 |
+
try {
|
| 60 |
+
md = MessageDigest.getInstance("SHA-1");
|
| 61 |
+
} catch (NoSuchAlgorithmException shouldNeverHappen) {
|
| 62 |
+
throw new IOException("SHA-1 implementation not found");
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
FileOutputStream out = new FileOutputStream(destFile);
|
| 66 |
+
DigestOutputStream dout = new DigestOutputStream(out, md);
|
| 67 |
+
int count = 0;
|
| 68 |
+
for (int i = size; i >= 0; i -= DEFAULT_BUFFER_SIZE, count += DEFAULT_BUFFER_SIZE) {
|
| 69 |
+
byte[] bytes = new byte[i > DEFAULT_BUFFER_SIZE ? DEFAULT_BUFFER_SIZE : i];
|
| 70 |
+
rand.nextBytes(bytes);
|
| 71 |
+
dout.write(bytes);
|
| 72 |
+
}
|
| 73 |
+
dout.flush();
|
| 74 |
+
dout.close();
|
| 75 |
+
|
| 76 |
+
return md.digest();
|
| 77 |
+
}
|
| 78 |
+
}
|
app/src/androidTest/java/com/amaze/filemanager/test/StoragePermissionHelper.kt
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright (C) 2014-2025 Arpit Khurana <arpitkh96@gmail.com>, Vishal Nehra <vishalmeham2@gmail.com>,
|
| 3 |
+
* Emmanuel Messulam<emmanuelbendavid@gmail.com>, Raymond Lai <airwave209gt at gmail.com> and Contributors.
|
| 4 |
+
*
|
| 5 |
+
* This file is part of Amaze File Manager.
|
| 6 |
+
*
|
| 7 |
+
* Amaze File Manager is free software: you can redistribute it and/or modify
|
| 8 |
+
* it under the terms of the GNU General Public License as published by
|
| 9 |
+
* the Free Software Foundation, either version 3 of the License, or
|
| 10 |
+
* (at your option) any later version.
|
| 11 |
+
*
|
| 12 |
+
* This program is distributed in the hope that it will be useful,
|
| 13 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 |
+
* GNU General Public License for more details.
|
| 16 |
+
*
|
| 17 |
+
* You should have received a copy of the GNU General Public License
|
| 18 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
package com.amaze.filemanager.test
|
| 22 |
+
|
| 23 |
+
import android.content.Context
|
| 24 |
+
import androidx.test.core.app.ActivityScenario
|
| 25 |
+
import androidx.test.espresso.Espresso.onView
|
| 26 |
+
import androidx.test.espresso.action.ViewActions.click
|
| 27 |
+
import androidx.test.espresso.matcher.ViewMatchers.withText
|
| 28 |
+
import androidx.test.platform.app.InstrumentationRegistry
|
| 29 |
+
import androidx.test.uiautomator.By
|
| 30 |
+
import androidx.test.uiautomator.UiDevice
|
| 31 |
+
import androidx.test.uiautomator.UiSelector
|
| 32 |
+
import com.amaze.filemanager.R
|
| 33 |
+
import com.amaze.filemanager.ui.activities.MainActivity
|
| 34 |
+
|
| 35 |
+
object StoragePermissionHelper {
|
| 36 |
+
/**
|
| 37 |
+
* From https://github.com/android/android-test/issues/1658#issue-1551755250
|
| 38 |
+
* HACK this grants access to external storage "manually" because other solutions don't seem
|
| 39 |
+
* to set the permission.
|
| 40 |
+
*/
|
| 41 |
+
@JvmStatic
|
| 42 |
+
fun grantManageStoragePermission() {
|
| 43 |
+
// Ensure that an activity that has the dialog is launched
|
| 44 |
+
ActivityScenario.launch(MainActivity::class.java)
|
| 45 |
+
|
| 46 |
+
val context: Context = InstrumentationRegistry.getInstrumentation().targetContext
|
| 47 |
+
val device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
|
| 48 |
+
|
| 49 |
+
val amazeResources = context.packageManager.getResourcesForApplication(context.packageName)
|
| 50 |
+
val grantPermissionExplanation = amazeResources.getString(R.string.grant_all_files_permission)
|
| 51 |
+
|
| 52 |
+
if (device.hasObject(By.text(grantPermissionExplanation))) {
|
| 53 |
+
// First press Amaze's grant button
|
| 54 |
+
onView(withText(R.string.grant)).perform(click())
|
| 55 |
+
|
| 56 |
+
// Identifier names are taken here:
|
| 57 |
+
// https://cs.android.com/android/platform/superproject/+/master:packages/apps/Settings/res/values/strings.xml
|
| 58 |
+
val resources = context.packageManager.getResourcesForApplication("com.android.settings")
|
| 59 |
+
val resId =
|
| 60 |
+
resources.getIdentifier(
|
| 61 |
+
"permit_manage_external_storage",
|
| 62 |
+
"string",
|
| 63 |
+
"com.android.settings",
|
| 64 |
+
)
|
| 65 |
+
val permitManageExternalStorage = resources.getString(resId)
|
| 66 |
+
|
| 67 |
+
val grantToggle =
|
| 68 |
+
device.findObject(UiSelector().textMatches("(?i)$permitManageExternalStorage"))
|
| 69 |
+
grantToggle.click()
|
| 70 |
+
device.pressBack()
|
| 71 |
+
}
|
| 72 |
+
}
|
| 73 |
+
}
|
app/src/androidTest/java/com/amaze/filemanager/ui/activities/TextEditorActivityEspressoTest.java
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright (C) 2014-2024 Arpit Khurana <arpitkh96@gmail.com>, Vishal Nehra <vishalmeham2@gmail.com>,
|
| 3 |
+
* Emmanuel Messulam<emmanuelbendavid@gmail.com>, Raymond Lai <airwave209gt at gmail.com> and Contributors.
|
| 4 |
+
*
|
| 5 |
+
* This file is part of Amaze File Manager.
|
| 6 |
+
*
|
| 7 |
+
* Amaze File Manager is free software: you can redistribute it and/or modify
|
| 8 |
+
* it under the terms of the GNU General Public License as published by
|
| 9 |
+
* the Free Software Foundation, either version 3 of the License, or
|
| 10 |
+
* (at your option) any later version.
|
| 11 |
+
*
|
| 12 |
+
* This program is distributed in the hope that it will be useful,
|
| 13 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 |
+
* GNU General Public License for more details.
|
| 16 |
+
*
|
| 17 |
+
* You should have received a copy of the GNU General Public License
|
| 18 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
package com.amaze.filemanager.ui.activities;
|
| 22 |
+
|
| 23 |
+
import static org.junit.Assert.assertNotEquals;
|
| 24 |
+
|
| 25 |
+
import java.io.File;
|
| 26 |
+
import java.util.concurrent.CountDownLatch;
|
| 27 |
+
|
| 28 |
+
import org.junit.Before;
|
| 29 |
+
import org.junit.Test;
|
| 30 |
+
import org.junit.runner.RunWith;
|
| 31 |
+
|
| 32 |
+
import com.amaze.filemanager.ui.activities.texteditor.TextEditorActivity;
|
| 33 |
+
|
| 34 |
+
import android.content.Context;
|
| 35 |
+
import android.content.Intent;
|
| 36 |
+
import android.net.Uri;
|
| 37 |
+
|
| 38 |
+
import androidx.test.core.app.ActivityScenario;
|
| 39 |
+
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
| 40 |
+
import androidx.test.filters.SmallTest;
|
| 41 |
+
import androidx.test.filters.Suppress;
|
| 42 |
+
import androidx.test.platform.app.InstrumentationRegistry;
|
| 43 |
+
|
| 44 |
+
@SmallTest
|
| 45 |
+
@RunWith(AndroidJUnit4.class)
|
| 46 |
+
@Suppress
|
| 47 |
+
// Have to rewrite to cope with Android 11 storage access model
|
| 48 |
+
public class TextEditorActivityEspressoTest {
|
| 49 |
+
|
| 50 |
+
private Context context;
|
| 51 |
+
|
| 52 |
+
private Uri uri;
|
| 53 |
+
|
| 54 |
+
@Before
|
| 55 |
+
public void setUp() {
|
| 56 |
+
context = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
| 57 |
+
|
| 58 |
+
File file = new File("/default.prop");
|
| 59 |
+
uri = Uri.fromFile(file);
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
@Test
|
| 63 |
+
public void testOpenFile() {
|
| 64 |
+
Intent intent =
|
| 65 |
+
new Intent(context, TextEditorActivity.class)
|
| 66 |
+
.setAction(Intent.ACTION_VIEW)
|
| 67 |
+
.addCategory(Intent.CATEGORY_DEFAULT)
|
| 68 |
+
.setType("text/plain")
|
| 69 |
+
.setData(uri);
|
| 70 |
+
try (ActivityScenario<TextEditorActivity> scenario = ActivityScenario.launch(intent)) {
|
| 71 |
+
scenario.onActivity(
|
| 72 |
+
activity -> {
|
| 73 |
+
CountDownLatch waiter = new CountDownLatch(1);
|
| 74 |
+
try {
|
| 75 |
+
while ("".equals(activity.mainTextView.getText().toString())) {
|
| 76 |
+
waiter.await();
|
| 77 |
+
}
|
| 78 |
+
} catch (InterruptedException ignored) {
|
| 79 |
+
}
|
| 80 |
+
waiter.countDown();
|
| 81 |
+
assertNotEquals("", activity.mainTextView.getText().toString());
|
| 82 |
+
assertNotEquals("foobar", activity.mainTextView.getText().toString());
|
| 83 |
+
// Add extra time for you to see the Activity did load, and text is actually there
|
| 84 |
+
// Thread.sleep(1000);
|
| 85 |
+
});
|
| 86 |
+
}
|
| 87 |
+
}
|
| 88 |
+
}
|
app/src/androidTest/java/com/amaze/filemanager/ui/fragments/BackupPrefsFragmentTest.kt
ADDED
|
@@ -0,0 +1,243 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright (C) 2014-2025 Arpit Khurana <arpitkh96@gmail.com>, Vishal Nehra <vishalmeham2@gmail.com>,
|
| 3 |
+
* Emmanuel Messulam<emmanuelbendavid@gmail.com>, Raymond Lai <airwave209gt at gmail.com> and Contributors.
|
| 4 |
+
*
|
| 5 |
+
* This file is part of Amaze File Manager.
|
| 6 |
+
*
|
| 7 |
+
* Amaze File Manager is free software: you can redistribute it and/or modify
|
| 8 |
+
* it under the terms of the GNU General Public License as published by
|
| 9 |
+
* the Free Software Foundation, either version 3 of the License, or
|
| 10 |
+
* (at your option) any later version.
|
| 11 |
+
*
|
| 12 |
+
* This program is distributed in the hope that it will be useful,
|
| 13 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 |
+
* GNU General Public License for more details.
|
| 16 |
+
*
|
| 17 |
+
* You should have received a copy of the GNU General Public License
|
| 18 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
package com.amaze.filemanager.ui.fragments
|
| 22 |
+
|
| 23 |
+
import android.app.Activity
|
| 24 |
+
import android.content.Context
|
| 25 |
+
import android.content.Intent
|
| 26 |
+
import android.content.SharedPreferences
|
| 27 |
+
import android.net.Uri
|
| 28 |
+
import android.os.Build.VERSION.SDK_INT
|
| 29 |
+
import android.os.Build.VERSION_CODES.TIRAMISU
|
| 30 |
+
import androidx.lifecycle.Lifecycle
|
| 31 |
+
import androidx.preference.PreferenceManager
|
| 32 |
+
import androidx.test.core.app.ActivityScenario
|
| 33 |
+
import androidx.test.core.app.ApplicationProvider
|
| 34 |
+
import androidx.test.espresso.Espresso.onView
|
| 35 |
+
import androidx.test.espresso.action.ViewActions
|
| 36 |
+
import androidx.test.espresso.matcher.ViewMatchers.withId
|
| 37 |
+
import androidx.test.espresso.matcher.ViewMatchers.withText
|
| 38 |
+
import androidx.test.ext.junit.runners.AndroidJUnit4
|
| 39 |
+
import androidx.test.rule.GrantPermissionRule
|
| 40 |
+
import com.amaze.filemanager.R
|
| 41 |
+
import com.amaze.filemanager.test.StoragePermissionHelper
|
| 42 |
+
import com.amaze.filemanager.ui.activities.PreferencesActivity
|
| 43 |
+
import com.amaze.filemanager.ui.fragments.preferencefragments.BackupPrefsFragment
|
| 44 |
+
import com.google.gson.GsonBuilder
|
| 45 |
+
import com.google.gson.reflect.TypeToken
|
| 46 |
+
import org.junit.Assert.assertEquals
|
| 47 |
+
import org.junit.Assert.assertFalse
|
| 48 |
+
import org.junit.Assert.assertTrue
|
| 49 |
+
import org.junit.Assert.fail
|
| 50 |
+
import org.junit.Before
|
| 51 |
+
import org.junit.Rule
|
| 52 |
+
import org.junit.Test
|
| 53 |
+
import org.junit.runner.RunWith
|
| 54 |
+
import java.io.File
|
| 55 |
+
|
| 56 |
+
@RunWith(AndroidJUnit4::class)
|
| 57 |
+
class BackupPrefsFragmentTest {
|
| 58 |
+
var storagePath = "/storage/emulated/0"
|
| 59 |
+
var fileName = "amaze_backup.json"
|
| 60 |
+
|
| 61 |
+
@Rule
|
| 62 |
+
@JvmField
|
| 63 |
+
val storagePermissionRule: GrantPermissionRule =
|
| 64 |
+
GrantPermissionRule
|
| 65 |
+
.grant(android.Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
| 66 |
+
|
| 67 |
+
@Rule
|
| 68 |
+
@JvmField
|
| 69 |
+
val notificationPermissionRule: GrantPermissionRule =
|
| 70 |
+
if (SDK_INT >= TIRAMISU) {
|
| 71 |
+
GrantPermissionRule.grant(android.Manifest.permission.POST_NOTIFICATIONS)
|
| 72 |
+
} else {
|
| 73 |
+
GrantPermissionRule.grant()
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
/**
|
| 77 |
+
* Storage permission is needed for saving the preferences to a user accessible file
|
| 78 |
+
*/
|
| 79 |
+
@Before
|
| 80 |
+
fun grantManageStoragePermission() {
|
| 81 |
+
StoragePermissionHelper.grantManageStoragePermission()
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
/** Test exporting and reimporting preferences */
|
| 85 |
+
@Test
|
| 86 |
+
fun testPreferencesExportImport() {
|
| 87 |
+
val context = ApplicationProvider.getApplicationContext<Context>()
|
| 88 |
+
|
| 89 |
+
val exportFile = File("$storagePath${File.separator}$fileName")
|
| 90 |
+
exportFile.delete() // delete if already exists
|
| 91 |
+
|
| 92 |
+
export(context, exportFile)
|
| 93 |
+
import(exportFile)
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
/**
|
| 97 |
+
* Test whether the exported file contains the expected preference values
|
| 98 |
+
*/
|
| 99 |
+
private fun export(
|
| 100 |
+
context: Context,
|
| 101 |
+
exportFile: File,
|
| 102 |
+
) {
|
| 103 |
+
val backupPrefsFragment = BackupPrefsFragment()
|
| 104 |
+
val activityScenario = ActivityScenario.launch(PreferencesActivity::class.java)
|
| 105 |
+
|
| 106 |
+
activityScenario.moveToState(Lifecycle.State.STARTED)
|
| 107 |
+
|
| 108 |
+
activityScenario.onActivity {
|
| 109 |
+
it.supportFragmentManager.beginTransaction()
|
| 110 |
+
.add(backupPrefsFragment, null)
|
| 111 |
+
.commitNow()
|
| 112 |
+
|
| 113 |
+
backupPrefsFragment.exportPrefs()
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
val tempFile = File("${context.cacheDir.absolutePath}${File.separator}$fileName")
|
| 117 |
+
|
| 118 |
+
assertTrue(tempFile.exists())
|
| 119 |
+
|
| 120 |
+
onView(withId(R.id.home)).perform(ViewActions.click())
|
| 121 |
+
onView(withText(R.string.save)).perform(ViewActions.click())
|
| 122 |
+
|
| 123 |
+
assertTrue(exportFile.exists())
|
| 124 |
+
|
| 125 |
+
activityScenario.onActivity { preferencesActivity ->
|
| 126 |
+
val preferences = PreferenceManager.getDefaultSharedPreferences(preferencesActivity)
|
| 127 |
+
val preferenceMap: Map<String?, *> = preferences.all
|
| 128 |
+
|
| 129 |
+
val inputString =
|
| 130 |
+
exportFile
|
| 131 |
+
.inputStream()
|
| 132 |
+
.bufferedReader()
|
| 133 |
+
.use {
|
| 134 |
+
it.readText()
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
val type = object : TypeToken<Map<String?, *>>() {}.type
|
| 138 |
+
|
| 139 |
+
val importMap: Map<String?, *> =
|
| 140 |
+
GsonBuilder()
|
| 141 |
+
.create()
|
| 142 |
+
.fromJson(
|
| 143 |
+
inputString,
|
| 144 |
+
type,
|
| 145 |
+
)
|
| 146 |
+
|
| 147 |
+
for ((key, value) in preferenceMap) {
|
| 148 |
+
val importedValue = importMap[key]
|
| 149 |
+
val mapValue =
|
| 150 |
+
if (importedValue != null && importedValue::class.simpleName.equals("Double")) {
|
| 151 |
+
(importedValue as Double).toInt() // since Gson parses Integer as Double
|
| 152 |
+
} else {
|
| 153 |
+
importedValue
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
assertEquals("Difference found at key $key", value, mapValue)
|
| 157 |
+
}
|
| 158 |
+
}
|
| 159 |
+
}
|
| 160 |
+
|
| 161 |
+
/**
|
| 162 |
+
* Test whether the imported preferences contains the expected values
|
| 163 |
+
*/
|
| 164 |
+
private fun import(exportFile: File) {
|
| 165 |
+
val activityScenario = ActivityScenario.launch(PreferencesActivity::class.java)
|
| 166 |
+
activityScenario.moveToState(Lifecycle.State.STARTED)
|
| 167 |
+
|
| 168 |
+
val backupPrefsFragment = BackupPrefsFragment()
|
| 169 |
+
|
| 170 |
+
activityScenario.onActivity { preferencesActivity ->
|
| 171 |
+
preferencesActivity.supportFragmentManager.beginTransaction()
|
| 172 |
+
.add(backupPrefsFragment, null)
|
| 173 |
+
.commitNow()
|
| 174 |
+
|
| 175 |
+
javaClass.getResourceAsStream("/$fileName")?.copyTo(exportFile.outputStream())
|
| 176 |
+
|
| 177 |
+
backupPrefsFragment.onActivityResult(
|
| 178 |
+
BackupPrefsFragment.IMPORT_BACKUP_FILE,
|
| 179 |
+
Activity.RESULT_OK,
|
| 180 |
+
Intent().setData(
|
| 181 |
+
Uri.fromFile(exportFile),
|
| 182 |
+
),
|
| 183 |
+
)
|
| 184 |
+
|
| 185 |
+
val inputString =
|
| 186 |
+
exportFile
|
| 187 |
+
.inputStream()
|
| 188 |
+
.bufferedReader()
|
| 189 |
+
.use {
|
| 190 |
+
it.readText()
|
| 191 |
+
}
|
| 192 |
+
|
| 193 |
+
val type = object : TypeToken<Map<String?, *>>() {}.type
|
| 194 |
+
|
| 195 |
+
val importMap: Map<String?, *> =
|
| 196 |
+
GsonBuilder()
|
| 197 |
+
.create()
|
| 198 |
+
.fromJson(inputString, type)
|
| 199 |
+
|
| 200 |
+
val preferences = PreferenceManager.getDefaultSharedPreferences(preferencesActivity)
|
| 201 |
+
|
| 202 |
+
val preferenceMap: Map<String?, *> = preferences.all
|
| 203 |
+
|
| 204 |
+
assertFalse(preferenceMap.containsKey(null))
|
| 205 |
+
|
| 206 |
+
for ((k, v) in preferenceMap) {
|
| 207 |
+
// This cast tells the kotlin type checker that fail() never returns
|
| 208 |
+
val key = k ?: (fail() as Nothing)
|
| 209 |
+
val value = v ?: (fail() as Nothing)
|
| 210 |
+
|
| 211 |
+
assertTrue("checkPrefEqual($key) failed", checkPrefEqual(preferences, importMap, key, value))
|
| 212 |
+
}
|
| 213 |
+
}
|
| 214 |
+
}
|
| 215 |
+
|
| 216 |
+
private fun checkPrefEqual(
|
| 217 |
+
preferences: SharedPreferences,
|
| 218 |
+
importMap: Map<String?, *>,
|
| 219 |
+
key: String,
|
| 220 |
+
value: Any,
|
| 221 |
+
): Boolean {
|
| 222 |
+
when (value::class.simpleName) {
|
| 223 |
+
"Boolean" -> return importMap[key] as Boolean ==
|
| 224 |
+
preferences.getBoolean(key, false)
|
| 225 |
+
"Float" ->
|
| 226 |
+
importMap[key] as Float ==
|
| 227 |
+
preferences.getFloat(key, 0f)
|
| 228 |
+
"Int" -> {
|
| 229 |
+
// since Gson parses Integer as Double
|
| 230 |
+
val toInt = (importMap[key] as Double).toInt()
|
| 231 |
+
|
| 232 |
+
return toInt == preferences.getInt(key, 0)
|
| 233 |
+
}
|
| 234 |
+
"Long" -> return importMap[key] as Long ==
|
| 235 |
+
preferences.getLong(key, 0L)
|
| 236 |
+
"String" -> return importMap[key] as String ==
|
| 237 |
+
preferences.getString(key, null)
|
| 238 |
+
"Set<*>" -> return importMap[key] as Set<*> ==
|
| 239 |
+
preferences.getStringSet(key, null)
|
| 240 |
+
}
|
| 241 |
+
return false
|
| 242 |
+
}
|
| 243 |
+
}
|
app/src/androidTest/java/com/amaze/filemanager/ui/fragments/TabFragmentTest.kt
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
package com.amaze.filemanager.ui.fragments
|
| 2 |
+
|
| 3 |
+
import android.content.pm.ActivityInfo
|
| 4 |
+
import android.os.Build.VERSION.SDK_INT
|
| 5 |
+
import android.os.Build.VERSION_CODES.TIRAMISU
|
| 6 |
+
import androidx.test.espresso.Espresso.onView
|
| 7 |
+
import androidx.test.espresso.action.ViewActions.swipeLeft
|
| 8 |
+
import androidx.test.espresso.action.ViewActions.swipeRight
|
| 9 |
+
import androidx.test.espresso.matcher.ViewMatchers.withId
|
| 10 |
+
import androidx.test.ext.junit.runners.AndroidJUnit4
|
| 11 |
+
import androidx.test.platform.app.InstrumentationRegistry
|
| 12 |
+
import androidx.test.rule.ActivityTestRule
|
| 13 |
+
import androidx.test.rule.GrantPermissionRule
|
| 14 |
+
import com.amaze.filemanager.R
|
| 15 |
+
import com.amaze.filemanager.test.StoragePermissionHelper
|
| 16 |
+
import com.amaze.filemanager.ui.activities.MainActivity
|
| 17 |
+
import org.junit.Before
|
| 18 |
+
import org.junit.Rule
|
| 19 |
+
import org.junit.Test
|
| 20 |
+
import org.junit.runner.RunWith
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* Tests for [TabFragment] functionality, mainly for
|
| 24 |
+
* https://github.com/TeamAmaze/AmazeFileManager/issues/1555.
|
| 25 |
+
*
|
| 26 |
+
* Note: deprecated methods and classes are used here for best reproducing the issues.
|
| 27 |
+
*/
|
| 28 |
+
@Suppress("DEPRECATION")
|
| 29 |
+
@RunWith(AndroidJUnit4::class)
|
| 30 |
+
class TabFragmentTest {
|
| 31 |
+
@get:Rule
|
| 32 |
+
val activityRule = ActivityTestRule(MainActivity::class.java)
|
| 33 |
+
|
| 34 |
+
@Rule
|
| 35 |
+
@JvmField
|
| 36 |
+
val storagePermissionRule: GrantPermissionRule =
|
| 37 |
+
GrantPermissionRule
|
| 38 |
+
.grant(android.Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
| 39 |
+
|
| 40 |
+
@Rule
|
| 41 |
+
@JvmField
|
| 42 |
+
val notificationPermissionRule: GrantPermissionRule =
|
| 43 |
+
if (SDK_INT >= TIRAMISU) {
|
| 44 |
+
GrantPermissionRule.grant(android.Manifest.permission.POST_NOTIFICATIONS)
|
| 45 |
+
} else {
|
| 46 |
+
GrantPermissionRule.grant()
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
@Before
|
| 50 |
+
fun grantManageStoragePermission() {
|
| 51 |
+
StoragePermissionHelper.grantManageStoragePermission()
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
/**
|
| 55 |
+
* This test causes a rotation to happen while the MainFragment detaches, to check if it
|
| 56 |
+
* fails. This could happen in reality, but should be very rare
|
| 57 |
+
*/
|
| 58 |
+
@Test
|
| 59 |
+
fun testFragmentStateSavingDuringDetachment() {
|
| 60 |
+
activityRule.activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
|
| 61 |
+
|
| 62 |
+
// Get the TabFragment
|
| 63 |
+
InstrumentationRegistry.getInstrumentation().runOnMainSync {
|
| 64 |
+
val activity = activityRule.activity
|
| 65 |
+
val tabFragment =
|
| 66 |
+
activity.supportFragmentManager
|
| 67 |
+
.findFragmentById(R.id.content_frame) as TabFragment
|
| 68 |
+
|
| 69 |
+
// Detach fragment through FragmentManager
|
| 70 |
+
activity.supportFragmentManager.beginTransaction().apply {
|
| 71 |
+
tabFragment.fragments.forEach { detach(it) }
|
| 72 |
+
commit()
|
| 73 |
+
}
|
| 74 |
+
}
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
/**
|
| 78 |
+
* Check if the fragment state is saved correctly during a configuration change
|
| 79 |
+
* by rotate the screen while swiping between the tabs.
|
| 80 |
+
*/
|
| 81 |
+
@Test
|
| 82 |
+
fun testFragmentStateSavingDuringConfigChange() {
|
| 83 |
+
// First perform the swipe action
|
| 84 |
+
onView(withId(R.id.pager)).perform(swipeLeft())
|
| 85 |
+
|
| 86 |
+
// Force a configuration change by rotating the screen
|
| 87 |
+
activityRule.activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
|
| 88 |
+
Thread.sleep(1000) // Give time for the rotation to complete
|
| 89 |
+
activityRule.activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
/**
|
| 93 |
+
* Check if the fragment state is saved correctly during rapid tab swiping.
|
| 94 |
+
*/
|
| 95 |
+
@Test
|
| 96 |
+
fun testRapidTabSwitchingAndStateSaving() {
|
| 97 |
+
// Perform rapid tab switches
|
| 98 |
+
repeat(10) {
|
| 99 |
+
onView(withId(R.id.pager)).perform(swipeLeft())
|
| 100 |
+
Thread.sleep(100) // Small delay to ensure swipe completes
|
| 101 |
+
onView(withId(R.id.pager)).perform(swipeRight())
|
| 102 |
+
Thread.sleep(100) // Small delay to ensure swipe completes
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
// Force a save state by rotating
|
| 106 |
+
activityRule.activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
/**
|
| 110 |
+
* Check if the fragment state is saved correctly when the fragment is detached.
|
| 111 |
+
*/
|
| 112 |
+
@Test
|
| 113 |
+
fun testFragmentDetachmentAndStateSaving() {
|
| 114 |
+
// First switch to a different tab
|
| 115 |
+
onView(withId(R.id.pager)).perform(swipeLeft())
|
| 116 |
+
|
| 117 |
+
// Get the TabFragment
|
| 118 |
+
InstrumentationRegistry.getInstrumentation().runOnMainSync {
|
| 119 |
+
val activity = activityRule.activity
|
| 120 |
+
val tabFragment =
|
| 121 |
+
activity.supportFragmentManager
|
| 122 |
+
.findFragmentById(R.id.content_frame) as TabFragment
|
| 123 |
+
|
| 124 |
+
// Detach fragment through FragmentManager
|
| 125 |
+
activity.supportFragmentManager.beginTransaction().apply {
|
| 126 |
+
tabFragment.fragments.firstOrNull()?.let { detach(it) }
|
| 127 |
+
commit()
|
| 128 |
+
}
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
// Force state save through configuration change
|
| 132 |
+
activityRule.activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
|
| 133 |
+
}
|
| 134 |
+
}
|
app/src/androidTest/java/com/amaze/filemanager/utils/CryptUtilEspressoTest.kt
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright (C) 2014-2022 Arpit Khurana <arpitkh96@gmail.com>, Vishal Nehra <vishalmeham2@gmail.com>,
|
| 3 |
+
* Emmanuel Messulam<emmanuelbendavid@gmail.com>, Raymond Lai <airwave209gt at gmail.com> and Contributors.
|
| 4 |
+
*
|
| 5 |
+
* This file is part of Amaze File Manager.
|
| 6 |
+
*
|
| 7 |
+
* Amaze File Manager is free software: you can redistribute it and/or modify
|
| 8 |
+
* it under the terms of the GNU General Public License as published by
|
| 9 |
+
* the Free Software Foundation, either version 3 of the License, or
|
| 10 |
+
* (at your option) any later version.
|
| 11 |
+
*
|
| 12 |
+
* This program is distributed in the hope that it will be useful,
|
| 13 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 |
+
* GNU General Public License for more details.
|
| 16 |
+
*
|
| 17 |
+
* You should have received a copy of the GNU General Public License
|
| 18 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
package com.amaze.filemanager.utils
|
| 22 |
+
|
| 23 |
+
import android.os.Build.VERSION.SDK_INT
|
| 24 |
+
import android.os.Build.VERSION_CODES.JELLY_BEAN_MR2
|
| 25 |
+
import android.os.Environment
|
| 26 |
+
import androidx.test.ext.junit.runners.AndroidJUnit4
|
| 27 |
+
import androidx.test.filters.SmallTest
|
| 28 |
+
import androidx.test.rule.GrantPermissionRule
|
| 29 |
+
import com.amaze.filemanager.application.AppConfig
|
| 30 |
+
import com.amaze.filemanager.filesystem.HybridFileParcelable
|
| 31 |
+
import com.amaze.filemanager.filesystem.files.CryptUtil
|
| 32 |
+
import org.junit.Assert.assertArrayEquals
|
| 33 |
+
import org.junit.Assert.assertTrue
|
| 34 |
+
import org.junit.Rule
|
| 35 |
+
import org.junit.Test
|
| 36 |
+
import org.junit.runner.RunWith
|
| 37 |
+
import java.io.ByteArrayInputStream
|
| 38 |
+
import java.io.File
|
| 39 |
+
import java.io.FileOutputStream
|
| 40 |
+
import kotlin.random.Random
|
| 41 |
+
|
| 42 |
+
/**
|
| 43 |
+
* Test for [CryptUtil] against real devices.
|
| 44 |
+
*
|
| 45 |
+
*/
|
| 46 |
+
@SmallTest
|
| 47 |
+
@RunWith(AndroidJUnit4::class)
|
| 48 |
+
@Suppress("StringLiteralDuplication")
|
| 49 |
+
class CryptUtilEspressoTest {
|
| 50 |
+
@Rule @JvmField
|
| 51 |
+
val storagePermissionRule: GrantPermissionRule =
|
| 52 |
+
GrantPermissionRule
|
| 53 |
+
.grant(android.Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
| 54 |
+
|
| 55 |
+
/**
|
| 56 |
+
* Sanity test of CryptUtil legacy method, to ensure refactoring won't break
|
| 57 |
+
* on physical devices
|
| 58 |
+
*/
|
| 59 |
+
@Test
|
| 60 |
+
fun testEncryptDecryptLegacyMethod() {
|
| 61 |
+
val source = Random(System.currentTimeMillis()).nextBytes(117)
|
| 62 |
+
val sourceFile = File(Environment.getExternalStorageDirectory(), "test.bin")
|
| 63 |
+
ByteArrayInputStream(source).copyTo(FileOutputStream(sourceFile))
|
| 64 |
+
CryptUtil(
|
| 65 |
+
AppConfig.getInstance(),
|
| 66 |
+
HybridFileParcelable(sourceFile.absolutePath),
|
| 67 |
+
ProgressHandler(),
|
| 68 |
+
ArrayList(),
|
| 69 |
+
"test.bin${CryptUtil.CRYPT_EXTENSION}",
|
| 70 |
+
false,
|
| 71 |
+
null,
|
| 72 |
+
)
|
| 73 |
+
val targetFile =
|
| 74 |
+
File(
|
| 75 |
+
Environment.getExternalStorageDirectory(),
|
| 76 |
+
"test.bin${CryptUtil.CRYPT_EXTENSION}",
|
| 77 |
+
)
|
| 78 |
+
assertTrue(targetFile.exists())
|
| 79 |
+
if (SDK_INT < JELLY_BEAN_MR2) {
|
| 80 |
+
// Quirks for SDK < 18. File is not encrypted at all.
|
| 81 |
+
assertTrue(
|
| 82 |
+
"Source and target file size should be the same = ${source.size}",
|
| 83 |
+
source.size.toLong() == targetFile.length(),
|
| 84 |
+
)
|
| 85 |
+
} else {
|
| 86 |
+
assertTrue(
|
| 87 |
+
"Source size = ${source.size} target file size = ${targetFile.length()}",
|
| 88 |
+
targetFile.length() > source.size,
|
| 89 |
+
)
|
| 90 |
+
}
|
| 91 |
+
sourceFile.delete()
|
| 92 |
+
CryptUtil(
|
| 93 |
+
AppConfig.getInstance(),
|
| 94 |
+
HybridFileParcelable(targetFile.absolutePath).also {
|
| 95 |
+
it.setSize(targetFile.length())
|
| 96 |
+
},
|
| 97 |
+
Environment.getExternalStorageDirectory().absolutePath,
|
| 98 |
+
ProgressHandler(),
|
| 99 |
+
ArrayList(),
|
| 100 |
+
null,
|
| 101 |
+
)
|
| 102 |
+
File(Environment.getExternalStorageDirectory(), "test.bin").run {
|
| 103 |
+
assertTrue(this.exists())
|
| 104 |
+
assertArrayEquals(source, this.readBytes())
|
| 105 |
+
}
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
/**
|
| 109 |
+
* Test encrypt and decrypt routine with AESCrypt format.
|
| 110 |
+
*/
|
| 111 |
+
@Test
|
| 112 |
+
fun testEncryptDecryptAescrypt() {
|
| 113 |
+
val source = Random(System.currentTimeMillis()).nextBytes(117)
|
| 114 |
+
val sourceFile = File(Environment.getExternalStorageDirectory(), "test.bin")
|
| 115 |
+
ByteArrayInputStream(source).copyTo(FileOutputStream(sourceFile))
|
| 116 |
+
CryptUtil(
|
| 117 |
+
AppConfig.getInstance(),
|
| 118 |
+
HybridFileParcelable(sourceFile.absolutePath),
|
| 119 |
+
ProgressHandler(),
|
| 120 |
+
ArrayList(),
|
| 121 |
+
"test.bin${CryptUtil.AESCRYPT_EXTENSION}",
|
| 122 |
+
true,
|
| 123 |
+
"12345678",
|
| 124 |
+
)
|
| 125 |
+
val targetFile =
|
| 126 |
+
File(
|
| 127 |
+
Environment.getExternalStorageDirectory(),
|
| 128 |
+
"test.bin${CryptUtil.AESCRYPT_EXTENSION}",
|
| 129 |
+
)
|
| 130 |
+
assertTrue(targetFile.exists())
|
| 131 |
+
assertTrue(
|
| 132 |
+
"Source size = ${source.size} target file size = ${targetFile.length()}",
|
| 133 |
+
targetFile.length() > source.size,
|
| 134 |
+
)
|
| 135 |
+
sourceFile.delete()
|
| 136 |
+
CryptUtil(
|
| 137 |
+
AppConfig.getInstance(),
|
| 138 |
+
HybridFileParcelable(targetFile.absolutePath).also {
|
| 139 |
+
it.setSize(targetFile.length())
|
| 140 |
+
},
|
| 141 |
+
Environment.getExternalStorageDirectory().absolutePath,
|
| 142 |
+
ProgressHandler(),
|
| 143 |
+
ArrayList(),
|
| 144 |
+
"12345678",
|
| 145 |
+
)
|
| 146 |
+
File(Environment.getExternalStorageDirectory(), "test.bin").run {
|
| 147 |
+
assertTrue(this.exists())
|
| 148 |
+
assertArrayEquals(source, this.readBytes())
|
| 149 |
+
}
|
| 150 |
+
}
|
| 151 |
+
}
|
app/src/androidTest/java/com/amaze/filemanager/utils/security/SecretKeygenEspressoTest.kt
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright (C) 2014-2022 Arpit Khurana <arpitkh96@gmail.com>, Vishal Nehra <vishalmeham2@gmail.com>,
|
| 3 |
+
* Emmanuel Messulam<emmanuelbendavid@gmail.com>, Raymond Lai <airwave209gt at gmail.com> and Contributors.
|
| 4 |
+
*
|
| 5 |
+
* This file is part of Amaze File Manager.
|
| 6 |
+
*
|
| 7 |
+
* Amaze File Manager is free software: you can redistribute it and/or modify
|
| 8 |
+
* it under the terms of the GNU General Public License as published by
|
| 9 |
+
* the Free Software Foundation, either version 3 of the License, or
|
| 10 |
+
* (at your option) any later version.
|
| 11 |
+
*
|
| 12 |
+
* This program is distributed in the hope that it will be useful,
|
| 13 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 |
+
* GNU General Public License for more details.
|
| 16 |
+
*
|
| 17 |
+
* You should have received a copy of the GNU General Public License
|
| 18 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
package com.amaze.filemanager.utils.security
|
| 22 |
+
|
| 23 |
+
import android.os.Build.VERSION.SDK_INT
|
| 24 |
+
import android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH
|
| 25 |
+
import androidx.test.ext.junit.runners.AndroidJUnit4
|
| 26 |
+
import androidx.test.filters.SmallTest
|
| 27 |
+
import org.junit.Assert.assertEquals
|
| 28 |
+
import org.junit.Assert.assertNotNull
|
| 29 |
+
import org.junit.Assert.fail
|
| 30 |
+
import org.junit.Test
|
| 31 |
+
import org.junit.runner.RunWith
|
| 32 |
+
|
| 33 |
+
/**
|
| 34 |
+
* Test [SecretKeygen] runs on real device. Necessary since Robolectric doesn't have shadows for
|
| 35 |
+
* AndroidKeyStore.
|
| 36 |
+
*/
|
| 37 |
+
@SmallTest
|
| 38 |
+
@RunWith(AndroidJUnit4::class)
|
| 39 |
+
class SecretKeygenEspressoTest {
|
| 40 |
+
/**
|
| 41 |
+
* Test [SecretKeygen.getSecretKey].
|
| 42 |
+
*
|
| 43 |
+
* Officially our lowest supported SDK is 14, hence we will throw exception
|
| 44 |
+
* if the device is so.
|
| 45 |
+
*/
|
| 46 |
+
@Test
|
| 47 |
+
fun testGetSecretKey() {
|
| 48 |
+
SecretKeygen.getSecretKey()?.run {
|
| 49 |
+
assertNotNull(this)
|
| 50 |
+
assertEquals("aes", this.algorithm.lowercase())
|
| 51 |
+
} ?: if (SDK_INT < ICE_CREAM_SANDWICH) {
|
| 52 |
+
fail("Android version not supported")
|
| 53 |
+
} else {
|
| 54 |
+
// Do nothing but let it pass
|
| 55 |
+
}
|
| 56 |
+
}
|
| 57 |
+
}
|
app/src/androidTest/resources/amaze_backup.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"": 1,
|
| 3 |
+
"showThumbs": true,
|
| 4 |
+
"showHidden": true,
|
| 5 |
+
"documents": true,
|
| 6 |
+
"image/jpeg_LAST": "com.oppo.gallery3d.app.ViewGallery com.coloros.gallery3d",
|
| 7 |
+
"video": true,
|
| 8 |
+
"typeablepaths": false,
|
| 9 |
+
"showPermissions": false,
|
| 10 |
+
"texteditor_newstack": false,
|
| 11 |
+
"legacyListing": false,
|
| 12 |
+
"sidebar_quickaccess_enable": false,
|
| 13 |
+
"fastaccess": true,
|
| 14 |
+
"books_added": true,
|
| 15 |
+
"application/pdf_LAST": "com.google.android.apps.viewer.PdfViewerActivity com.google.android.apps.docs",
|
| 16 |
+
"showLastModified": true,
|
| 17 |
+
"acra.legacyAlreadyConvertedTo4.8.0": true,
|
| 18 |
+
"audio/mpeg_LAST": "phone.vishnu.dialogmusicplayer.MainActivity phone.vishnu.dialogmusicplayer",
|
| 19 |
+
"acra.legacyAlreadyConvertedToJson": true,
|
| 20 |
+
"showFileSize": true,
|
| 21 |
+
"sidebar_bookmarks_enable": false,
|
| 22 |
+
"audio": true,
|
| 23 |
+
"needtosethome": false,
|
| 24 |
+
"rootmode": false,
|
| 25 |
+
"recent": true,
|
| 26 |
+
"image": true,
|
| 27 |
+
"savepaths": false,
|
| 28 |
+
"delete_confirmation": true,
|
| 29 |
+
"apks": true,
|
| 30 |
+
"audio/mpeg_DEFAULT": "phone.vishnu.dialogmusicplayer.MainActivity phone.vishnu.dialogmusicplayer",
|
| 31 |
+
"acra.lastVersionNr": 121,
|
| 32 |
+
"goBack_checkbox": false
|
| 33 |
+
}
|
app/src/debug/res/values/strings.xml
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="utf-8"?>
|
| 2 |
+
<resources>
|
| 3 |
+
<string name="appbar_name" translatable="false">Amaze Debug</string>
|
| 4 |
+
</resources>
|
app/src/debug/res/xml-v25/shortcuts.xml
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="utf-8"?>
|
| 2 |
+
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
|
| 3 |
+
|
| 4 |
+
<shortcut
|
| 5 |
+
android:enabled="true"
|
| 6 |
+
android:icon="@drawable/ic_shortcut_star"
|
| 7 |
+
android:shortcutId="shortcut_quick_access"
|
| 8 |
+
android:shortcutLongLabel="@string/quick"
|
| 9 |
+
android:shortcutShortLabel="@string/quick">
|
| 10 |
+
<intent
|
| 11 |
+
android:action="com.amaze.filemanager.openQuickAccess"
|
| 12 |
+
android:targetClass="com.amaze.filemanager.ui.activities.MainActivity"
|
| 13 |
+
android:targetPackage="com.amaze.filemanager.debug" />
|
| 14 |
+
</shortcut>
|
| 15 |
+
|
| 16 |
+
<shortcut
|
| 17 |
+
android:enabled="true"
|
| 18 |
+
android:icon="@drawable/ic_shortcut_history"
|
| 19 |
+
android:shortcutId="shortcut_recent"
|
| 20 |
+
android:shortcutLongLabel="@string/recent"
|
| 21 |
+
android:shortcutShortLabel="@string/recent">
|
| 22 |
+
<intent
|
| 23 |
+
android:action="com.amaze.filemanager.openRecent"
|
| 24 |
+
android:targetClass="com.amaze.filemanager.ui.activities.MainActivity"
|
| 25 |
+
android:targetPackage="com.amaze.filemanager.debug" />
|
| 26 |
+
</shortcut>
|
| 27 |
+
|
| 28 |
+
<shortcut
|
| 29 |
+
android:enabled="true"
|
| 30 |
+
android:icon="@drawable/ic_shortcut_android"
|
| 31 |
+
android:shortcutId="shortcut_apps"
|
| 32 |
+
android:shortcutLongLabel="@string/apps"
|
| 33 |
+
android:shortcutShortLabel="@string/apps">
|
| 34 |
+
<intent
|
| 35 |
+
android:action="com.amaze.filemanager.openAppManager"
|
| 36 |
+
android:targetClass="com.amaze.filemanager.ui.activities.MainActivity"
|
| 37 |
+
android:targetPackage="com.amaze.filemanager.debug" />
|
| 38 |
+
</shortcut>
|
| 39 |
+
|
| 40 |
+
<shortcut
|
| 41 |
+
android:enabled="true"
|
| 42 |
+
android:icon="@drawable/ic_shortcut_ftp"
|
| 43 |
+
android:shortcutId="shortcut_ftp"
|
| 44 |
+
android:shortcutLongLabel="@string/ftp"
|
| 45 |
+
android:shortcutShortLabel="@string/ftp">
|
| 46 |
+
<intent
|
| 47 |
+
android:action="com.amaze.filemanager.openFTPServer"
|
| 48 |
+
android:targetClass="com.amaze.filemanager.ui.activities.MainActivity"
|
| 49 |
+
android:targetPackage="com.amaze.filemanager.debug" />
|
| 50 |
+
</shortcut>
|
| 51 |
+
|
| 52 |
+
</shortcuts>
|
app/src/fdroid/java/com/amaze/filemanager/asynchronous/asynctasks/CloudLoaderAsyncTask.java
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright (C) 2014-2024 Arpit Khurana <arpitkh96@gmail.com>, Vishal Nehra <vishalmeham2@gmail.com>,
|
| 3 |
+
* Emmanuel Messulam<emmanuelbendavid@gmail.com>, Raymond Lai <airwave209gt at gmail.com> and Contributors.
|
| 4 |
+
*
|
| 5 |
+
* This file is part of Amaze File Manager.
|
| 6 |
+
*
|
| 7 |
+
* Amaze File Manager is free software: you can redistribute it and/or modify
|
| 8 |
+
* it under the terms of the GNU General Public License as published by
|
| 9 |
+
* the Free Software Foundation, either version 3 of the License, or
|
| 10 |
+
* (at your option) any later version.
|
| 11 |
+
*
|
| 12 |
+
* This program is distributed in the hope that it will be useful,
|
| 13 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 |
+
* GNU General Public License for more details.
|
| 16 |
+
*
|
| 17 |
+
* You should have received a copy of the GNU General Public License
|
| 18 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
package com.amaze.filemanager.asynchronous.asynctasks;
|
| 22 |
+
|
| 23 |
+
import java.lang.ref.WeakReference;
|
| 24 |
+
|
| 25 |
+
import com.amaze.filemanager.database.CloudHandler;
|
| 26 |
+
import com.amaze.filemanager.ui.activities.MainActivity;
|
| 27 |
+
|
| 28 |
+
import android.database.Cursor;
|
| 29 |
+
import android.os.AsyncTask;
|
| 30 |
+
|
| 31 |
+
import androidx.annotation.NonNull;
|
| 32 |
+
|
| 33 |
+
public class CloudLoaderAsyncTask extends AsyncTask<Void, Void, Boolean> {
|
| 34 |
+
|
| 35 |
+
private final WeakReference<MainActivity> mainActivity;
|
| 36 |
+
|
| 37 |
+
public CloudLoaderAsyncTask(MainActivity mainActivity, CloudHandler unused1, Cursor unused2) {
|
| 38 |
+
this.mainActivity = new WeakReference<>(mainActivity);
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
@Override
|
| 42 |
+
@NonNull
|
| 43 |
+
public Boolean doInBackground(Void... voids) {
|
| 44 |
+
return false;
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
@Override
|
| 48 |
+
protected void onCancelled() {
|
| 49 |
+
super.onCancelled();
|
| 50 |
+
final MainActivity mainActivity = this.mainActivity.get();
|
| 51 |
+
if (mainActivity != null) {
|
| 52 |
+
mainActivity
|
| 53 |
+
.getSupportLoaderManager()
|
| 54 |
+
.destroyLoader(MainActivity.REQUEST_CODE_CLOUD_LIST_KEY);
|
| 55 |
+
mainActivity
|
| 56 |
+
.getSupportLoaderManager()
|
| 57 |
+
.destroyLoader(MainActivity.REQUEST_CODE_CLOUD_LIST_KEYS);
|
| 58 |
+
}
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
@Override
|
| 62 |
+
public void onPostExecute(@NonNull Boolean result) {
|
| 63 |
+
if (result) {
|
| 64 |
+
final MainActivity mainActivity = this.mainActivity.get();
|
| 65 |
+
if (mainActivity != null) {
|
| 66 |
+
mainActivity.getDrawer().refreshDrawer();
|
| 67 |
+
mainActivity.invalidateFragmentAndBundle(null, true);
|
| 68 |
+
}
|
| 69 |
+
}
|
| 70 |
+
}
|
| 71 |
+
}
|
app/src/fdroid/java/com/amaze/filemanager/filesystem/compressed/extractcontents/helpers/RarExtractor.kt
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright (C) 2014-2021 Arpit Khurana <arpitkh96@gmail.com>, Vishal Nehra <vishalmeham2@gmail.com>,
|
| 3 |
+
* Emmanuel Messulam<emmanuelbendavid@gmail.com>, Raymond Lai <airwave209gt at gmail.com> and Contributors.
|
| 4 |
+
*
|
| 5 |
+
* This file is part of Amaze File Manager.
|
| 6 |
+
*
|
| 7 |
+
* Amaze File Manager is free software: you can redistribute it and/or modify
|
| 8 |
+
* it under the terms of the GNU General Public License as published by
|
| 9 |
+
* the Free Software Foundation, either version 3 of the License, or
|
| 10 |
+
* (at your option) any later version.
|
| 11 |
+
*
|
| 12 |
+
* This program is distributed in the hope that it will be useful,
|
| 13 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 |
+
* GNU General Public License for more details.
|
| 16 |
+
*
|
| 17 |
+
* You should have received a copy of the GNU General Public License
|
| 18 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
package com.amaze.filemanager.filesystem.compressed.extractcontents.helpers
|
| 22 |
+
|
| 23 |
+
import android.content.Context
|
| 24 |
+
import com.amaze.filemanager.fileoperations.utils.UpdatePosition
|
| 25 |
+
import com.amaze.filemanager.filesystem.compressed.extractcontents.Extractor
|
| 26 |
+
|
| 27 |
+
class RarExtractor(
|
| 28 |
+
context: Context,
|
| 29 |
+
filePath: String,
|
| 30 |
+
outputPath: String,
|
| 31 |
+
listener: OnUpdate,
|
| 32 |
+
updatePosition: UpdatePosition,
|
| 33 |
+
) : Extractor(context, filePath, outputPath, listener, updatePosition) {
|
| 34 |
+
override fun extractWithFilter(filter: Filter) {
|
| 35 |
+
// no-op
|
| 36 |
+
}
|
| 37 |
+
}
|
app/src/fdroid/java/com/amaze/filemanager/filesystem/compressed/showcontents/helpers/RarDecompressor.kt
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright (C) 2014-2021 Arpit Khurana <arpitkh96@gmail.com>, Vishal Nehra <vishalmeham2@gmail.com>,
|
| 3 |
+
* Emmanuel Messulam<emmanuelbendavid@gmail.com>, Raymond Lai <airwave209gt at gmail.com> and Contributors.
|
| 4 |
+
*
|
| 5 |
+
* This file is part of Amaze File Manager.
|
| 6 |
+
*
|
| 7 |
+
* Amaze File Manager is free software: you can redistribute it and/or modify
|
| 8 |
+
* it under the terms of the GNU General Public License as published by
|
| 9 |
+
* the Free Software Foundation, either version 3 of the License, or
|
| 10 |
+
* (at your option) any later version.
|
| 11 |
+
*
|
| 12 |
+
* This program is distributed in the hope that it will be useful,
|
| 13 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 |
+
* GNU General Public License for more details.
|
| 16 |
+
*
|
| 17 |
+
* You should have received a copy of the GNU General Public License
|
| 18 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
package com.amaze.filemanager.filesystem.compressed.showcontents.helpers
|
| 22 |
+
|
| 23 |
+
import android.content.Context
|
| 24 |
+
import com.amaze.filemanager.asynchronous.asynctasks.compress.UnknownCompressedFileHelperCallable
|
| 25 |
+
import com.amaze.filemanager.filesystem.compressed.showcontents.Decompressor
|
| 26 |
+
|
| 27 |
+
class RarDecompressor(context: Context) : Decompressor(context) {
|
| 28 |
+
override fun changePath(
|
| 29 |
+
path: String,
|
| 30 |
+
addGoBackItem: Boolean,
|
| 31 |
+
) = UnknownCompressedFileHelperCallable(filePath, addGoBackItem)
|
| 32 |
+
|
| 33 |
+
override fun realRelativeDirectory(dir: String): String {
|
| 34 |
+
return ""
|
| 35 |
+
}
|
| 36 |
+
}
|
app/src/fdroid/java/com/amaze/filemanager/utils/Billing.java
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright (C) 2014-2024 Arpit Khurana <arpitkh96@gmail.com>, Vishal Nehra <vishalmeham2@gmail.com>,
|
| 3 |
+
* Emmanuel Messulam<emmanuelbendavid@gmail.com>, Raymond Lai <airwave209gt at gmail.com> and Contributors.
|
| 4 |
+
*
|
| 5 |
+
* This file is part of Amaze File Manager.
|
| 6 |
+
*
|
| 7 |
+
* Amaze File Manager is free software: you can redistribute it and/or modify
|
| 8 |
+
* it under the terms of the GNU General Public License as published by
|
| 9 |
+
* the Free Software Foundation, either version 3 of the License, or
|
| 10 |
+
* (at your option) any later version.
|
| 11 |
+
*
|
| 12 |
+
* This program is distributed in the hope that it will be useful,
|
| 13 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 |
+
* GNU General Public License for more details.
|
| 16 |
+
*
|
| 17 |
+
* You should have received a copy of the GNU General Public License
|
| 18 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
package com.amaze.filemanager.utils;
|
| 22 |
+
|
| 23 |
+
import com.amaze.filemanager.ui.activities.superclasses.BasicActivity;
|
| 24 |
+
|
| 25 |
+
public class Billing {
|
| 26 |
+
|
| 27 |
+
private static final String URL_AUTHOR_2_PAYPAL = "https://www.paypal.me/vishalnehra";
|
| 28 |
+
|
| 29 |
+
public Billing(BasicActivity activity) {
|
| 30 |
+
Utils.openURL(URL_AUTHOR_2_PAYPAL, activity);
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
public void destroyBillingInstance() {
|
| 34 |
+
// do nothing
|
| 35 |
+
}
|
| 36 |
+
}
|
app/src/fdroid/java/com/amaze/filemanager/utils/PackageInstallValidation.kt
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright (C) 2014-2022 Arpit Khurana <arpitkh96@gmail.com>, Vishal Nehra <vishalmeham2@gmail.com>,
|
| 3 |
+
* Emmanuel Messulam<emmanuelbendavid@gmail.com>, Raymond Lai <airwave209gt at gmail.com> and Contributors.
|
| 4 |
+
*
|
| 5 |
+
* This file is part of Amaze File Manager.
|
| 6 |
+
*
|
| 7 |
+
* Amaze File Manager is free software: you can redistribute it and/or modify
|
| 8 |
+
* it under the terms of the GNU General Public License as published by
|
| 9 |
+
* the Free Software Foundation, either version 3 of the License, or
|
| 10 |
+
* (at your option) any later version.
|
| 11 |
+
*
|
| 12 |
+
* This program is distributed in the hope that it will be useful,
|
| 13 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 |
+
* GNU General Public License for more details.
|
| 16 |
+
*
|
| 17 |
+
* You should have received a copy of the GNU General Public License
|
| 18 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
package com.amaze.filemanager.utils
|
| 22 |
+
|
| 23 |
+
import java.io.File
|
| 24 |
+
|
| 25 |
+
/**
|
| 26 |
+
* For non Google Play variant, this class does nothing. Just a stub.
|
| 27 |
+
*/
|
| 28 |
+
object PackageInstallValidation {
|
| 29 |
+
/**
|
| 30 |
+
* Do nothing.
|
| 31 |
+
*/
|
| 32 |
+
@JvmStatic
|
| 33 |
+
@Throws(PackageCannotBeInstalledException::class, IllegalStateException::class)
|
| 34 |
+
fun validatePackageInstallability(f: File) = Unit
|
| 35 |
+
|
| 36 |
+
/**
|
| 37 |
+
* Exception indicating specified package cannot be installed
|
| 38 |
+
*/
|
| 39 |
+
class PackageCannotBeInstalledException : Exception {
|
| 40 |
+
constructor(reason: Throwable) : super(reason)
|
| 41 |
+
constructor(reason: String) : super(reason)
|
| 42 |
+
}
|
| 43 |
+
}
|
app/src/fdroid/java/com/cloudrail/si/CloudRail.java
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright (C) 2014-2024 Arpit Khurana <arpitkh96@gmail.com>, Vishal Nehra <vishalmeham2@gmail.com>,
|
| 3 |
+
* Emmanuel Messulam<emmanuelbendavid@gmail.com>, Raymond Lai <airwave209gt at gmail.com> and Contributors.
|
| 4 |
+
*
|
| 5 |
+
* This file is part of Amaze File Manager.
|
| 6 |
+
*
|
| 7 |
+
* Amaze File Manager is free software: you can redistribute it and/or modify
|
| 8 |
+
* it under the terms of the GNU General Public License as published by
|
| 9 |
+
* the Free Software Foundation, either version 3 of the License, or
|
| 10 |
+
* (at your option) any later version.
|
| 11 |
+
*
|
| 12 |
+
* This program is distributed in the hope that it will be useful,
|
| 13 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 |
+
* GNU General Public License for more details.
|
| 16 |
+
*
|
| 17 |
+
* You should have received a copy of the GNU General Public License
|
| 18 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
package com.cloudrail.si;
|
| 22 |
+
|
| 23 |
+
import android.content.Intent;
|
| 24 |
+
|
| 25 |
+
public class CloudRail {
|
| 26 |
+
public static void setAuthenticationResponse(Intent i) {}
|
| 27 |
+
|
| 28 |
+
public static void setAppKey(String id) {}
|
| 29 |
+
}
|
app/src/fdroid/java/com/cloudrail/si/interfaces/CloudStorage.java
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright (C) 2014-2024 Arpit Khurana <arpitkh96@gmail.com>, Vishal Nehra <vishalmeham2@gmail.com>,
|
| 3 |
+
* Emmanuel Messulam<emmanuelbendavid@gmail.com>, Raymond Lai <airwave209gt at gmail.com> and Contributors.
|
| 4 |
+
*
|
| 5 |
+
* This file is part of Amaze File Manager.
|
| 6 |
+
*
|
| 7 |
+
* Amaze File Manager is free software: you can redistribute it and/or modify
|
| 8 |
+
* it under the terms of the GNU General Public License as published by
|
| 9 |
+
* the Free Software Foundation, either version 3 of the License, or
|
| 10 |
+
* (at your option) any later version.
|
| 11 |
+
*
|
| 12 |
+
* This program is distributed in the hope that it will be useful,
|
| 13 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 |
+
* GNU General Public License for more details.
|
| 16 |
+
*
|
| 17 |
+
* You should have received a copy of the GNU General Public License
|
| 18 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
package com.cloudrail.si.interfaces;
|
| 22 |
+
|
| 23 |
+
import java.io.InputStream;
|
| 24 |
+
import java.util.Collections;
|
| 25 |
+
import java.util.List;
|
| 26 |
+
|
| 27 |
+
import com.cloudrail.si.types.CloudMetaData;
|
| 28 |
+
import com.cloudrail.si.types.SpaceAllocation;
|
| 29 |
+
|
| 30 |
+
public class CloudStorage {
|
| 31 |
+
|
| 32 |
+
public List<CloudMetaData> getChildren(String str) {
|
| 33 |
+
return Collections.emptyList();
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
public void logout() {}
|
| 37 |
+
|
| 38 |
+
public void delete(String path) {}
|
| 39 |
+
|
| 40 |
+
public void move(String path1, String path2) {}
|
| 41 |
+
|
| 42 |
+
public void copy(String path1, String path2) {}
|
| 43 |
+
|
| 44 |
+
public boolean exists(String path) {
|
| 45 |
+
return false;
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
public void loadAsString(String str) {}
|
| 49 |
+
|
| 50 |
+
public SpaceAllocation getAllocation() {
|
| 51 |
+
return new SpaceAllocation();
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
public void login() {}
|
| 55 |
+
|
| 56 |
+
public String saveAsString() {
|
| 57 |
+
return "";
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
public String getUserLogin() {
|
| 61 |
+
return "";
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
public void useAdvancedAuthentication() {}
|
| 65 |
+
|
| 66 |
+
public void createFolder(String extSyncFolder) {}
|
| 67 |
+
|
| 68 |
+
public InputStream download(String path) {
|
| 69 |
+
return null;
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
public InputStream getThumbnail(String path) {
|
| 73 |
+
return null;
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
public void upload(String extSyncFile, InputStream outStream, long length, boolean b) {}
|
| 77 |
+
|
| 78 |
+
public CloudMetaData getMetadata(String str) {
|
| 79 |
+
return null;
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
public String createShareLink(String str) {
|
| 83 |
+
return "";
|
| 84 |
+
}
|
| 85 |
+
}
|
app/src/fdroid/java/com/cloudrail/si/services/Box.java
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright (C) 2014-2024 Arpit Khurana <arpitkh96@gmail.com>, Vishal Nehra <vishalmeham2@gmail.com>,
|
| 3 |
+
* Emmanuel Messulam<emmanuelbendavid@gmail.com>, Raymond Lai <airwave209gt at gmail.com> and Contributors.
|
| 4 |
+
*
|
| 5 |
+
* This file is part of Amaze File Manager.
|
| 6 |
+
*
|
| 7 |
+
* Amaze File Manager is free software: you can redistribute it and/or modify
|
| 8 |
+
* it under the terms of the GNU General Public License as published by
|
| 9 |
+
* the Free Software Foundation, either version 3 of the License, or
|
| 10 |
+
* (at your option) any later version.
|
| 11 |
+
*
|
| 12 |
+
* This program is distributed in the hope that it will be useful,
|
| 13 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 |
+
* GNU General Public License for more details.
|
| 16 |
+
*
|
| 17 |
+
* You should have received a copy of the GNU General Public License
|
| 18 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
package com.cloudrail.si.services;
|
| 22 |
+
|
| 23 |
+
import com.cloudrail.si.interfaces.CloudStorage;
|
| 24 |
+
|
| 25 |
+
import android.content.Context;
|
| 26 |
+
|
| 27 |
+
public class Box extends CloudStorage {
|
| 28 |
+
public Box(Context unused1, String unused2, String unused3) {
|
| 29 |
+
super();
|
| 30 |
+
}
|
| 31 |
+
}
|
app/src/fdroid/java/com/cloudrail/si/services/Dropbox.java
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright (C) 2014-2024 Arpit Khurana <arpitkh96@gmail.com>, Vishal Nehra <vishalmeham2@gmail.com>,
|
| 3 |
+
* Emmanuel Messulam<emmanuelbendavid@gmail.com>, Raymond Lai <airwave209gt at gmail.com> and Contributors.
|
| 4 |
+
*
|
| 5 |
+
* This file is part of Amaze File Manager.
|
| 6 |
+
*
|
| 7 |
+
* Amaze File Manager is free software: you can redistribute it and/or modify
|
| 8 |
+
* it under the terms of the GNU General Public License as published by
|
| 9 |
+
* the Free Software Foundation, either version 3 of the License, or
|
| 10 |
+
* (at your option) any later version.
|
| 11 |
+
*
|
| 12 |
+
* This program is distributed in the hope that it will be useful,
|
| 13 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 |
+
* GNU General Public License for more details.
|
| 16 |
+
*
|
| 17 |
+
* You should have received a copy of the GNU General Public License
|
| 18 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
package com.cloudrail.si.services;
|
| 22 |
+
|
| 23 |
+
import com.cloudrail.si.interfaces.CloudStorage;
|
| 24 |
+
|
| 25 |
+
import android.content.Context;
|
| 26 |
+
|
| 27 |
+
public class Dropbox extends CloudStorage {
|
| 28 |
+
|
| 29 |
+
public Dropbox(Context unused1, String unused2, String unused3, String unused4, String unused5) {
|
| 30 |
+
super();
|
| 31 |
+
}
|
| 32 |
+
}
|