[
  {
    "path": ".gitattributes",
    "content": "# Set the default behavior, in case people don't have core.autocrlf set.\n* text=auto eol=lf\n\n# Declare files that will always have CRLF line endings on checkout.\n*.cmd text eol=crlf\n*.bat text eol=crlf\n\n# Denote all files that are truly binary and should not be modified.\n*.png binary\n"
  },
  {
    "path": ".githooks/pre-commit",
    "content": "#!/bin/bash\n\n# Use unix timestamp, precise to 1000 seconds (~16.7 mins) as versionCode epoch.\n# This lets us later generate 999 manual updates to a versionCode epoch if needed.\n# Note: This scheme will remain valid for use in Google Play up to value 2100000000,\n# or about year 2036 .\n\n# Function to get the current time epoch version code\ngetCurrentTimeEpochVersionCode() {\n    # Get the current Unix timestamp in seconds\n    seconds=$(date +%s)\n    # Divide the seconds (integer division) by 1000 to get the epoch\n    epoch=$(($seconds / 1000))\n    # Multiply the epoch by 1000 to get the version code\n    epochVersionCode=$(($epoch * 1000))\n    echo $epochVersionCode\n}\n\n# Function to get the current date version name\ngetCurrentDateVersionName() {\n    # Get the current date in the format yyyy.MM.dd\n    currentDateVersionName=$(date +\"%Y.%m.%d\")\n    echo $currentDateVersionName\n}\n\n# Check if SKIP_VERSION_AUTO_UPDATE is set\nif [ \"$SKIP_VERSION_AUTO_UPDATE\" = \"true\" ]; then\n    echo \"Skipping automatic android app version update.\"\n    exit 0\nelse\n    echo \"Incrementing android app version pre-commit.\"\n    echo \"Skip by setting environment variable SKIP_VERSION_AUTO_UPDATE=true.\"\nfi\n\n# Get the versionCode and versionName\nversionCode=$(getCurrentTimeEpochVersionCode)\nversionName=$(getCurrentDateVersionName)\n\n# Store the path to build.gradle.kts in a variable\nbuildGradleFilePath=\"app/build.gradle.kts\"\n\n# Update the build.gradle.kts file with the new versionCode and versionName\nsed -i'' -e \"s/versionCode .*/versionCode = $versionCode/\" \"$buildGradleFilePath\"\nsed -i'' -e \"s/versionName .*/versionName = \\\"$versionName\\\"/\" \"$buildGradleFilePath\"\n\n# Add the updated build.gradle.kts file to the staging area\ngit add \"$buildGradleFilePath\"\n\n# Proceed with the commit\nexit 0\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.yml",
    "content": "---\nname: Bug report\ndescription: Report a bug\nlabels: [bug]\ntitle: \"[Bug] \"\nbody:\n  - type: markdown\n    attributes:\n      value: |\n        Hi! Thanks for reporting a bug.\n\n        To make it easier for people to help you please enter detailed information below.\n  - type: textarea\n    attributes:\n      label: Steps to reproduce\n      placeholder: |\n        1.\n        2.\n        3.\n    validations:\n      required: true\n  - type: textarea\n    attributes:\n      label: Expectations\n      placeholder: Tell what you think should happen\n    validations:\n      required: true\n  - type: textarea\n    attributes:\n      label: Reality\n      placeholder: Tell what happened instead\n    validations:\n      required: true\n  - type: input\n    attributes:\n      label: App version\n    validations:\n      required: true\n  - type: input\n    attributes:\n      label: Android version\n    validations:\n      required: true\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/config.yml",
    "content": "blank_issues_enabled: false\ncontact_links:\n  - name: Ask a question\n    url: https://github.com/2bllw8/anemo/discussions/new?category=Q-A\n    about: Ask and answer questions about the app here\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature_request.yml",
    "content": "---\nname: Feature request\ndescription: Suggest a feature to add\nlabels: [enhancement]\ntitle: \"[Feature request] \"\nbody:\n  - type: textarea\n    attributes:\n      label: Describe what you'd like to see added to the app\n      placeholder: Describe what feature you are requesting and what problems it would solve\n    validations:\n      required: true\n  - type: textarea\n    attributes:\n      label: Additional information\n      placeholder: Add any other information or screenshots about the feature request here\n    validations:\n      required: false\n"
  },
  {
    "path": ".github/workflows/main.yml",
    "content": "name: Aer CI\n\non:\n  push:\n    branches:\n      - 'main'\n      - 'revamp'\n    paths-ignore:\n      - '**.md'\n      - '.gitignore'\n      - 'Android.bp'\n      - '/metadata'\n  pull_request:\n    paths-ignore:\n      - '**.md'\n      - '.gitignore'\n      - 'Android.bp'\n      - '/metadata'\n\njobs:\n  build:\n    runs-on: ubuntu-22.04\n    steps:\n      - name: Project checkout\n        uses: actions/checkout@v2\n        with:\n          fetch-depth: 0\n      - name: Set up JDK 17\n        uses: actions/setup-java@v1\n        with:\n          java-version: 17\n      - name: Cache Gradle Dependencies\n        uses: actions/cache@v2\n        with:\n          path: |\n            ~/.gradle/caches\n            ~/.gradle/wrapper\n            !~/.gradle/caches/build-cache-*\n          key: gradle-deps-core-${{ hashFiles('**/build.gradle*') }}\n          restore-keys: |\n            gradle-deps\n      - name: Cache Gradle Build\n        uses: actions/cache@v2\n        with:\n          path: |\n            ~/.gradle/caches/build-cache-*\n          key: gradle-builds-core-${{ github.sha }}\n          restore-keys: |\n            gradle-builds\n#      - name: Signing key\n#        if: ${{ github.event_name == 'push' }}\n#        run: |\n#          echo 'androidStorePassword=${{ secrets.KEY_STORE_PASSWORD }}' >> local.properties\n#          echo 'androidKeyAlias=${{ secrets.KEY_ALIAS }}' >> local.properties\n#          echo 'androidKeyPassword=${{ secrets.KEY_PASSWORD }}' >> local.properties\n#          echo 'androidStoreFile=sign_key.jks' >> local.properties\n#          echo '${{ secrets.KEY_STORE }}' | base64 --decode > sign_key.jks\n      - name: Build\n        id: build\n        run: |\n          echo 'org.gradle.caching=true' >> gradle.properties\n          echo 'org.gradle.parallel=true' >> gradle.properties\n          echo 'org.gradle.vfs.watch=true' >> gradle.properties\n          echo 'org.gradle.jvmargs=-Xmx2048m' >> gradle.properties\n          ./gradlew :app:assembleDebug\n      - name: Upload artifacts\n        if: ${{ github.event_name == 'push' }}\n        uses: actions/upload-artifact@v4\n        with:\n          name: app.apk\n          path: \"app/build/outputs/apk/debug/app-debug.apk\"\n          retention-days: 14\n"
  },
  {
    "path": ".github/workflows/release.yml",
    "content": "name: Release\n\non:\n  workflow_dispatch:\n  push:\n    tags:\n      - '*'\n  release:\n    types: [\"published\"]\n\njobs:\n  build:\n    runs-on: ubuntu-22.04\n    steps:\n      - name: Project checkout\n        uses: actions/checkout@v2\n        with:\n          fetch-depth: 0\n      - name: Set up JDK 17\n        uses: actions/setup-java@v1\n        with:\n          java-version: 17\n      - name: Cache Gradle Dependencies\n        uses: actions/cache@v2\n        with:\n          path: |\n            ~/.gradle/caches\n            ~/.gradle/wrapper\n            !~/.gradle/caches/build-cache-*\n          key: gradle-deps-core-${{ hashFiles('**/build.gradle*') }}\n          restore-keys: |\n            gradle-deps\n      - name: Cache Gradle Build\n        uses: actions/cache@v2\n        with:\n          path: |\n            ~/.gradle/caches/build-cache-*\n          key: gradle-builds-core-${{ github.sha }}\n          restore-keys: |\n            gradle-builds\n      - name: Signing key\n        run: |\n          echo \"androidStorePassword=${{ secrets.KEY_STORE_PASSWORD }}\" >> local.properties\n          echo \"androidKeyAlias=${{ secrets.KEY_ALIAS }}\" >> local.properties\n          echo \"androidKeyPassword=${{ secrets.KEY_PASSWORD }}\" >> local.properties\n          echo \"androidStoreFile=aer_sign_keystore.jks\" >> local.properties\n          if [ ! -z \"${{ secrets.KEY_STORE }}\" ]; then\n            echo '${{ secrets.KEY_STORE }}' | base64 --decode > aer_sign_keystore.jks\n          fi\n      - name: Build\n        id: build\n        run: |\n          echo 'org.gradle.caching=true' >> gradle.properties\n          echo 'org.gradle.parallel=true' >> gradle.properties\n          echo 'org.gradle.vfs.watch=true' >> gradle.properties\n          echo 'org.gradle.jvmargs=-Xmx2048m' >> gradle.properties\n          ./gradlew :app:assembleRelease\n      - name: Upload mappings\n        if: ${{ github.event_name == 'push' }}\n        uses: actions/upload-artifact@v4\n        with:\n          name: mappings\n          path: \"app/build/outputs/mapping/release\"\n      - name: Upload apks to release assets\n        if: ${{ (github.event_name == 'release') }}\n        run: |\n          curl --fail -L \\\n            -X POST \\\n            -H \"Accept: application/vnd.github+json\" \\\n            -H \"Authorization: Bearer ${{ secrets.RELEASE_UPLOAD_PAT }}\" \\\n            -H \"X-GitHub-Api-Version: 2022-11-28\" \\\n            -H \"Content-Type: application/octet-stream\" \\\n            \"https://uploads.github.com/repos/${{ github.repository }}/releases/${{ github.event.release.id }}/assets?name=aer-app-release.apk\" \\\n            --data-binary \"@app/build/outputs/apk/release/app-release.apk\"\n"
  },
  {
    "path": ".gitignore",
    "content": ".DS_Store\n\n# Android Studio\n*.iml\n.idea\n\n# Bazel\n/.aswb\n/.ijwb\n/bazel-*\n\n# Gradle\n.gradle\nlocal.properties\n/build\n\n# Sign key\n*.jks\n*.jks.base64\n\n# VSCode\n*/.classpath\n*/.project\n*/.settings\n"
  },
  {
    "path": "COPYING",
    "content": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    <program>  Copyright (C) <year>  <name of author>\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<https://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<https://www.gnu.org/licenses/why-not-lgpl.html>.\n"
  },
  {
    "path": "README.md",
    "content": "# Aer - fork of [Anemo]\n\n> [!NOTE]  \n> - This fork focuses on supporting app's *private location* on external storage (~ SD card)  \n> - If no external storage exists it'll gracefully fall back to using internal storage  \n> - Anemo and Aer can be used side by side for maximal profit\n\n[Anemo]: https://github.com/2bllw8/anemo\n\n[![Aer CI](https://github.com/nain-F49FF806/anemo-aer/actions/workflows/main.yml/badge.svg)](https://github.com/nain-F49FF806/anemo-aer/actions/workflows/main.yml)\n[![Latest release](https://img.shields.io/github/v/release/nain-F49FF806/anemo-aer?label=download)](https://github.com/nain-F49FF806/anemo-aer/releases/latest)\n\nAer is a private local storage utility application for android.\nInstead of being a stand-alone file manager user interface, it hooks into various components of\nAndroid making it feel like a native part of the operating system.\nMoreover it provides ways for the user to export contents from other apps and save them as files.\n\n## Features\n\n- Create folders and organize files freely\n- All files in the private storage won't appear in the other apps\n- Access in the system Files application (the _DocumentsProviderUI_)\n    - An optional shortcut for devices that do not expose the system Files app is offered\n- Lock access to the private storage\n  - Quick tile\n  - **Auto lock after set delay**\n  - Password for locking access to the files\n- Import content using the share Android functionality\n- **Option to select which private storage location to use**\n\n## Download\n\n[<img src=\"https://fdroid.gitlab.io/artwork/badge/get-it-on.png\"\n     alt=\"Get it on F-Droid\"\n     height=\"90\">](https://f-droid.org/en/packages/alt.nainapps.aer/)\n\nAlternatively, get it from github [releases](https://github.com/nain-F49FF806/anemo-aer/releases)\n\n## Build\n\nWith Gradle:\n- `./gradlew :app:assembleRelease`\n- `./gradlew :app:assembleDebug`\n\n## Get help\n\nOpen an discussion [on github](https://github.com/2bllw8/anemo/discussions/new?category=Q-A)\n\n## Contributions\n\n**Every contributions, including ideas, bug reports and Pull Requests are welcome!**\n\n- **Solve bug(s)**, add **feature(s)** or **translate** Aer to your native language by making a **[pull request](https://help.github.com/articles/about-pull-requests/)**\n- You have an idea for improvement or a new feature? Open a feature request **[upstream](https://github.com/2bllw8/anemo/issues/new?assignees=&labels=enhancement&template=feature_request.yml&title=[Feature+request]+)** or specifically **[for Aer](https://github.com/nain-F49FF806/anemo-aer/issues/new?assignees=&labels=enhancement&template=feature_request.yml&title=[Feature+request]+)**\n- You faced a bug, let us know by opening a **[bug report](https://github.com/nain-F49FF806/anemo-aer/issues/new?assignees=&labels=bug&template=bug_report.yml&title=%5BBug%5D+)**\n\n## License\n\nAer is licensed under the [GNU General Public License v3 (GPL-3)](http://www.gnu.org/copyleft/gpl.html).\n"
  },
  {
    "path": "app/.gitignore",
    "content": "/build\n/release\n"
  },
  {
    "path": "app/build.gradle.kts",
    "content": "/*\n * Copyright (c) 2021 2bllw8\n * SPDX-License-Identifier: GPL-3.0-only\n */\nplugins {\n    alias(libs.plugins.android.application)\n    alias(libs.plugins.compose.compiler)\n    id(\"org.jetbrains.kotlin.android\")\n    id(\"com.diffplug.spotless\") version \"6.5.1\"\n}\n\nandroid {\n    compileSdk = rootProject.extra[\"targetSdkVersion\"] as Int\n    defaultConfig {\n        minSdk = rootProject.extra[\"minSdkVersion\"] as Int\n        targetSdk = rootProject.extra[\"targetSdkVersion\"] as Int\n        versionCode = 1735160000\n        versionName = \"2024.12.25\"\n        applicationId = \"alt.nainapps.aer\"\n        vectorDrawables {\n            useSupportLibrary = true\n        }\n    }\n\n    buildFeatures {\n        buildConfig = false\n        compose = true\n    }\n\n    compileOptions {\n        sourceCompatibility = rootProject.extra[\"sourceCompatibilityVersion\"] as JavaVersion\n        targetCompatibility = rootProject.extra[\"targetCompatibilityVersion\"] as JavaVersion\n    }\n\n    dependenciesInfo {\n        includeInApk = false\n    }\n\n    signingConfigs {\n        if (rootProject.ext.get(\"keyStoreFile\") != null && (rootProject.ext.get(\"keyStoreFile\") as File).exists()) {\n            create(\"aer\") {\n                storeFile = file(rootProject.ext.get(\"keyStoreFile\") as File)\n                storePassword = rootProject.ext.get(\"keyStorePassword\") as String\n                keyAlias = rootProject.ext.get(\"keyAlias\") as String\n                keyPassword = rootProject.ext.get(\"keyPassword\") as String\n            }\n        }\n    }\n\n    buildTypes {\n        val useAerSignConfig = rootProject.ext.get(\"keyStoreFile\") != null && (rootProject.ext.get(\"keyStoreFile\") as File).exists()\n\n        getByName(\"release\") {\n            isMinifyEnabled = true\n            proguardFiles(getDefaultProguardFile(\"proguard-android-optimize.txt\"), \"proguard-rules.pro\")\n            signingConfig = signingConfigs.getByName(\"debug\")\n\n            if (useAerSignConfig) {\n                signingConfig = signingConfigs.getByName(\"aer\")\n            }\n        }\n        getByName(\"debug\") {\n            applicationIdSuffix = \".debug\"\n            signingConfig = signingConfigs.getByName(\"debug\")\n\n            if (useAerSignConfig) {\n                signingConfig = signingConfigs.getByName(\"aer\")\n            }\n        }\n    }\n    kotlinOptions {\n        jvmTarget = \"17\"\n    }\n    namespace = \"alt.nainapps.aer\"\n    composeOptions {\n        kotlinCompilerExtensionVersion = \"1.5.1\"\n    }\n    packaging {\n        resources {\n            excludes += \"/META-INF/{AL2.0,LGPL2.1}\"\n        }\n    }\n}\n\ndependencies {\n    implementation(libs.androidx.core.ktx)\n    implementation(libs.androidx.annotation)\n    implementation(libs.eitherLib)\n    implementation(libs.androidx.exifinterface)\n    implementation(libs.androidx.lifecycle.runtime.ktx)\n    implementation(libs.androidx.activity.compose)\n    implementation(platform(libs.androidx.compose.bom))\n    implementation(libs.androidx.ui)\n    implementation(libs.androidx.ui.graphics)\n    implementation(libs.androidx.ui.tooling.preview)\n    implementation(libs.androidx.material3)\n    implementation(libs.reorderable)\n    androidTestImplementation(platform(libs.androidx.compose.bom))\n    androidTestImplementation(libs.androidx.ui.test.junit4)\n    debugImplementation(libs.androidx.ui.tooling)\n    debugImplementation(libs.androidx.ui.test.manifest)\n}\n\nafterEvaluate {\n    val spotlessCheck = tasks.named(\"spotlessCheck\")\n    if (spotlessCheck.isPresent) {\n        tasks.withType<JavaCompile>().configureEach {\n            finalizedBy(spotlessCheck)\n        }\n    }\n}\n"
  },
  {
    "path": "app/code-format.xml",
    "content": "<!--\n  ~ Copyright (c) 2022 2bllw8\n  ~ SPDX-License-Identifier: GPL-3.0-only\n  -->\n\n<profiles version=\"15\">\n    <profile kind=\"CodeFormatterProfile\" name=\"CodeStyle\" version=\"15\">\n        <setting id=\"org.eclipse.jdt.core.formatter.disabling_tag\" value=\"@formatter:off\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.use_on_off_tags\" value=\"true\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.comment.line_length\" value=\"100\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.lineSplit\" value=\"100\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.indentation.size\" value=\"4\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.tabulation.char\" value=\"space\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation\" value=\"80\" />\n    </profile>\n</profiles>\n"
  },
  {
    "path": "app/proguard-rules.pro",
    "content": "-assumenosideeffects class android.util.Log {\n    public static *** v(...);\n    public static *** d(...);\n}\n\n-repackageclasses\n-allowaccessmodification\n-overloadaggressively\n"
  },
  {
    "path": "app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\">\n\n    <uses-permission android:name=\"android.permission.USE_BIOMETRIC\" />\n    <uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\" />\n    <uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" />\n    <uses-permission android:name=\"android.permission.MANAGE_EXTERNAL_STORAGE\"\n        tools:ignore=\"ScopedStorage\" />\n\n\n    <queries>\n        <package android:name=\"com.android.documentsui\" />\n        <package android:name=\"com.google.android.documentsui\" />\n    </queries>\n\n    <application\n        android:allowBackup=\"true\"\n        android:allowClearUserData=\"false\"\n        android:appCategory=\"productivity\"\n        android:dataExtractionRules=\"@xml/data_extraction_rules\"\n        android:fullBackupContent=\"@xml/backup_rules\"\n        android:icon=\"@mipmap/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:supportsRtl=\"true\"\n        tools:targetApi=\"s\">\n        <activity\n            android:name=\".config.StorageConfigActivity\"\n            android:exported=\"false\"\n            android:label=\"@string/title_activity_storage_pref\"\n            android:theme=\"@style/Theme.Anemoaer\">\n            <intent-filter>\n                <action android:name=\"alt.nainapps.aer.STORAGE_CONFIG\" />\n                <category android:name=\"android.intent.category.DEFAULT\" />\n            </intent-filter>\n        </activity>\n        <!-- Shell -->\n        <activity\n            android:name=\".shell.LauncherActivity\"\n            android:excludeFromRecents=\"true\"\n            android:exported=\"true\"\n            android:stateNotNeeded=\"true\"\n            android:theme=\"@android:style/Theme.NoDisplay\">\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n\n            <meta-data\n                android:name=\"android.app.shortcuts\"\n                android:resource=\"@xml/shortcuts\" />\n        </activity> <!-- Configuration -->\n        <activity\n            android:name=\".config.ConfigurationActivity\"\n            android:exported=\"true\"\n            android:label=\"@string/configuration_label\"\n            android:theme=\"@style/AppTheme\">\n            <intent-filter>\n                <action android:name=\"android.intent.action.APPLICATION_PREFERENCES\" />\n\n                <category android:name=\"android.intent.category.DEFAULT\" />\n            </intent-filter>\n            <intent-filter>\n                <action android:name=\"android.intent.action.VIEW\" />\n            </intent-filter>\n        </activity> <!-- Lock -->\n        <service\n            android:name=\".lock.AutoLockJobService\"\n            android:exported=\"false\"\n            android:permission=\"android.permission.BIND_JOB_SERVICE\" />\n        <service\n            android:name=\".lock.LockTileService\"\n            android:exported=\"true\"\n            android:icon=\"@drawable/ic_key_tile\"\n            android:label=\"@string/tile_title\"\n            android:permission=\"android.permission.BIND_QUICK_SETTINGS_TILE\">\n            <intent-filter>\n                <action android:name=\"android.service.quicksettings.action.QS_TILE\" />\n            </intent-filter>\n        </service> <!-- Password -->\n        <activity\n            android:name=\".lock.UnlockActivity\"\n            android:excludeFromRecents=\"true\"\n            android:label=\"@string/password_label\"\n            android:theme=\"@style/DialogTheme\" /> <!-- Provider -->\n        <provider\n            android:name=\".documents.provider.AnemoDocumentProvider\"\n            android:authorities=\"alt.nainapps.aer.documents\"\n            android:enabled=\"true\"\n            android:exported=\"true\"\n            android:grantUriPermissions=\"true\"\n            android:permission=\"android.permission.MANAGE_DOCUMENTS\">\n            <intent-filter>\n                <action android:name=\"android.content.action.DOCUMENTS_PROVIDER\" />\n            </intent-filter>\n        </provider> <!-- Receiver -->\n        <activity\n            android:name=\".documents.receiver.ReceiverActivity\"\n            android:configChanges=\"\"\n            android:excludeFromRecents=\"true\"\n            android:exported=\"true\"\n            android:label=\"@string/receiver_label\"\n            android:stateNotNeeded=\"true\"\n            android:theme=\"@android:style/Theme.Translucent.NoTitleBar\">\n            <intent-filter>\n                <action android:name=\"android.intent.action.SEND\" />\n\n                <category android:name=\"android.intent.category.DEFAULT\" />\n\n                <data android:mimeType=\"application/*\" />\n            </intent-filter>\n            <intent-filter>\n                <action android:name=\"android.intent.action.SEND\" />\n\n                <category android:name=\"android.intent.category.DEFAULT\" />\n\n                <data android:mimeType=\"audio/*\" />\n            </intent-filter>\n            <intent-filter>\n                <action android:name=\"android.intent.action.SEND\" />\n\n                <category android:name=\"android.intent.category.DEFAULT\" />\n\n                <data android:mimeType=\"image/*\" />\n            </intent-filter>\n            <intent-filter>\n                <action android:name=\"android.intent.action.SEND\" />\n\n                <category android:name=\"android.intent.category.DEFAULT\" />\n\n                <data android:mimeType=\"video/*\" />\n            </intent-filter>\n            <intent-filter>\n                <action android:name=\"android.intent.action.SEND\" />\n\n                <category android:name=\"android.intent.category.DEFAULT\" />\n\n                <data android:mimeType=\"text/*\" />\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>"
  },
  {
    "path": "app/src/main/java/alt/nainapps/aer/config/ConfigurationActivity.kt",
    "content": "/*\n * Copyright (c) 2022 2bllw8\n * Copyright (c) 2024 nain\n * SPDX-License-Identifier: GPL-3.0-only\n */\npackage alt.nainapps.aer.config\n\nimport alt.nainapps.aer.R\nimport alt.nainapps.aer.config.autolock.buildValidatedAutoLockDelayListener\nimport alt.nainapps.aer.config.password.ChangePasswordDialog\nimport alt.nainapps.aer.config.password.SetPasswordDialog\nimport alt.nainapps.aer.lock.LockStore\nimport alt.nainapps.aer.lock.UnlockActivity\nimport alt.nainapps.aer.shell.AnemoShell\nimport android.app.Activity\nimport android.content.Intent\nimport android.os.Bundle\nimport android.text.Editable\nimport android.view.View\nimport android.widget.CompoundButton\nimport android.widget.EditText\nimport android.widget.Switch\nimport android.widget.TextView\nimport java.util.function.Consumer\n\nclass ConfigurationActivity : Activity() {\n    private var passwordSetView: TextView? = null\n    private var changeLockView: TextView? = null\n    private var biometricSwitch: Switch? = null\n\n    private lateinit var lockStore: LockStore\n\n    override fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n\n        lockStore = LockStore.getInstance(applicationContext)!!\n        lockStore.addListener(onLockChanged)\n\n        setContentView(R.layout.configuration)\n\n        passwordSetView = findViewById(R.id.configuration_password_set)\n\n        val shortcutSwitch = findViewById<Switch>(R.id.configuration_show_shortcut)\n        shortcutSwitch.isChecked = AnemoShell.isEnabled(application)\n        shortcutSwitch.setOnCheckedChangeListener { _: CompoundButton?, isChecked: Boolean ->\n            AnemoShell.setEnabled(\n                application,\n                isChecked,\n            )\n        }\n\n        changeLockView = findViewById(R.id.configuration_lock)\n        changeLockView!!.setText(\n            if (lockStore.isLocked\n            ) {\n                R.string.configuration_storage_unlock\n            } else {\n                R.string.configuration_storage_lock\n            },\n        )\n        changeLockView!!.setOnClickListener {\n            if (lockStore.isLocked) {\n                startActivity(Intent(this, UnlockActivity::class.java))\n            } else {\n                lockStore.lock()\n            }\n        }\n\n        val autoLockSwitch = findViewById<Switch>(R.id.configuration_auto_lock)\n        autoLockSwitch.isChecked = lockStore.isAutoLockEnabled\n        autoLockSwitch.setOnCheckedChangeListener { _: CompoundButton?, isChecked: Boolean ->\n            lockStore.isAutoLockEnabled = isChecked\n        }\n\n        val autoLockDelayMinutesEditable = findViewById<EditText>(R.id.config_auto_lock_delay_minutes)\n        autoLockDelayMinutesEditable.text = Editable.Factory.getInstance().newEditable(\n            lockStore.autoLockDelayMinutes.toString()\n        )\n        val autoLockDelayListener = buildValidatedAutoLockDelayListener(this.baseContext, lockStore, autoLockDelayMinutesEditable)\n        autoLockDelayMinutesEditable.addTextChangedListener(autoLockDelayListener)\n\n        biometricSwitch = findViewById(R.id.configuration_biometric_unlock)\n        biometricSwitch!!.visibility = if (lockStore.canAuthenticateBiometric()) View.VISIBLE else View.GONE\n        biometricSwitch!!.isChecked = lockStore.isBiometricUnlockEnabled\n        biometricSwitch!!.setOnCheckedChangeListener { _: CompoundButton?, isChecked: Boolean ->\n            lockStore.isBiometricUnlockEnabled = isChecked\n        }\n\n        setupPasswordViews()\n    }\n\n    override fun onDestroy() {\n        super.onDestroy()\n        lockStore.removeListener(onLockChanged)\n    }\n\n    private fun setupPasswordViews() {\n        if (lockStore.hasPassword()) {\n            passwordSetView!!.setText(R.string.configuration_password_change)\n            passwordSetView!!.setOnClickListener {\n                ChangePasswordDialog(\n                    this,\n                    lockStore,\n                ) { this.setupPasswordViews() }\n                    .show()\n            }\n        } else {\n            passwordSetView!!.setText(R.string.configuration_password_set)\n            passwordSetView!!.setOnClickListener {\n                SetPasswordDialog(\n                    this,\n                    lockStore,\n                ) { this.setupPasswordViews() }.show()\n            }\n        }\n        val enableViews = !lockStore.isLocked\n        passwordSetView!!.isEnabled = enableViews\n        biometricSwitch!!.isEnabled = enableViews\n    }\n\n    private val onLockChanged =\n        Consumer { isLocked: Boolean ->\n            passwordSetView!!.isEnabled = !isLocked\n            biometricSwitch!!.isEnabled = !isLocked\n            changeLockView!!.setText(\n                if (isLocked\n                ) {\n                    R.string.configuration_storage_unlock\n                } else {\n                    R.string.configuration_storage_lock\n                },\n            )\n        }\n}"
  },
  {
    "path": "app/src/main/java/alt/nainapps/aer/config/StorageConfigActivity.kt",
    "content": "package alt.nainapps.aer.config\n\nimport alt.nainapps.aer.R\nimport alt.nainapps.aer.config.ui.theme.AnemoaerTheme\nimport android.annotation.SuppressLint\nimport android.content.Context\nimport android.content.SharedPreferences\nimport android.os.Bundle\nimport android.os.Environment\nimport android.os.StatFs\nimport android.preference.PreferenceManager.getDefaultSharedPreferences\nimport android.util.Log\nimport androidx.activity.ComponentActivity\nimport androidx.activity.compose.setContent\nimport androidx.activity.enableEdgeToEdge\nimport androidx.compose.foundation.ExperimentalFoundationApi\nimport androidx.compose.foundation.interaction.MutableInteractionSource\nimport androidx.compose.foundation.layout.Arrangement\nimport androidx.compose.foundation.layout.Column\nimport androidx.compose.foundation.layout.Row\nimport androidx.compose.foundation.layout.Spacer\nimport androidx.compose.foundation.layout.fillMaxSize\nimport androidx.compose.foundation.layout.fillMaxWidth\nimport androidx.compose.foundation.layout.padding\nimport androidx.compose.foundation.layout.size\nimport androidx.compose.foundation.layout.sizeIn\nimport androidx.compose.foundation.lazy.LazyColumn\nimport androidx.compose.foundation.lazy.items\nimport androidx.compose.foundation.lazy.rememberLazyListState\nimport androidx.compose.material.icons.Icons\nimport androidx.compose.material.icons.automirrored.rounded.List\nimport androidx.compose.material3.Card\nimport androidx.compose.material3.ExperimentalMaterial3Api\nimport androidx.compose.material3.Icon\nimport androidx.compose.material3.IconButton\nimport androidx.compose.material3.Scaffold\nimport androidx.compose.material3.SuggestionChip\nimport androidx.compose.material3.Text\nimport androidx.compose.material3.TopAppBar\nimport androidx.compose.runtime.Composable\nimport androidx.compose.runtime.getValue\nimport androidx.compose.runtime.mutableStateListOf\nimport androidx.compose.runtime.mutableStateOf\nimport androidx.compose.runtime.remember\nimport androidx.compose.runtime.saveable.rememberSaveable\nimport androidx.compose.runtime.setValue\nimport androidx.compose.ui.Alignment\nimport androidx.compose.ui.Modifier\nimport androidx.compose.ui.res.stringResource\nimport androidx.compose.ui.text.font.FontStyle\nimport androidx.compose.ui.text.font.FontWeight\nimport androidx.compose.ui.tooling.preview.Preview\nimport androidx.compose.ui.unit.dp\nimport androidx.compose.ui.unit.sp\nimport sh.calvin.reorderable.ReorderableItem\nimport sh.calvin.reorderable.rememberReorderableLazyListState\nimport java.io.File\n\nclass StorageConfigActivity : ComponentActivity() {\n\n    @OptIn(ExperimentalMaterial3Api::class)\n    override fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n        enableEdgeToEdge()\n        // At the top level of your kotlin file:\n        val sharedPrefs = getDefaultSharedPreferences(this)\n        setContent {\n            AnemoaerTheme {\n                Scaffold(modifier = Modifier.fillMaxSize(),\n                        topBar = {\n                    TopAppBar(\n                        title = {\n                            // Text(\"Aer Storage Backend priority\")\n                            Text(stringResource(R.string.storage_config_screen_title))\n                        }\n                    )\n                }) { innerPadding ->\n                    var selectedStorageDir by rememberSaveable { mutableStateOf(getPreferredStorageDir(sharedPrefs)) }\n                    var storageInfos = fetchExternalStorageDirectories(this.applicationContext)\n                    val internalStorageInfo =  StorageInfo(\n                        filesDir.toString(),\n                        getTotalSpace(filesDir),\n                        getFreeSpace(filesDir),\n                        isEmulated = false,\n                        isRemoveAble = false,\n                        isInternal = true\n                    )\n                    storageInfos = listOf(*storageInfos.toTypedArray(), internalStorageInfo)\n\n                    Column (Modifier.padding(paddingValues = innerPadding)) {\n                        selectedStorageDir?.let {\n                            Card(modifier = Modifier.padding(8.dp)) {\n                                Text(\n                                    text = \"Selected: $it\",\n                                    modifier = Modifier.padding(8.dp)\n                                )\n                            }\n                        }\n\n                        Text(\n                            text = stringResource(R.string.storage_config_select_help),\n                            fontStyle = FontStyle.Italic,\n                            modifier = Modifier.padding(8.dp)\n                        )\n\n                        StorageInfoListReorderable(storageInfos, sharedPrefs) {\n                            selected -> selectedStorageDir = selected\n                        }\n                    }\n                }\n            }\n        }\n    }\n}\n\n@Composable\nfun StorageInfoList(storageInfos: List<StorageInfo>) {\n    Log.i(\"live\", \"about to begin\")\n    Column(modifier = Modifier.padding(16.dp)) {\n        for (info in storageInfos) {\n            Log.i(\"live\", \"$info\")\n            Card(modifier = Modifier.padding(8.dp)) {\n                Text(text = info.dir)\n                Text(text = \"Total Space: ${ bytesToHumanReadableSize(info.totalSpace) }\")\n                Text(text = \"Free Space: ${ bytesToHumanReadableSize(info.freeSpace) }\")\n                Text(text = \"Is Emulated: ${if (info.isEmulated) \"Yes\" else \"No\"}\")\n            }\n        }\n    }\n}\n\n\n\n@OptIn(ExperimentalFoundationApi::class)\n@Composable\nfun StorageInfoListReorderable(storageInfos: List<StorageInfo>, sharedPrefs: SharedPreferences,\n                               onFreshStorageSelect: (String?) -> Unit) {\n    val mutableStorageInfosList = remember { mutableStateListOf(*storageInfos.toTypedArray()) }\n    val lazyListState = rememberLazyListState()\n    val reorderableLazyListState =\n        rememberReorderableLazyListState(lazyListState) { from, to ->\n            mutableStorageInfosList.apply { add(to.index, removeAt(from.index)) }\n            if (to.index == 0  || from.index == 0 ) {\n                // Save it to settings\n                savePreferredStorageDir(sharedPrefs, mutableStorageInfosList.first().dir)\n                // callback to let parent compose update\n                onFreshStorageSelect(getPreferredStorageDir(sharedPrefs))\n            }\n        }\n    LazyColumn(\n        state = lazyListState,\n        verticalArrangement = Arrangement.spacedBy(8.dp),\n    ) {\n        items(mutableStorageInfosList, key = { it.dir }) { info ->\n            ReorderableItem(reorderableLazyListState, key = info.dir) {\n                val interactionSource = remember { MutableInteractionSource() }\n                val longPressDraggable = Modifier.longPressDraggableHandle(interactionSource = interactionSource)\n                val draggable = Modifier.draggableHandle(interactionSource = interactionSource)\n                StorageInfoCard(info = info, longPressDraggable, draggable) {\n                    savePreferredStorageDir(sharedPrefs, info.dir)\n                    onFreshStorageSelect(getPreferredStorageDir(sharedPrefs))\n                }\n            }\n        }\n    }\n}\n\n// Pass either longPressDraggableModifier or draggableModifier to make it draggable\n@Composable\nfun StorageInfoCard(\n    info: StorageInfo,\n    @SuppressLint(\"ModifierParameter\")\n    longPressDraggableModifier: Modifier? = null,\n    draggableModifier: Modifier? = null,\n    onClick: () -> Unit = {}\n) {\n    Card(onClick = onClick, modifier = (longPressDraggableModifier ?: Modifier).padding(horizontal = 8.dp)) {\n        Row (Modifier.padding(4.dp)) {\n            (draggableModifier ?: longPressDraggableModifier)?.let {\n                IconButton( modifier = it, onClick = {}) {\n                    Icon(Icons.AutoMirrored.Rounded.List, contentDescription = \"Reorder\")\n                }\n            }\n\n            Column {\n                Row (\n                    horizontalArrangement = Arrangement.SpaceBetween,\n                    verticalAlignment = Alignment.CenterVertically,\n                    modifier = Modifier.fillMaxWidth()\n                ) {\n                    Text(text = if (info.isInternal) \"Internal\" else \"External\", fontWeight = FontWeight.Bold )\n                    Row {\n                        if (info.isRemoveAble) {\n                            SuggestionChip(\n                                onClick = { },\n                                modifier = Modifier.sizeIn(maxHeight = 20.dp).padding(horizontal = 2.dp),\n                                label = { Text(text = \"Removable\", fontSize = 10.sp)}\n\n                            )\n                        }\n                        if (info.isEmulated) {\n                            SuggestionChip(\n                                onClick = { },\n                                modifier = Modifier.sizeIn(maxHeight = 20.dp).padding(horizontal = 2.dp),\n                                label = { Text(text = \"Emulated\", fontSize = 10.sp )}\n                            )\n                        }\n                    }\n\n                }\n                val totalSpace = bytesToHumanReadableSize(info.totalSpace)\n                val freeSpace = bytesToHumanReadableSize(info.freeSpace)\n                Column (Modifier.padding(vertical = 4.dp)) {\n                    Text(text = info.dir, fontWeight = FontWeight.Medium)\n                    Text(text = \"Total Space: $totalSpace\")\n                    Text(text = \"Free Space: $freeSpace\")\n                    Spacer(Modifier.size(2.dp))\n                }\n\n\n            }\n        }\n    }\n\n}\n\n//@Composable\n//fun DraggableHandleIcon(draggableModifier: Modifier) {\n//    IconButton(\n//        modifier = draggableModifier,\n//        onClick = {},\n//    ) {\n//        Icon(Icons.Rounded.Menu, contentDescription = \"Reorder\")\n//    }\n//}\n\ndata class StorageInfo(\n    val dir: String,\n    val totalSpace: Long,\n    val freeSpace: Long,\n    val isEmulated: Boolean,\n    val isRemoveAble: Boolean,\n    val isInternal: Boolean\n)\n\nfun fetchExternalStorageDirectories(context: Context): List<StorageInfo> {\n    val directories = mutableListOf<StorageInfo>()\n    val externalDirs = context.getExternalFilesDirs(null)\n\n    for (dir in externalDirs.reversed()) {\n        if (dir != null) {\n            val totalSpace = getTotalSpace(dir)\n            val freeSpace = getFreeSpace(dir)\n\n            val isEmulated = Environment.isExternalStorageEmulated(dir)\n            val isRemovable = Environment.isExternalStorageRemovable(dir)\n            val isInternal = false\n\n            directories.add(StorageInfo(dir.path, totalSpace, freeSpace, isEmulated, isRemovable, isInternal))\n        }\n    }\n\n    return directories\n}\n\nprivate fun getTotalSpace(path: File): Long {\n    val statFs = StatFs(path.absolutePath)\n    return statFs.blockCountLong * statFs.blockSizeLong\n}\n\nprivate fun getFreeSpace(path: File): Long {\n    val statFs = StatFs(path.absolutePath)\n    return statFs.availableBlocksLong * statFs.blockSizeLong\n}\n\nfun bytesToHumanReadableSize(bytes: Long) =\n    when {\n        bytes >= 1 shl 30 -> \"%.1f GB\".format(bytes.toDouble() / (1 shl 30))\n        bytes >= 1 shl 20 -> \"%.1f MB\".format(bytes.toDouble() / (1 shl 20))\n        bytes >= 1 shl 10 -> \"%.0f kB\".format(bytes.toDouble() / (1 shl 10))\n        else -> \"$bytes bytes\"\n    }\n\nfun savePreferredStorageDir(sharedPrefs: SharedPreferences, dir: String) {\n    with (sharedPrefs.edit()) {\n        putString(\"selected_storage_dir\", dir)\n        apply()\n    }\n}\n\nfun getPreferredStorageDir(sharedPrefs: SharedPreferences): String? {\n    return sharedPrefs.getString(\"selected_storage_dir\", null)\n}\n\n@Composable\nfun Greeting(\n    name: String,\n    modifier: Modifier = Modifier,\n) {\n    Text(\n        text = \"Hello $name!\",\n        modifier = modifier,\n    )\n}\n\n@Preview(showBackground = true)\n@Composable\nfun GreetingPreview() {\n    AnemoaerTheme {\n        Greeting(\"Android\")\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/alt/nainapps/aer/config/autolock/AutoLockDelayMinutesTextListener.kt",
    "content": "/*\n * Copyright (c) 2024 nain\n * SPDX-License-Identifier: GPL-3.0-only\n */\n\npackage alt.nainapps.aer.config.autolock\n\nimport alt.nainapps.aer.R\nimport alt.nainapps.aer.lock.LockStore\nimport android.content.Context\nimport android.text.Editable\nimport android.text.TextWatcher\nimport android.widget.EditText\n\nfun interface AutoLockDelayMinutesTextListener : TextWatcher {\n\n    override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {\n    }\n    override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {\n    }\n    override fun afterTextChanged(s: Editable) {\n        afterTextChanged(s.toString())\n    }\n    // this will be provided as lambda\n    fun afterTextChanged(text: String)\n}\n\nfun buildValidatedAutoLockDelayListener(context: Context, lockstore: LockStore, input: EditText): AutoLockDelayMinutesTextListener {\n    return AutoLockDelayMinutesTextListener { text ->\n        // validate text isNumber\n        try {\n            text.toLong()\n        } catch (error: NumberFormatException) {\n            input.setError(\"NaN: Not a Number\",\n                context.getDrawable(R.drawable.ic_error))\n            return@AutoLockDelayMinutesTextListener\n        }\n        val minutes: Long = text.toLong()\n        // validate not zero\n        if (minutes == 0L) {\n            input.setError(\"Auto lock delay can't be zero\",\n                context.getDrawable(R.drawable.ic_error))\n        }\n        lockstore.autoLockDelayMinutes = minutes\n    }\n}"
  },
  {
    "path": "app/src/main/java/alt/nainapps/aer/config/password/ChangePasswordDialog.kt",
    "content": "/*\n * Copyright (c) 2021 2bllw8\n * SPDX-License-Identifier: GPL-3.0-only\n */\npackage alt.nainapps.aer.config.password\n\nimport alt.nainapps.aer.R\nimport alt.nainapps.aer.lock.LockStore\nimport android.app.Activity\nimport android.content.DialogInterface\nimport android.view.View\nimport android.widget.Button\nimport android.widget.EditText\n\nclass ChangePasswordDialog(activity: Activity, lockStore: LockStore, onSuccess: Runnable) :\n    PasswordDialog(\n        activity, lockStore, onSuccess, R.string.password_change_title,\n        R.layout.password_change\n    ) {\n    override fun build() {\n        val currentField = dialog.findViewById<EditText>(R.id.currentFieldView)\n        val passwordField = dialog.findViewById<EditText>(R.id.passwordFieldView)\n        val repeatField = dialog.findViewById<EditText>(R.id.repeatFieldView)\n        val positiveBtn = dialog.getButton(DialogInterface.BUTTON_POSITIVE)\n        val neutralBtn = dialog.getButton(DialogInterface.BUTTON_NEUTRAL)\n\n        val validator = buildTextListener(passwordField, repeatField, positiveBtn)\n        passwordField.addTextChangedListener(validator)\n        repeatField.addTextChangedListener(validator)\n\n        positiveBtn.visibility = View.VISIBLE\n        positiveBtn.setText(R.string.password_change_action)\n        positiveBtn.isEnabled = false\n        positiveBtn.setOnClickListener { v: View? ->\n            val currentPassword = currentField.text.toString()\n            val newPassword = passwordField.text.toString()\n            if (lockStore.passwordMatch(currentPassword)) {\n                if (lockStore.setPassword(newPassword)) {\n                    dismiss()\n                    lockStore.unlock()\n                    onSuccess.run()\n                }\n            } else {\n                currentField.setError(res.getString(R.string.password_error_wrong), errorIcon)\n            }\n        }\n\n        neutralBtn.visibility = View.VISIBLE\n        neutralBtn.setText(R.string.password_change_remove)\n        neutralBtn.setOnClickListener { v: View? ->\n            lockStore.removePassword()\n            onSuccess.run()\n            dismiss()\n        }\n    }\n\n    private fun buildTextListener(\n        passwordField: EditText, repeatField: EditText,\n        positiveBtn: Button\n    ): PasswordTextListener {\n        return PasswordTextListener {\n            val passwordValue = passwordField.text.toString()\n            val repeatValue = repeatField.text.toString()\n            if (passwordValue.length < MIN_PASSWORD_LENGTH) {\n                positiveBtn.isEnabled = false\n                passwordField.setError(\n                    res.getString(R.string.password_error_length, MIN_PASSWORD_LENGTH),\n                    errorIcon\n                )\n                repeatField.error = null\n            } else if (passwordValue != repeatValue) {\n                positiveBtn.isEnabled = false\n                passwordField.error = null\n                repeatField.setError(\n                    res.getString(R.string.password_error_mismatch),\n                    errorIcon\n                )\n            } else {\n                positiveBtn.isEnabled = true\n                passwordField.error = null\n                repeatField.error = null\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/alt/nainapps/aer/config/password/PasswordDialog.kt",
    "content": "/*\n * Copyright (c) 2021 2bllw8\n * SPDX-License-Identifier: GPL-3.0-only\n */\npackage alt.nainapps.aer.config.password\n\nimport alt.nainapps.aer.R\nimport alt.nainapps.aer.lock.LockStore\nimport android.app.Activity\nimport android.app.AlertDialog\nimport android.content.DialogInterface\nimport android.content.res.Resources\nimport android.graphics.drawable.Drawable\nimport androidx.annotation.LayoutRes\nimport androidx.annotation.StringRes\n\nabstract class PasswordDialog(\n    activity: Activity, @JvmField protected val lockStore: LockStore, @JvmField protected val onSuccess: Runnable,\n    @StringRes title: Int, @LayoutRes layout: Int\n) {\n    @JvmField\n    protected val res: Resources = activity.resources\n    @JvmField\n    protected val dialog: AlertDialog\n    @JvmField\n    protected val MIN_PASSWORD_LENGTH: Int = 4\n\n    init {\n        this.dialog = AlertDialog.Builder(activity, R.style.DialogTheme).setTitle(title)\n            .setView(layout)\n            .setCancelable(false)\n            .setNegativeButton(android.R.string.cancel) { d: DialogInterface?, which: Int -> dismiss() }\n            .create()\n    }\n\n    fun dismiss() {\n        if (dialog.isShowing) {\n            dialog.dismiss()\n        }\n    }\n\n    fun show() {\n        dialog.show()\n        build()\n    }\n\n    protected val errorIcon: Drawable\n        get() {\n            val drawable = dialog.context.getDrawable(R.drawable.ic_error)\n            drawable!!.setBounds(0, 0, drawable.intrinsicWidth, drawable.intrinsicHeight)\n            return drawable\n        }\n\n    protected abstract fun build()\n}\n"
  },
  {
    "path": "app/src/main/java/alt/nainapps/aer/config/password/PasswordTextListener.kt",
    "content": "/*\n * Copyright (c) 2022 2bllw8\n * SPDX-License-Identifier: GPL-3.0-only\n */\npackage alt.nainapps.aer.config.password\n\nimport android.text.Editable\nimport android.text.TextWatcher\n\nfun interface PasswordTextListener : TextWatcher {\n    override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {\n    }\n\n    override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {\n    }\n\n    override fun afterTextChanged(s: Editable) {\n        onTextChanged(s.toString())\n    }\n\n    fun onTextChanged(text: String?)\n}\n"
  },
  {
    "path": "app/src/main/java/alt/nainapps/aer/config/password/SetPasswordDialog.kt",
    "content": "/*\n * Copyright (c) 2021 2bllw8\n * SPDX-License-Identifier: GPL-3.0-only\n */\npackage alt.nainapps.aer.config.password\n\nimport alt.nainapps.aer.R\nimport alt.nainapps.aer.lock.LockStore\nimport android.app.Activity\nimport android.content.DialogInterface\nimport android.view.View\nimport android.widget.Button\nimport android.widget.EditText\n\nclass SetPasswordDialog(activity: Activity, lockStore: LockStore, onSuccess: Runnable) :\n    PasswordDialog(\n        activity, lockStore, onSuccess, R.string.password_set_title,\n        R.layout.password_first_set\n    ) {\n    override fun build() {\n        val passwordField = dialog.findViewById<EditText>(R.id.passwordFieldView)\n        val repeatField = dialog.findViewById<EditText>(R.id.repeatFieldView)\n        val positiveBtn = dialog.getButton(DialogInterface.BUTTON_POSITIVE)\n\n        val validator = buildValidator(passwordField, repeatField, positiveBtn)\n        passwordField.addTextChangedListener(validator)\n        repeatField.addTextChangedListener(validator)\n\n        positiveBtn.visibility = View.VISIBLE\n        positiveBtn.setText(R.string.password_set_action)\n        positiveBtn.isEnabled = false\n        positiveBtn.setOnClickListener { v: View? ->\n            val passwordValue = passwordField.text.toString()\n            if (lockStore.setPassword(passwordValue)) {\n                dismiss()\n                lockStore.unlock()\n                onSuccess.run()\n            }\n        }\n    }\n\n    private fun buildValidator(\n        passwordField: EditText, repeatField: EditText,\n        positiveBtn: Button\n    ): PasswordTextListener {\n        return PasswordTextListener {\n            val passwordValue = passwordField.text.toString()\n            val repeatValue = repeatField.text.toString()\n            if (passwordValue.length < MIN_PASSWORD_LENGTH) {\n                positiveBtn.isEnabled = false\n                passwordField.setError(\n                    res.getString(R.string.password_error_length, MIN_PASSWORD_LENGTH),\n                    errorIcon\n                )\n                repeatField.error = null\n            } else if (passwordValue != repeatValue) {\n                positiveBtn.isEnabled = false\n                passwordField.error = null\n                repeatField.setError(\n                    res.getString(R.string.password_error_mismatch),\n                    errorIcon\n                )\n            } else {\n                positiveBtn.isEnabled = true\n                passwordField.error = null\n                repeatField.error = null\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/alt/nainapps/aer/config/ui/theme/Color.kt",
    "content": "package alt.nainapps.aer.config.ui.theme\n\nimport androidx.compose.ui.graphics.Color\n\nval Purple80 = Color(0xFFD0BCFF)\nval PurpleGrey80 = Color(0xFFCCC2DC)\nval Pink80 = Color(0xFFEFB8C8)\n\nval Purple40 = Color(0xFF6650a4)\nval PurpleGrey40 = Color(0xFF625b71)\nval Pink40 = Color(0xFF7D5260)"
  },
  {
    "path": "app/src/main/java/alt/nainapps/aer/config/ui/theme/Theme.kt",
    "content": "package alt.nainapps.aer.config.ui.theme\n\nimport android.app.Activity\nimport android.os.Build\nimport androidx.compose.foundation.isSystemInDarkTheme\nimport androidx.compose.material3.MaterialTheme\nimport androidx.compose.material3.darkColorScheme\nimport androidx.compose.material3.dynamicDarkColorScheme\nimport androidx.compose.material3.dynamicLightColorScheme\nimport androidx.compose.material3.lightColorScheme\nimport androidx.compose.runtime.Composable\nimport androidx.compose.ui.platform.LocalContext\n\nprivate val DarkColorScheme = darkColorScheme(\n    primary = Purple80,\n    secondary = PurpleGrey80,\n    tertiary = Pink80\n)\n\nprivate val LightColorScheme = lightColorScheme(\n    primary = Purple40,\n    secondary = PurpleGrey40,\n    tertiary = Pink40\n\n    /* Other default colors to override\n    background = Color(0xFFFFFBFE),\n    surface = Color(0xFFFFFBFE),\n    onPrimary = Color.White,\n    onSecondary = Color.White,\n    onTertiary = Color.White,\n    onBackground = Color(0xFF1C1B1F),\n    onSurface = Color(0xFF1C1B1F),\n    */\n)\n\n@Composable\nfun AnemoaerTheme(\n    darkTheme: Boolean = isSystemInDarkTheme(),\n    // Dynamic color is available on Android 12+\n    dynamicColor: Boolean = true,\n    content: @Composable () -> Unit\n) {\n    val colorScheme = when {\n        dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> {\n            val context = LocalContext.current\n            if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)\n        }\n\n        darkTheme -> DarkColorScheme\n        else -> LightColorScheme\n    }\n\n    MaterialTheme(\n        colorScheme = colorScheme,\n        typography = Typography,\n        content = content\n    )\n}"
  },
  {
    "path": "app/src/main/java/alt/nainapps/aer/config/ui/theme/Type.kt",
    "content": "package alt.nainapps.aer.config.ui.theme\n\nimport androidx.compose.material3.Typography\nimport androidx.compose.ui.text.TextStyle\nimport androidx.compose.ui.text.font.FontFamily\nimport androidx.compose.ui.text.font.FontWeight\nimport androidx.compose.ui.unit.sp\n\n// Set of Material typography styles to start with\nval Typography = Typography(\n    bodyLarge = TextStyle(\n        fontFamily = FontFamily.Default,\n        fontWeight = FontWeight.Normal,\n        fontSize = 16.sp,\n        lineHeight = 24.sp,\n        letterSpacing = 0.5.sp\n    )\n    /* Other default text styles to override\n    titleLarge = TextStyle(\n        fontFamily = FontFamily.Default,\n        fontWeight = FontWeight.Normal,\n        fontSize = 22.sp,\n        lineHeight = 28.sp,\n        letterSpacing = 0.sp\n    ),\n    labelSmall = TextStyle(\n        fontFamily = FontFamily.Default,\n        fontWeight = FontWeight.Medium,\n        fontSize = 11.sp,\n        lineHeight = 16.sp,\n        letterSpacing = 0.5.sp\n    )\n    */\n)"
  },
  {
    "path": "app/src/main/java/alt/nainapps/aer/documents/home/HomeEnvironment.kt",
    "content": "/*\n * Copyright (c) 2021 2bllw8\n * SPDX-License-Identifier: GPL-3.0-only\n */\npackage alt.nainapps.aer.documents.home\n\nimport android.content.Context\nimport android.os.Build\nimport android.os.Environment\nimport android.preference.PreferenceManager.getDefaultSharedPreferences\nimport java.io.File\nimport java.io.IOException\nimport java.nio.file.Files\nimport java.nio.file.Path\nimport kotlin.concurrent.Volatile\n\nclass HomeEnvironment private constructor(\n    context: Context,\n) {\n    val baseDir: Path =\n            getPreferredStorageFilesDir(context)?.toPath() // manual config\n                ?: getSelectExternalFilesDir(context)?.toPath()\n                ?: context.filesDir.toPath() // internal\n\n    init {\n        if (!Files.exists(baseDir)) {\n            Files.createDirectory(baseDir)\n        } else if (!Files.isDirectory(baseDir)) {\n            throw IOException(\"$baseDir is not a directory\")\n        }\n    }\n\n    fun isRoot(path: Path): Boolean = baseDir == path\n\n    private fun getPreferredStorageFilesDir(context: Context): File? {\n        val sharedPrefs = getDefaultSharedPreferences(context)\n        return sharedPrefs.getString(\"selected_storage_dir\",null)?.let {\n            File(it)\n        }\n    }\n\n    private fun getSelectExternalFilesDir(context: Context): File? {\n        // Below Android 11 (API 30) we do not prefer external storage\n        // as privacy of external filedir is guaranteed from Android 11 only.\n        // https://developer.android.com/about/versions/11/privacy/storage#other-app-specific-dirs\n        if (Build.VERSION.SDK_INT < 30) {\n            return null\n        }\n        val externalFilesDirs = context.getExternalFilesDirs(null)\n        // The first few (in forward order) may be on primary storage,\n        // so we traverse in reverse order to find first available externalFilesDir\n        for (i in externalFilesDirs.indices.reversed()) {\n            if (externalFilesDirs[i] != null) {\n                if (Environment.getExternalStorageState(externalFilesDirs[i]) == Environment.MEDIA_MOUNTED) {\n                    return externalFilesDirs[i]\n                }\n            }\n        }\n        return null\n    }\n\n    companion object {\n        const val AUTHORITY: String = \"alt.nainapps.aer.documents\"\n        const val ROOT: String = \"alt.nainapps.aer.documents.root\"\n        const val ROOT_DOC_ID: String = \"aer_root\"\n\n        @Volatile\n        private var instance: HomeEnvironment? = null\n\n        @Throws(IOException::class)\n        fun getInstance(context: Context): HomeEnvironment? {\n            if (instance == null) {\n                synchronized(HomeEnvironment::class.java) {\n                    if (instance == null) {\n                        instance = HomeEnvironment(context.applicationContext)\n                    }\n                }\n            }\n            return instance\n        }\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/alt/nainapps/aer/documents/provider/AnemoDocumentProvider.kt",
    "content": "/*\n * Copyright (c) 2021 2bllw8\n * SPDX-License-Identifier: GPL-3.0-only\n */\npackage alt.nainapps.aer.documents.provider\n\nimport alt.nainapps.aer.R\nimport alt.nainapps.aer.documents.home.HomeEnvironment\nimport alt.nainapps.aer.documents.home.HomeEnvironment.Companion.getInstance\nimport alt.nainapps.aer.lock.LockStore\nimport alt.nainapps.aer.lock.UnlockActivity\nimport android.app.AuthenticationRequiredException\nimport android.app.PendingIntent\nimport android.content.Intent\nimport android.content.res.AssetFileDescriptor\nimport android.database.Cursor\nimport android.database.MatrixCursor\nimport android.graphics.Point\nimport android.net.Uri\nimport android.os.Build\nimport android.os.Bundle\nimport android.os.CancellationSignal\nimport android.os.ParcelFileDescriptor\nimport android.provider.DocumentsContract\nimport android.provider.DocumentsContract.Root\nimport android.util.Log\nimport exe.bbllw8.either.Failure\nimport exe.bbllw8.either.Success\nimport exe.bbllw8.either.Try\nimport java.io.FileNotFoundException\nimport java.nio.file.Files\nimport java.nio.file.Path\nimport java.nio.file.Paths\nimport java.util.function.Consumer\n\nclass AnemoDocumentProvider : FileSystemProvider() {\n    private var homeEnvironment: HomeEnvironment? = null\n    private var lockStore: LockStore? = null\n\n    private var showInfo = true\n\n    override fun onCreate(): Boolean {\n        if (!super.onCreate()) {\n            return false\n        }\n\n        val context = context\n        lockStore = context?.let { LockStore.getInstance(it) }\n        lockStore!!.addListener(onLockChanged)\n\n        return Try\n            .from {\n                getInstance(\n                    context!!,\n                )\n            }.fold(\n                { failure: Throwable? ->\n                    Log.e(TAG, \"Failed to setup\", failure)\n                    false\n                },\n                { homeEnvironment: HomeEnvironment? ->\n                    this.homeEnvironment = homeEnvironment\n                    true\n                },\n            )\n    }\n\n    override fun shutdown() {\n        lockStore!!.removeListener(onLockChanged)\n        super.shutdown()\n    }\n\n    override fun queryRoots(projection: Array<String?>?): Cursor {\n        if (lockStore!!.isLocked) {\n            return EmptyCursor()\n        }\n\n        val context = context\n        val result = MatrixCursor(resolveRootProjection(projection))\n        val row = result.newRow()\n\n        var flags = Root.FLAG_LOCAL_ONLY\n        flags = flags or Root.FLAG_SUPPORTS_CREATE\n        flags = flags or Root.FLAG_SUPPORTS_IS_CHILD\n        flags = flags or Root.FLAG_SUPPORTS_EJECT\n        if (Build.VERSION.SDK_INT >= 29) {\n            flags = flags or Root.FLAG_SUPPORTS_SEARCH\n        }\n\n        row\n            .add(Root.COLUMN_ROOT_ID, HomeEnvironment.ROOT)\n            .add(Root.COLUMN_DOCUMENT_ID, HomeEnvironment.ROOT_DOC_ID)\n            .add(Root.COLUMN_FLAGS, flags)\n            .add(Root.COLUMN_ICON, R.drawable.ic_storage)\n            .add(Root.COLUMN_TITLE, context!!.getString(R.string.app_name))\n            .add(\n                Root.COLUMN_SUMMARY,\n                context.getString(R.string.anemo_description),\n            )\n        return result\n    }\n\n    @Throws(FileNotFoundException::class)\n    override fun queryChildDocuments(\n        parentDocumentId: String,\n        projection: Array<String?>?,\n        sortOrder: String?,\n    ): Cursor {\n        if (lockStore!!.isLocked) {\n            return EmptyCursor()\n        }\n\n        val c = super.queryChildDocuments(parentDocumentId, projection, sortOrder)\n        if (showInfo && HomeEnvironment.ROOT_DOC_ID == parentDocumentId) {\n            // Hide from now on\n            // showInfo = false\n            // Show info in root dir\n            val extras = Bundle()\n            extras.putCharSequence(\n                DocumentsContract.EXTRA_INFO,\n                context!!.getText(R.string.anemo_info),\n            )\n            // If below Android 11 warn about reduced privacy of external storage\n            if (Build.VERSION.SDK_INT < 30) {\n                val baseDir = homeEnvironment?.baseDir?.toFile()\n                val externalDirs = context!!.getExternalFilesDirs(null)\n                if (baseDir in externalDirs) {\n                    extras.remove(DocumentsContract.EXTRA_INFO)\n                    extras.putCharSequence(\n                        DocumentsContract.EXTRA_ERROR,\n                        context!!.getText(R.string.anemo_error),\n                    )\n                }\n            }\n            c.extras = extras\n        }\n        return c\n    }\n\n    @Throws(FileNotFoundException::class)\n    override fun queryDocument(\n        documentId: String,\n        projection: Array<String?>?,\n    ): Cursor =\n        if (lockStore!!.isLocked) {\n            EmptyCursor()\n        } else {\n            super.queryDocument(documentId, projection)\n        }\n\n    @Throws(FileNotFoundException::class)\n    override fun querySearchDocuments(\n        rootId: String,\n        projection: Array<String?>?,\n        queryArgs: Bundle,\n    ): Cursor? =\n        if (lockStore!!.isLocked) {\n            EmptyCursor()\n        } else {\n            super.querySearchDocuments(rootId, projection, queryArgs)\n        }\n\n    override fun findDocumentPath(\n        parentDocumentId: String?,\n        childDocumentId: String,\n    ): DocumentsContract.Path =\n        if (lockStore!!.isLocked) {\n            DocumentsContract.Path(null, emptyList())\n        } else {\n            super.findDocumentPath(parentDocumentId, childDocumentId)\n        }\n\n    @Throws(FileNotFoundException::class)\n    override fun openDocument(\n        documentId: String,\n        mode: String,\n        signal: CancellationSignal?,\n    ): ParcelFileDescriptor {\n        assertUnlocked()\n        return super.openDocument(documentId, mode, signal)\n    }\n\n    @Throws(FileNotFoundException::class)\n    override fun openDocumentThumbnail(\n        docId: String,\n        sizeHint: Point,\n        signal: CancellationSignal,\n    ): AssetFileDescriptor {\n        assertUnlocked()\n        return super.openDocumentThumbnail(docId, sizeHint, signal)\n    }\n\n    override fun createDocument(\n        parentDocumentId: String,\n        mimeType: String,\n        displayName: String,\n    ): String {\n        assertUnlocked()\n        return super.createDocument(parentDocumentId, mimeType, displayName)\n    }\n\n    override fun deleteDocument(documentId: String) {\n        assertUnlocked()\n        super.deleteDocument(documentId)\n    }\n\n    override fun removeDocument(\n        documentId: String,\n        parentDocumentId: String,\n    ) {\n        deleteDocument(documentId)\n    }\n\n//    @Throws(FileNotFoundException::class)\n    override fun copyDocument(\n        sourceDocumentId: String,\n        targetParentDocumentId: String,\n    ): String {\n        assertUnlocked()\n        return super.copyDocument(sourceDocumentId, targetParentDocumentId)\n    }\n\n    override fun moveDocument(\n        sourceDocumentId: String,\n        sourceParentDocumentId: String,\n        targetParentDocumentId: String,\n    ): String {\n        assertUnlocked()\n        return super.moveDocument(sourceDocumentId, sourceParentDocumentId, targetParentDocumentId)\n    }\n\n    override fun renameDocument(\n        documentId: String,\n        displayName: String,\n    ): String {\n        assertUnlocked()\n        return super.renameDocument(documentId, displayName)\n    }\n\n    override fun ejectRoot(rootId: String) {\n        if (HomeEnvironment.ROOT == rootId) {\n            lockStore!!.lock()\n        }\n    }\n\n    override fun buildNotificationUri(docId: String?): Uri = DocumentsContract.buildChildDocumentsUri(HomeEnvironment.AUTHORITY, docId)\n\n    override fun getPathForId(docId: String?): Try<Path> {\n        val baseDir = homeEnvironment!!.baseDir\n        if (HomeEnvironment.ROOT_DOC_ID == docId) {\n            return Success(baseDir)\n        } else {\n            if (docId == null) {\n                return Failure(FileNotFoundException(\"No root for $docId\"))\n            }\n            val splitIndex = docId.indexOf('/', 1)\n            if (splitIndex < 0) {\n                return Failure(FileNotFoundException(\"No root for $docId\"))\n            } else {\n                val targetPath = docId.substring(splitIndex + 1)\n                val target = Paths.get(baseDir.toString(), targetPath)\n                return if (Files.exists(target)) {\n                    Success(target)\n                } else {\n                    Failure(\n                        FileNotFoundException(\"No path for $docId at $target\"),\n                    )\n                }\n            }\n        }\n    }\n\n    override fun getDocIdForPath(path: Path?): String {\n        val rootPath = homeEnvironment!!.baseDir\n        return if (rootPath == path) {\n            HomeEnvironment.ROOT_DOC_ID\n        } else {\n            (\n                HomeEnvironment.ROOT_DOC_ID +\n                    path.toString().replaceFirst(rootPath.toString().toRegex(), \"\")\n            )\n        }\n    }\n\n    override fun isNotEssential(path: Path?): Boolean = !homeEnvironment!!.isRoot(path!!)\n\n    override fun onDocIdChanged(docId: String?) {\n        // no-op\n    }\n\n    override fun onDocIdDeleted(docId: String?) {\n        // no-op\n    }\n\n    /**\n     * @throws AuthenticationRequiredException\n     * if [LockStore.isLocked] is true.\n     */\n    private fun assertUnlocked() {\n        if (lockStore!!.isLocked) {\n            val context = context\n            val intent =\n                Intent(context, UnlockActivity::class.java)\n                    .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)\n            throw AuthenticationRequiredException(\n                Throwable(\"Locked storage\"),\n                PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE),\n            )\n        }\n    }\n\n    private val onLockChanged =\n        Consumer { _: Boolean ->\n            cr\n                ?.notifyChange(DocumentsContract.buildRootsUri(HomeEnvironment.AUTHORITY), null)\n        }\n\n    companion object {\n        private const val TAG = \"AerDocumentProvider\"\n\n        private val DEFAULT_ROOT_PROJECTION =\n            arrayOf(\n                Root.COLUMN_ROOT_ID,\n                Root.COLUMN_FLAGS,\n                Root.COLUMN_ICON,\n                Root.COLUMN_TITLE,\n                Root.COLUMN_DOCUMENT_ID,\n            )\n\n        private fun resolveRootProjection(projection: Array<String?>?): Array<out String?> = projection ?: DEFAULT_ROOT_PROJECTION\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/alt/nainapps/aer/documents/provider/EmptyCursor.kt",
    "content": "/*\n * Copyright (c) 2022 2bllw8\n * SPDX-License-Identifier: GPL-3.0-only\n */\npackage alt.nainapps.aer.documents.provider\n\nimport android.database.AbstractCursor\n\nclass EmptyCursor : AbstractCursor() {\n    override fun getCount(): Int {\n        return 0\n    }\n\n    override fun getColumnNames(): Array<String?> {\n        return arrayOfNulls(0)\n    }\n\n    override fun getString(column: Int): String? {\n        return null\n    }\n\n    override fun getShort(column: Int): Short {\n        return 0\n    }\n\n    override fun getInt(column: Int): Int {\n        return 0\n    }\n\n    override fun getLong(column: Int): Long {\n        return 0L\n    }\n\n    override fun getFloat(column: Int): Float {\n        return 0f\n    }\n\n    override fun getDouble(column: Int): Double {\n        return 0.0\n    }\n\n    override fun isNull(column: Int): Boolean {\n        return true\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/alt/nainapps/aer/documents/provider/FileSystemProvider.kt",
    "content": "/*\n * Copyright (c) 2022 2bllw8\n * SPDX-License-Identifier: GPL-3.0-only\n */\npackage alt.nainapps.aer.documents.provider\n\nimport alt.nainapps.aer.documents.provider.PathUtils.buildUniquePath\nimport alt.nainapps.aer.documents.provider.PathUtils.buildValidFileName\nimport alt.nainapps.aer.documents.provider.PathUtils.deleteContents\nimport alt.nainapps.aer.documents.provider.PathUtils.getDocumentType\nimport android.annotation.SuppressLint\nimport android.content.ContentResolver\nimport android.content.Context\nimport android.content.Intent\nimport android.content.res.AssetFileDescriptor\nimport android.database.Cursor\nimport android.database.MatrixCursor\nimport android.database.MatrixCursor.RowBuilder\nimport android.graphics.Point\nimport android.net.Uri\nimport android.os.Build\nimport android.os.Bundle\nimport android.os.CancellationSignal\nimport android.os.FileObserver\nimport android.os.Handler\nimport android.os.Looper\nimport android.os.ParcelFileDescriptor\nimport android.provider.DocumentsContract\nimport android.provider.DocumentsProvider\nimport android.system.Int64Ref\nimport android.text.TextUtils\nimport android.util.ArrayMap\nimport android.util.Log\nimport android.webkit.MimeTypeMap\nimport androidx.annotation.RequiresApi\nimport androidx.exifinterface.media.ExifInterface\nimport exe.bbllw8.either.Try\nimport java.io.FileNotFoundException\nimport java.io.IOException\nimport java.nio.file.FileVisitResult\nimport java.nio.file.Files\nimport java.nio.file.Path\nimport java.nio.file.SimpleFileVisitor\nimport java.nio.file.attribute.BasicFileAttributes\nimport java.nio.file.attribute.FileTime\nimport java.util.concurrent.CopyOnWriteArrayList\nimport java.util.concurrent.atomic.AtomicInteger\n\n/**\n * A helper class for [android.provider.DocumentsProvider] to perform file operations on local\n * files.\n *\n *\n * Based on `com.android.internal.content.FileSystemProvider`.\n */\nabstract class FileSystemProvider : DocumentsProvider() {\n    private val observers = ArrayMap<Path, DirectoryObserver>()\n\n    private var handler: Handler? = null\n    protected var cr: ContentResolver? = null\n\n    override fun onCreate(): Boolean {\n        handler = Handler(Looper.myLooper()!!)\n        cr = context!!.contentResolver\n        return true\n    }\n\n    override fun getDocumentMetadata(documentId: String): Bundle? {\n        return getPathForId(documentId)\n            .filter { path: Path? -> Files.exists(path) }\n            .filter { path: Path? -> Files.isReadable(path) }\n            .map<Bundle?> { path: Path? ->\n                if (Build.VERSION.SDK_INT >= 29 && Files.isDirectory(path)) {\n                    val treeSize = Int64Ref(0)\n                    val treeCount = Int64Ref(0)\n\n                    Files.walkFileTree(\n                        path,\n                        object : SimpleFileVisitor<Path>() {\n                            override fun visitFile(\n                                file: Path,\n                                attrs: BasicFileAttributes,\n                            ): FileVisitResult {\n                                treeSize.value += attrs.size()\n                                treeCount.value += 1\n                                return FileVisitResult.CONTINUE\n                            }\n                        },\n                    )\n\n                    val bundle = Bundle()\n                    bundle.putLong(DocumentsContract.METADATA_TREE_SIZE, treeSize.value)\n                    bundle.putLong(DocumentsContract.METADATA_TREE_COUNT, treeCount.value)\n                    return@map bundle\n                } else {\n                    return@map null\n                }\n            }.getOrElse(null)\n    }\n\n    override fun createDocument(\n        parentDocumentId: String,\n        mimeType: String,\n        displayName: String,\n    ): String {\n        val docName = buildValidFileName(displayName)\n        val result =\n            getPathForId(parentDocumentId)\n                .filter { path: Path? -> Files.isDirectory(path) }\n                .map { parent: Path? ->\n                    val path =\n                        buildUniquePath(\n                            parent!!,\n                            mimeType,\n                            docName,\n                        )\n                    if (DocumentsContract.Document.MIME_TYPE_DIR == mimeType) {\n                        Files.createDirectory(path)\n                    } else {\n                        Files.createFile(path)\n                    }\n                    val childId = getDocIdForPath(path)\n                    onDocIdChanged(childId)\n                    updateMediaStore(context, path)\n                    childId\n                }\n        if (result.isSuccess) {\n            return result.get()\n        } else {\n            Log.e(TAG, \"Failed to create document\", result.failed().get())\n            throw IllegalStateException()\n        }\n    }\n\n    @Throws(FileNotFoundException::class)\n    override fun copyDocument(\n        sourceDocumentId: String,\n        targetParentDocumentId: String,\n    ): String {\n        Log.d(TAG, \"${getPathForId(sourceDocumentId)}\")\n        val result =\n            getPathForId(sourceDocumentId)\n                .flatMap { source: Path ->\n                    getPathForId(targetParentDocumentId).map<String> { parent: Path? ->\n                        val fileName = source.fileName.toString()\n                        val target =\n                            buildUniquePath(\n                                parent!!,\n                                fileName,\n                            )\n                        Log.d(TAG, \"Copying document: $fileName from $source to $parent\")\n\n                        if (Files.isDirectory(source)) {\n                            // Recursive copy\n                            Files.walkFileTree(\n                                source,\n                                object : SimpleFileVisitor<Path>() {\n                                    @Throws(IOException::class)\n                                    override fun preVisitDirectory(\n                                        dir: Path,\n                                        attrs: BasicFileAttributes,\n                                    ): FileVisitResult {\n                                        Log.d(TAG, \"Creating directories: ${target.resolve(dir.relativize(source))}\")\n                                        Files.createDirectories(target.resolve(dir.relativize(source)))\n                                        return FileVisitResult.CONTINUE\n                                    }\n\n                                    @Throws(IOException::class)\n                                    override fun visitFile(\n                                        file: Path,\n                                        attrs: BasicFileAttributes,\n                                    ): FileVisitResult {\n                                        Files.copy(file, target.resolve(file.relativize(source)))\n                                        return FileVisitResult.CONTINUE\n                                    }\n                                },\n                            )\n                        } else {\n                            // Simple copy\n                            Log.d(TAG, \"File.copy document:  $source to $target\")\n                            Files.copy(source, target)\n                        }\n\n                        val context = context\n                        updateMediaStore(context, target)\n\n                        val targetId = getDocIdForPath(target)\n                        onDocIdChanged(targetId)\n                        targetId\n                    }\n                }\n        if (result.isSuccess) {\n            return result.get()\n        } else {\n            Log.e(TAG, \"Failed to copy document\", result.failed().get())\n            throw IllegalStateException()\n        }\n    }\n\n    override fun renameDocument(\n        documentId: String,\n        displayName: String,\n    ): String {\n        val docName = buildValidFileName(displayName)\n        val result =\n            getPathForId(documentId).map { before: Path ->\n                val after = buildUniquePath(before.parent, docName)\n                Files.move(before, after)\n\n                val context = context\n                updateMediaStore(context, before)\n                updateMediaStore(context, after)\n\n                onDocIdChanged(documentId)\n                onDocIdDeleted(documentId)\n\n                val afterId = getDocIdForPath(after)\n                if (TextUtils.equals(documentId, afterId)) {\n                    // Null is used when the source and destination are equal\n                    // according to the Android API specification\n                    return@map null\n                } else {\n                    onDocIdChanged(afterId)\n                    return@map afterId\n                }\n            }\n        if (result.isSuccess) {\n            return result.get()!!\n        } else {\n            Log.e(TAG, \"Failed to rename document\", result.failed().get())\n            throw IllegalStateException()\n        }\n    }\n\n    override fun moveDocument(\n        sourceDocumentId: String,\n        sourceParentDocumentId: String,\n        targetParentDocumentId: String,\n    ): String {\n        val result =\n            getPathForId(sourceDocumentId)\n                .flatMap { before: Path ->\n                    getPathForId(targetParentDocumentId).map { parent: Path ->\n                        val documentName = before.fileName.toString()\n                        val after = parent.resolve(documentName)\n                        Files.move(before, after)\n\n                        val context = context\n                        updateMediaStore(context, before)\n                        updateMediaStore(context, after)\n\n                        onDocIdChanged(sourceDocumentId)\n                        onDocIdDeleted(sourceDocumentId)\n\n                        val afterId = getDocIdForPath(after)\n                        onDocIdChanged(afterId)\n                        afterId\n                    }\n                }\n        if (result.isSuccess) {\n            return result.get()\n        } else {\n            Log.e(TAG, \"Failed to move document\", result.failed().get())\n            throw IllegalStateException()\n        }\n    }\n\n    override fun deleteDocument(documentId: String) {\n        getPathForId(documentId)\n            .map { path: Path ->\n                if (Files.isDirectory(path)) {\n                    deleteContents(path)\n                } else {\n                    Files.deleteIfExists(path)\n                }\n                path\n            }.forEach { path: Path ->\n                onDocIdChanged(documentId)\n                onDocIdDeleted(documentId)\n                updateMediaStore(context, path)\n            }\n    }\n\n    @Throws(FileNotFoundException::class)\n    override fun openDocument(\n        documentId: String,\n        mode: String,\n        signal: CancellationSignal?,\n    ): ParcelFileDescriptor {\n        val result =\n            getPathForId(documentId).map { path: Path ->\n                val pfdMode = ParcelFileDescriptor.parseMode(mode)\n                if (pfdMode == ParcelFileDescriptor.MODE_READ_ONLY) {\n                    return@map ParcelFileDescriptor.open(path.toFile(), pfdMode)\n                } else {\n                    // When finished writing, kick off media scanner\n                    return@map ParcelFileDescriptor.open(\n                        path.toFile(),\n                        pfdMode,\n                        handler,\n                    ) { failure: IOException? ->\n                        onDocIdChanged(documentId)\n                        updateMediaStore(\n                            context,\n                            path,\n                        )\n                    }\n                }\n            }\n        if (result.isFailure) {\n            Log.e(TAG, \"Failed to open document $documentId\", result.failed().get())\n            throw FileNotFoundException(\"Couldn't open $documentId\")\n        }\n        return result.get()\n    }\n\n    @Throws(FileNotFoundException::class)\n    override fun queryDocument(\n        documentId: String,\n        projection: Array<String?>?,\n    ): Cursor {\n        val result = MatrixCursor(resolveProjection(projection))\n        includePath(result, documentId)\n        return result\n    }\n\n    @Throws(FileNotFoundException::class)\n    override fun queryChildDocuments(\n        parentDocumentId: String,\n        projection: Array<String?>?,\n        sortOrder: String?,\n    ): Cursor {\n        val parentTry = getPathForId(parentDocumentId)\n        if (parentTry.isFailure) {\n            throw FileNotFoundException(\"Couldn't find $parentDocumentId\")\n        }\n        val parent = parentTry.get()\n        val result: MatrixCursor =\n            DirectoryCursor(\n                resolveProjection(projection),\n                parentDocumentId,\n                parent,\n            )\n        if (Files.isDirectory(parent)) {\n            Try.from<Any?> {\n                Files.list(parent).forEach { file: Path -> includePath(result, file) }\n                null\n            }\n        } else {\n            Log.w(TAG, \"$parentDocumentId: not a directory\")\n        }\n        return result\n    }\n\n    override fun findDocumentPath(\n        parentDocumentId: String?,\n        childDocumentId: String,\n    ): DocumentsContract.Path {\n        val pathStr =\n            if (parentDocumentId == null) {\n                childDocumentId\n            } else {\n                childDocumentId.substring(parentDocumentId.length)\n            }\n\n        val segments =\n            listOf(\n                *pathStr\n                    .split(\"/\".toRegex())\n                    .dropLastWhile { it.isEmpty() }\n                    .toTypedArray(),\n            )\n        return DocumentsContract.Path(parentDocumentId, segments)\n    }\n\n    @Throws(FileNotFoundException::class)\n    override fun getDocumentType(documentId: String): String {\n        val pathTry = getPathForId(documentId)\n        if (pathTry.isFailure) {\n            throw FileNotFoundException(\"Can't find $documentId\")\n        }\n        return getDocumentType(documentId, pathTry.get())\n    }\n\n    @Throws(FileNotFoundException::class)\n    override fun openDocumentThumbnail(\n        docId: String,\n        sizeHint: Point,\n        signal: CancellationSignal,\n    ): AssetFileDescriptor {\n        val pathTry =\n            getPathForId(docId)\n                .filter { path: Path? -> getDocumentType(docId, path).startsWith(\"image/\") }\n                .map { path: Path ->\n                    val pfd =\n                        ParcelFileDescriptor.open(\n                            path.toFile(),\n                            ParcelFileDescriptor.MODE_READ_ONLY,\n                        )\n                    val exif = ExifInterface(path.toFile().absolutePath)\n\n                    val thumb = exif.thumbnailRange\n                    if (thumb == null) {\n                        // Do full file decoding, we don't need to handle the orientation\n                        return@map AssetFileDescriptor(\n                            pfd,\n                            0,\n                            AssetFileDescriptor.UNKNOWN_LENGTH,\n                            null,\n                        )\n                    } else {\n                        // If we use thumb to decode, we need to handle the rotation by ourselves.\n                        var extras: Bundle? = null\n                        when (exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, -1)) {\n                            ExifInterface.ORIENTATION_ROTATE_90 -> {\n                                extras = Bundle(1)\n                                extras.putInt(DocumentsContract.EXTRA_ORIENTATION, 90)\n                            }\n\n                            ExifInterface.ORIENTATION_ROTATE_180 -> {\n                                extras = Bundle(1)\n                                extras.putInt(DocumentsContract.EXTRA_ORIENTATION, 180)\n                            }\n\n                            ExifInterface.ORIENTATION_ROTATE_270 -> {\n                                extras = Bundle(1)\n                                extras.putInt(DocumentsContract.EXTRA_ORIENTATION, 270)\n                            }\n                        }\n                        return@map AssetFileDescriptor(pfd, thumb[0], thumb[1], extras)\n                    }\n                }\n        if (pathTry.isFailure) {\n            throw FileNotFoundException(\"Couldn't open $docId\")\n        }\n        return pathTry.get()\n    }\n\n    @SuppressLint(\"NewApi\")\n    @Throws(FileNotFoundException::class)\n    override fun querySearchDocuments(\n        rootId: String,\n        projection: Array<String?>?,\n        queryArgs: Bundle,\n    ): Cursor? {\n        val result =\n            getPathForId(rootId)\n                .filter { _: Path? -> Build.VERSION.SDK_INT > 29 }\n                .map { path: Path? -> querySearchDocuments(path, projection, queryArgs) }\n        if (result.isFailure) {\n            throw FileNotFoundException()\n        }\n        return result.get()\n    }\n\n    @RequiresApi(29)\n    protected fun querySearchDocuments(\n        parent: Path?,\n        projection: Array<String?>?,\n        queryArgs: Bundle?,\n    ): Cursor {\n        val result = MatrixCursor(resolveProjection(projection))\n        val count = AtomicInteger(MAX_QUERY_RESULTS)\n        Try.from<Path> {\n            Files.walkFileTree(\n                parent,\n                object : SimpleFileVisitor<Path>() {\n                    @Throws(IOException::class)\n                    override fun visitFile(\n                        file: Path,\n                        attrs: BasicFileAttributes,\n                    ): FileVisitResult {\n                        if (matchSearchQueryArguments(file, queryArgs)) {\n                            includePath(result, file)\n                        }\n                        return if (count.decrementAndGet() == 0\n                        ) {\n                            FileVisitResult.TERMINATE\n                        } else {\n                            FileVisitResult.CONTINUE\n                        }\n                    }\n\n                    @Throws(IOException::class)\n                    override fun preVisitDirectory(\n                        dir: Path,\n                        attrs: BasicFileAttributes,\n                    ): FileVisitResult {\n                        if (matchSearchQueryArguments(dir, queryArgs)) {\n                            includePath(result, dir)\n                        }\n                        return if (count.decrementAndGet() == 0\n                        ) {\n                            FileVisitResult.TERMINATE\n                        } else {\n                            FileVisitResult.CONTINUE\n                        }\n                    }\n                },\n            )\n        }\n        return result\n    }\n\n    override fun isChildDocument(\n        parentDocumentId: String,\n        documentId: String,\n    ): Boolean = documentId.contains(parentDocumentId)\n\n    /**\n     * Callback indicating that the given document has been modified. This gives the provider a hook\n     * to invalidate cached data, such as `sdcardfs`.\n     */\n    protected abstract fun onDocIdChanged(docId: String?)\n\n    /**\n     * Callback indicating that the given document has been deleted or moved. This gives the\n     * provider a hook to revoke the uri permissions.\n     */\n    protected abstract fun onDocIdDeleted(docId: String?)\n\n    protected open fun isNotEssential(path: Path?): Boolean = true\n\n    @Throws(FileNotFoundException::class)\n    protected fun includePath(\n        result: MatrixCursor,\n        docId: String,\n    ): RowBuilder {\n        val pathTry = getPathForId(docId)\n        if (pathTry.isFailure) {\n            throw FileNotFoundException(\"Couldn't find $docId\")\n        }\n        return includePath(result, pathTry.get(), docId)\n    }\n\n    protected fun includePath(\n        result: MatrixCursor,\n        path: Path,\n        docId: String? = getDocIdForPath(path),\n    ): RowBuilder {\n        val columns = result.columnNames\n        val row = result.newRow()\n\n        val mimeType =\n            getDocumentType(\n                docId!!,\n                path,\n            )\n        row.add(DocumentsContract.Document.COLUMN_DOCUMENT_ID, docId)\n        row.add(DocumentsContract.Document.COLUMN_MIME_TYPE, mimeType)\n\n        val flagIndex = indexOf(columns, DocumentsContract.Document.COLUMN_FLAGS)\n        if (flagIndex != -1) {\n            var flags = 0\n            if (Files.isWritable(path)) {\n                if (DocumentsContract.Document.MIME_TYPE_DIR == mimeType) {\n                    flags = flags or DocumentsContract.Document.FLAG_DIR_SUPPORTS_CREATE\n                    if (isNotEssential(path)) {\n                        flags = flags or DocumentsContract.Document.FLAG_SUPPORTS_WRITE\n                        flags = flags or DocumentsContract.Document.FLAG_SUPPORTS_DELETE\n                        flags = flags or DocumentsContract.Document.FLAG_SUPPORTS_RENAME\n                        flags = flags or DocumentsContract.Document.FLAG_SUPPORTS_COPY\n                        flags = flags or DocumentsContract.Document.FLAG_SUPPORTS_MOVE\n                        Log.d(TAG, \"Flag $flags for: $path\")\n                    }\n                } else {\n                    flags = flags or DocumentsContract.Document.FLAG_SUPPORTS_WRITE\n                    flags = flags or DocumentsContract.Document.FLAG_SUPPORTS_DELETE\n                    flags = flags or DocumentsContract.Document.FLAG_SUPPORTS_RENAME\n                    flags = flags or DocumentsContract.Document.FLAG_SUPPORTS_COPY\n                    flags = flags or DocumentsContract.Document.FLAG_SUPPORTS_MOVE\n                    Log.d(TAG, \"Flag $flags for: $path\")\n                }\n            }\n\n            if (mimeType.startsWith(\"image/\")) {\n                flags = flags or DocumentsContract.Document.FLAG_SUPPORTS_THUMBNAIL\n            }\n            row.add(DocumentsContract.Document.COLUMN_FLAGS, flags)\n        }\n\n        val displayNameIndex = indexOf(columns, DocumentsContract.Document.COLUMN_DISPLAY_NAME)\n        if (displayNameIndex != -1) {\n            row.add(DocumentsContract.Document.COLUMN_DISPLAY_NAME, path.fileName.toString())\n        }\n\n        val lastModifiedIndex = indexOf(columns, DocumentsContract.Document.COLUMN_LAST_MODIFIED)\n        if (lastModifiedIndex != -1) {\n            Try\n                .from { Files.getLastModifiedTime(path) }\n                .map { obj: FileTime -> obj.toMillis() } // Only publish dates reasonably after epoch\n                .filter { lastModified: Long -> lastModified > 31536000000L }\n                .forEach { lastModified: Long? ->\n                    row.add(\n                        DocumentsContract.Document.COLUMN_LAST_MODIFIED,\n                        lastModified,\n                    )\n                }\n        }\n\n        val sizeIndex = indexOf(columns, DocumentsContract.Document.COLUMN_SIZE)\n        if (sizeIndex != -1) {\n            Try\n                .from { Files.size(path) }\n                .forEach { size: Long? -> row.add(DocumentsContract.Document.COLUMN_SIZE, size) }\n        }\n\n        // Return the row builder just in case any subclass want to add more stuff to it.\n        return row\n    }\n\n    protected abstract fun getPathForId(docId: String?): Try<Path>\n\n    protected abstract fun getDocIdForPath(path: Path?): String\n\n    protected abstract fun buildNotificationUri(docId: String?): Uri\n\n    private fun resolveProjection(projection: Array<String?>?): Array<String?> = ((projection ?: DEFAULT_PROJECTION))\n\n    private fun startObserving(\n        path: Path,\n        notifyUri: Uri,\n        cursor: DirectoryCursor,\n    ) {\n        synchronized(observers) {\n            var observer = observers[path]\n            if (observer == null) {\n                observer =\n                    if (Build.VERSION.SDK_INT >= 29) {\n                        DirectoryObserver(path, cr, notifyUri)\n                    } else {\n                        DirectoryObserver(\n                            path.toFile().absolutePath,\n                            cr,\n                            notifyUri,\n                        )\n                    }\n                observer.startWatching()\n                observers[path] = observer\n            }\n            observer.cursors.add(cursor)\n        }\n    }\n\n    private fun stopObserving(\n        path: Path,\n        cursor: DirectoryCursor,\n    ) {\n        synchronized(observers) {\n            val observer = observers[path] ?: return\n            observer.cursors.remove(cursor)\n            if (observer.cursors.isEmpty()) {\n                observers.remove(path)\n                observer.stopWatching()\n            }\n        }\n    }\n\n    /**\n     * Test if the file matches the query arguments.\n     *\n     * @param path\n     * the file to test\n     * @param queryArgs\n     * the query arguments\n     */\n    @RequiresApi(29)\n    @Throws(IOException::class)\n    private fun matchSearchQueryArguments(\n        path: Path,\n        queryArgs: Bundle?,\n    ): Boolean {\n        if (queryArgs == null) {\n            return true\n        }\n\n        val fileName = path.fileName.toString().lowercase()\n        val argDisplayName =\n            queryArgs.getString(\n                DocumentsContract.QUERY_ARG_DISPLAY_NAME,\n                \"\",\n            )\n        if (argDisplayName.isNotEmpty()) {\n            if (!fileName.contains(argDisplayName.lowercase())) {\n                return false\n            }\n        }\n\n        val argFileSize = queryArgs.getLong(DocumentsContract.QUERY_ARG_FILE_SIZE_OVER, -1)\n        if (argFileSize != -1L && Files.size(path) < argFileSize) {\n            return false\n        }\n\n        val argLastModified =\n            queryArgs\n                .getLong(DocumentsContract.QUERY_ARG_LAST_MODIFIED_AFTER, -1)\n        if (argLastModified != -1L &&\n            Files\n                .getLastModifiedTime(path)\n                .toMillis() < argLastModified\n        ) {\n            return false\n        }\n\n        val argMimeTypes =\n            queryArgs\n                .getStringArray(DocumentsContract.QUERY_ARG_MIME_TYPES)\n        if (!argMimeTypes.isNullOrEmpty()) {\n            val fileMimeType: String?\n            if (Files.isDirectory(path)) {\n                fileMimeType = DocumentsContract.Document.MIME_TYPE_DIR\n            } else {\n                val dotPos = fileName.lastIndexOf('.')\n                if (dotPos < 0) {\n                    return false\n                }\n                val extension = fileName.substring(dotPos + 1)\n                fileMimeType =\n                    Intent.normalizeMimeType(\n                        MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension),\n                    )\n            }\n\n            for (type in argMimeTypes) {\n                if (mimeTypeMatches(fileMimeType, type)) {\n                    return true\n                }\n            }\n            return false\n        }\n        return true\n    }\n\n    private inner class DirectoryCursor(\n        columnNames: Array<String?>,\n        docId: String?,\n        private val path: Path,\n    ) : MatrixCursor(columnNames) {\n        init {\n            val notifyUri = buildNotificationUri(docId)\n            setNotificationUri(cr, notifyUri)\n            startObserving(path, notifyUri, this)\n        }\n\n        fun notifyChanged() {\n            onChange(false)\n        }\n\n        override fun close() {\n            super.close()\n            stopObserving(path, this)\n        }\n    }\n\n    private class DirectoryObserver : FileObserver {\n        private val resolver: ContentResolver?\n        private val notifyUri: Uri\n        val cursors: CopyOnWriteArrayList<DirectoryCursor>\n\n        @Suppress(\"deprecation\")\n        constructor(absolutePath: String?, resolver: ContentResolver?, notifyUri: Uri) : super(\n            absolutePath,\n            NOTIFY_EVENTS,\n        ) {\n            this.resolver = resolver\n            this.notifyUri = notifyUri\n            this.cursors = CopyOnWriteArrayList()\n        }\n\n        @RequiresApi(29)\n        constructor(path: Path, resolver: ContentResolver?, notifyUri: Uri) : super(\n            path.toFile(),\n            NOTIFY_EVENTS,\n        ) {\n            this.resolver = resolver\n            this.notifyUri = notifyUri\n            this.cursors = CopyOnWriteArrayList()\n        }\n\n        override fun onEvent(\n            event: Int,\n            path: String?,\n        ) {\n            if ((event and NOTIFY_EVENTS) != 0) {\n                for (cursor in cursors) {\n                    cursor.notifyChanged()\n                }\n                resolver!!.notifyChange(notifyUri, null, 0)\n            }\n        }\n\n        companion object {\n            private const val NOTIFY_EVENTS = (\n                ATTRIB or CLOSE_WRITE or MOVED_FROM or MOVED_TO\n                    or CREATE or DELETE or DELETE_SELF or MOVE_SELF\n            )\n        }\n    }\n\n    companion object {\n        private const val TAG = \"FileSystemProvider\"\n        private const val MAX_QUERY_RESULTS = 23\n        private val DEFAULT_PROJECTION =\n            arrayOf<String?>(\n                DocumentsContract.Document.COLUMN_DOCUMENT_ID,\n                DocumentsContract.Document.COLUMN_MIME_TYPE,\n                DocumentsContract.Document.COLUMN_DISPLAY_NAME,\n                DocumentsContract.Document.COLUMN_LAST_MODIFIED,\n                DocumentsContract.Document.COLUMN_FLAGS,\n                DocumentsContract.Document.COLUMN_SIZE,\n            )\n\n        @Suppress(\"deprecation\")\n        private fun updateMediaStore(\n            context: Context?,\n            path: Path,\n        ) {\n            val intent =\n                if (!Files.isDirectory(path) &&\n                    path.fileName\n                        .toString()\n                        .endsWith(\"nomedia\")\n                ) {\n                    Intent(\n                        Intent.ACTION_MEDIA_SCANNER_SCAN_FILE,\n                        Uri.fromFile(path.parent.toFile()),\n                    )\n                } else {\n                    Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.fromFile(path.toFile()))\n                }\n            context!!.sendBroadcast(intent)\n        }\n\n        fun mimeTypeMatches(\n            mimeType: String?,\n            filter: String,\n        ): Boolean {\n            if (mimeType == null) {\n                return false\n            }\n\n            val mimeTypeParts =\n                mimeType.split(\"/\".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()\n            val filterParts =\n                filter.split(\"/\".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()\n\n            require(filterParts.size == 2) { \"Ill-formatted MIME type filter. Must be type/subtype\" }\n            require(!(filterParts[0].isEmpty() || filterParts[1].isEmpty())) { \"Ill-formatted MIME type filter. Type or subtype empty\" }\n            if (mimeTypeParts.size != 2) {\n                return false\n            }\n            if (\"*\" != filterParts[0] && filterParts[0] != mimeTypeParts[0]) {\n                return false\n            }\n            return \"*\" == filterParts[1] || filterParts[1] == mimeTypeParts[1]\n        }\n\n        private fun <T> indexOf(\n            array: Array<T>?,\n            target: T,\n        ): Int {\n            if (array == null) {\n                return -1\n            }\n            for (i in array.indices) {\n                if (array[i] == target) {\n                    return i\n                }\n            }\n            return -1\n        }\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/alt/nainapps/aer/documents/provider/PathUtils.kt",
    "content": "/*\n * Copyright (c) 2022 2bllw8\n * SPDX-License-Identifier: GPL-3.0-only\n */\npackage alt.nainapps.aer.documents.provider\n\nimport android.provider.DocumentsContract\nimport android.text.TextUtils\nimport android.webkit.MimeTypeMap\nimport java.io.FileNotFoundException\nimport java.io.IOException\nimport java.nio.file.FileVisitResult\nimport java.nio.file.Files\nimport java.nio.file.Path\nimport java.nio.file.SimpleFileVisitor\nimport java.nio.file.attribute.BasicFileAttributes\nimport java.util.Locale\n\nobject PathUtils {\n    private const val MIME_TYPE_DEFAULT = \"application/octet-stream\"\n\n    /**\n     * Mutate the given filename to make it valid for a FAT filesystem, replacing any invalid\n     * characters with \"_\".\n     *\n     *\n     * Based on `android.os.FileUtils#buildUniqueFile#buildValidFilename`\n     */\n    @JvmStatic\n    fun buildValidFileName(name: String): String {\n        if (TextUtils.isEmpty(name) || \".\" == name) {\n            return \"(invalid)\"\n        }\n\n        val res = StringBuilder(name.length)\n        for (i in 0 until name.length) {\n            val c = name[i]\n            if (isValidFatFilenameChar(c.code)) {\n                res.append(c)\n            } else {\n                res.append('_')\n            }\n        }\n        return res.toString()\n    }\n\n    /**\n     * Generates a unique file name under the given parent directory, keeping any extension intact.\n     *\n     *\n     * Based on `android.os.FileUtils#buildUniqueFile`\n     */\n    @JvmStatic\n    @Throws(FileNotFoundException::class)\n    fun buildUniquePath(parent: Path, displayName: String): Path {\n        val name: String\n        val ext: String?\n\n        // Extract requested extension from display name\n        val lastDot = displayName.lastIndexOf('.')\n        if (lastDot >= 0) {\n            name = displayName.substring(0, lastDot)\n            ext = displayName.substring(lastDot + 1)\n        } else {\n            name = displayName\n            ext = null\n        }\n\n        return buildUniquePathWithExtension(parent, name, ext)\n    }\n\n    /**\n     * Generates a unique file name under the given parent directory. If the display name doesn't\n     * have an extension that matches the requested MIME type, the default extension for that MIME\n     * type is appended. If a file already exists, the name is appended with a numerical value to\n     * make it unique.\n     *\n     *\n     * For example, the display name 'example' with 'text/plain' MIME might produce 'example.txt' or\n     * 'example (1).txt', etc.\n     *\n     *\n     * Based on `android.os.FileUtils#buildUniqueFile#buildUniqueFile`\n     */\n    @JvmStatic\n    @Throws(FileNotFoundException::class)\n    fun buildUniquePath(parent: Path, mimeType: String, displayName: String): Path {\n        val parts = splitFileName(mimeType, displayName)\n        return buildUniquePathWithExtension(parent, parts[0], parts[1])\n    }\n\n    /**\n     * Splits file name into base name and extension. If the display name doesn't have an extension\n     * that matches the requested MIME type, the extension is regarded as a part of filename and\n     * default extension for that MIME type is appended.\n     *\n     *\n     * Based on `android.os.FileUtils#buildUniqueFile#splitFileName`\n     */\n    fun splitFileName(mimeType: String, displayName: String): Array<String> {\n        var name: String\n        var ext: String?\n\n        if (DocumentsContract.Document.MIME_TYPE_DIR == mimeType) {\n            name = displayName\n            ext = null\n        } else {\n            var mimeTypeFromExt: String?\n\n            // Extract requested extension from display name\n            val lastDot = displayName.lastIndexOf('.')\n            if (lastDot >= 0) {\n                name = displayName.substring(0, lastDot)\n                ext = displayName.substring(lastDot + 1)\n                mimeTypeFromExt = MimeTypeMap.getSingleton()\n                    .getMimeTypeFromExtension(ext.lowercase(Locale.getDefault()))\n            } else {\n                name = displayName\n                ext = null\n                mimeTypeFromExt = null\n            }\n\n            if (mimeTypeFromExt == null) {\n                mimeTypeFromExt = MIME_TYPE_DEFAULT\n            }\n            val extFromMimeType =\n                if (MIME_TYPE_DEFAULT == mimeType) {\n                    null\n                } else {\n                    MimeTypeMap.getSingleton().getExtensionFromMimeType(mimeType)\n                }\n\n            if (!(mimeType == mimeTypeFromExt || ext == extFromMimeType)) {\n                // No match; insist that create file matches requested MIME\n                name = displayName\n                ext = extFromMimeType\n            }\n        }\n\n        if (ext == null) {\n            ext = \"\"\n        }\n\n        return arrayOf(name, ext)\n    }\n\n    /**\n     * Recursively delete a directory.\n     */\n    @JvmStatic\n    @Throws(IOException::class)\n    fun deleteContents(path: Path?) {\n        Files.walkFileTree(path, object : SimpleFileVisitor<Path>() {\n            @Throws(IOException::class)\n            override fun postVisitDirectory(dir: Path, exc: IOException): FileVisitResult {\n                Files.deleteIfExists(dir)\n                return FileVisitResult.CONTINUE\n            }\n\n            @Throws(IOException::class)\n            override fun visitFile(file: Path, attrs: BasicFileAttributes): FileVisitResult {\n                Files.delete(file)\n                return FileVisitResult.CONTINUE\n            }\n        })\n    }\n\n    /**\n     * Get the mime-type of a given path document.\n     */\n    @JvmStatic\n    fun getDocumentType(documentId: String, path: Path?): String {\n        if (Files.isDirectory(path)) {\n            return DocumentsContract.Document.MIME_TYPE_DIR\n        } else {\n            val lastDot = documentId.lastIndexOf('.')\n            if (lastDot >= 0) {\n                val extension = documentId.substring(lastDot + 1).lowercase(Locale.getDefault())\n                val mime = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension)\n                if (mime != null) {\n                    return mime\n                }\n            }\n            return MIME_TYPE_DEFAULT\n        }\n    }\n\n    private fun isValidFatFilenameChar(c: Int): Boolean {\n        if (c in 0x00..0x1f) {\n            return false\n        }\n        return when (c) {\n            '\"'.code, '*'.code, '/'.code, ':'.code, '<'.code, '>'.code, '?'.code, '\\\\'.code, '|'.code, 0x7F -> false\n            else -> true\n        }\n    }\n\n    @Throws(FileNotFoundException::class)\n    private fun buildUniquePathWithExtension(parent: Path, name: String, ext: String?): Path {\n        var path = buildPath(parent, name, ext)\n\n        // If conflicting path, try adding counter suffix\n        var n = 0\n        while (Files.exists(path)) {\n            if (n++ >= 32) {\n                throw FileNotFoundException(\"Failed to create unique file\")\n            }\n            path = buildPath(parent, \"$name ($n)\", ext)\n        }\n\n        return path\n    }\n\n    private fun buildPath(parent: Path, name: String, ext: String?): Path {\n        return if (TextUtils.isEmpty(ext)) {\n            parent.resolve(name)\n        } else {\n            parent.resolve(\"$name.$ext\")\n        }\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/alt/nainapps/aer/documents/receiver/ReceiverActivity.kt",
    "content": "/*\n * Copyright (c) 2022 2bllw8\n * SPDX-License-Identifier: GPL-3.0-only\n */\npackage alt.nainapps.aer.documents.receiver\n\nimport android.app.Activity\nimport android.app.AlertDialog\nimport android.app.Dialog\nimport android.content.ContentResolver\nimport android.content.DialogInterface\nimport android.content.Intent\nimport android.net.Uri\nimport android.os.Bundle\nimport android.provider.DocumentsContract\nimport android.provider.OpenableColumns\nimport android.util.Log\nimport alt.nainapps.aer.R\nimport alt.nainapps.aer.documents.home.HomeEnvironment\nimport alt.nainapps.aer.task.TaskExecutor\nimport exe.bbllw8.either.Try\nimport java.util.Optional\nimport java.util.concurrent.atomic.AtomicReference\n\nclass ReceiverActivity : Activity() {\n    private val taskExecutor = TaskExecutor()\n    private val dialogRef = AtomicReference(\n        Optional.empty<Dialog>()\n    )\n    private val importRef = AtomicReference<Optional<Uri>>(\n        Optional.empty()\n    )\n\n\n    private var contentResolver: ContentResolver? = null\n\n    override fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n\n        contentResolver = getContentResolver()\n\n        val intent = intent\n        if (intent == null || Intent.ACTION_SEND != intent.action) {\n            Log.e(TAG, \"Nothing to do\")\n            finish()\n            return\n        }\n\n        val type = intent.type\n        if (type == null) {\n            Log.e(TAG, \"Can't determine type of sent content\")\n            finish()\n            return\n        }\n\n        val source = intent.getParcelableExtra<Uri>(Intent.EXTRA_STREAM)!!\n        importRef.set(Optional.of(source))\n\n        val pickerIntent = Intent(Intent.ACTION_CREATE_DOCUMENT).setType(type)\n            .putExtra(\n                Intent.EXTRA_TITLE,\n                getFileName(source).orElse(getString(R.string.receiver_default_file_name))\n            )\n            .putExtra(\n                DocumentsContract.EXTRA_INITIAL_URI,\n                DocumentsContract.buildRootsUri(HomeEnvironment.AUTHORITY)\n            )\n        startActivityForResult(pickerIntent, DOCUMENT_PICKER_REQ_CODE)\n    }\n\n    override fun onDestroy() {\n        dialogRef.getAndSet(null)!!.ifPresent { obj: Dialog -> obj.dismiss() }\n        importRef.set(null)\n        taskExecutor.terminate()\n        super.onDestroy()\n    }\n\n    override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent) {\n        if (requestCode == DOCUMENT_PICKER_REQ_CODE) {\n            if (resultCode == RESULT_OK) {\n                doImport(data.data)\n            } else {\n                Log.d(TAG, \"Action canceled\")\n                finish()\n            }\n        } else {\n            super.onActivityResult(requestCode, resultCode, data)\n        }\n    }\n\n    private fun doImport(destination: Uri?) {\n        val sourceOpt = importRef.get()\n        // No Optional#isEmpty() in android\n        // noinspection SimplifyOptionalCallChains\n        if (!sourceOpt!!.isPresent) {\n            Log.e(TAG, \"Nothing to import\")\n            return\n        }\n        val source = sourceOpt.get()\n\n        onImportStarted()\n        taskExecutor.runTask({ copyUriToUri(source, destination) }, { result: Try<Void?> ->\n            result\n                .forEach(\n                    { success: Void? -> onImportSucceeded() },\n                    { failure: Throwable? -> onImportFailed() })\n        })\n    }\n\n    private fun onImportStarted() {\n        val dialog: Dialog = AlertDialog.Builder(this, R.style.DialogTheme)\n            .setMessage(getString(R.string.receiver_importing_message))\n            .setCancelable(false)\n            .create()\n        dialogRef.getAndSet(Optional.of(dialog))!!\n            .ifPresent { obj: Dialog -> obj.dismiss() }\n    }\n\n    private fun onImportSucceeded() {\n        val dialog: Dialog = AlertDialog.Builder(this, R.style.DialogTheme)\n            .setMessage(getString(R.string.receiver_importing_done_ok))\n            .setPositiveButton(android.R.string.ok) { d: DialogInterface, which: Int -> d.dismiss() }\n            .setOnDismissListener { d: DialogInterface? -> finish() }\n            .create()\n        dialogRef.getAndSet(Optional.of(dialog))!!\n            .ifPresent { obj: Dialog -> obj.dismiss() }\n        dialog.show()\n    }\n\n    private fun onImportFailed() {\n        val dialog: Dialog = AlertDialog.Builder(this, R.style.DialogTheme)\n            .setMessage(getString(R.string.receiver_importing_done_fail))\n            .setPositiveButton(android.R.string.ok) { d: DialogInterface, which: Int -> d.dismiss() }\n            .setOnDismissListener { d: DialogInterface? -> finish() }\n            .create()\n        dialogRef.getAndSet(Optional.of(dialog))!!\n            .ifPresent { obj: Dialog -> obj.dismiss() }\n        dialog.show()\n    }\n\n    private fun copyUriToUri(source: Uri, destination: Uri?): Try<Void?> {\n        return Try.from {\n            contentResolver!!.openInputStream(source).use { iStream ->\n                contentResolver!!.openOutputStream(\n                    destination!!\n                ).use { oStream ->\n                    val buffer = ByteArray(4096)\n                    assert(iStream != null)\n                    var read = iStream!!.read(buffer)\n                    while (read > 0) {\n                        assert(oStream != null)\n                        oStream!!.write(buffer, 0, read)\n                        read = iStream.read(buffer)\n                    }\n                }\n            }\n            null\n        }\n    }\n\n    private fun getFileName(uri: Uri?): Optional<String> {\n        contentResolver!!.query(uri!!, NAME_PROJECTION, null, null, null).use { cursor ->\n            if (cursor == null || !cursor.moveToFirst()) {\n                return Optional.empty()\n            } else {\n                val nameIndex = cursor.getColumnIndex(NAME_PROJECTION[0])\n                if (nameIndex >= 0) {\n                    val name = cursor.getString(nameIndex)\n                    return Optional.ofNullable(name)\n                } else {\n                    return Optional.empty()\n                }\n            }\n        }\n    }\n\n    companion object {\n        private const val TAG = \"ReceiverActivity\"\n        private const val DOCUMENT_PICKER_REQ_CODE = 7\n        private val NAME_PROJECTION = arrayOf(OpenableColumns.DISPLAY_NAME)\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/alt/nainapps/aer/lock/AutoLockJobService.kt",
    "content": "/*\n * Copyright (c) 2021 2bllw8\n * SPDX-License-Identifier: GPL-3.0-only\n */\npackage alt.nainapps.aer.lock\n\nimport android.app.job.JobParameters\nimport android.app.job.JobService\nimport android.widget.Toast\nimport alt.nainapps.aer.R\n\nclass AutoLockJobService : JobService() {\n    override fun onStartJob(params: JobParameters?): Boolean {\n        val lockStore = LockStore.getInstance(applicationContext)\n        if (lockStore != null) {\n            if (!lockStore.isLocked) {\n                lockStore.lock()\n                Toast.makeText(this, getString(R.string.tile_auto_lock), Toast.LENGTH_LONG).show()\n            }\n        }\n        return false\n    }\n\n    override fun onStopJob(params: JobParameters?): Boolean {\n        return false\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/alt/nainapps/aer/lock/LockStore.kt",
    "content": "/*\n * Copyright (c) 2021 2bllw8\n * Copyright (c) 2024 nain\n * SPDX-License-Identifier: GPL-3.0-only\n */\npackage alt.nainapps.aer.lock\n\nimport android.app.job.JobInfo\nimport android.app.job.JobScheduler\nimport android.content.ComponentName\nimport android.content.Context\nimport android.content.SharedPreferences\nimport android.content.SharedPreferences.OnSharedPreferenceChangeListener\nimport android.hardware.biometrics.BiometricManager\nimport android.os.Build\nimport android.util.Log\nimport java.security.MessageDigest\nimport java.security.NoSuchAlgorithmException\nimport java.util.Optional\nimport java.util.function.Consumer\nimport kotlin.concurrent.Volatile\n\nclass LockStore private constructor(context: Context) : OnSharedPreferenceChangeListener {\n    private val preferences: SharedPreferences\n    private val listeners: MutableList<Consumer<Boolean>> = ArrayList()\n    private val biometricManager: BiometricManager?\n\n    private val jobScheduler: JobScheduler\n    private val autoLockComponent: ComponentName\n\n    init {\n        preferences = context.getSharedPreferences(LOCK_PREFERENCES, Context.MODE_PRIVATE)\n        preferences.registerOnSharedPreferenceChangeListener(this)\n\n        jobScheduler = context.getSystemService(JobScheduler::class.java)\n        biometricManager = if (Build.VERSION.SDK_INT >= 29\n        ) context.getSystemService(BiometricManager::class.java)\n        else null\n        autoLockComponent = ComponentName(context, AutoLockJobService::class.java)\n    }\n\n    @Throws(Throwable::class)\n    protected fun finalize() {\n        preferences.unregisterOnSharedPreferenceChangeListener(this)\n        cancelAutoLock()\n    }\n\n    override fun onSharedPreferenceChanged(\n        sharedPreferences: SharedPreferences,\n        key: String?\n    ) {\n        if (KEY_LOCK == key) {\n            onLockChanged()\n        }\n    }\n\n    @get:Synchronized\n    val isLocked: Boolean\n        get() = preferences.getBoolean(KEY_LOCK, DEFAULT_LOCK_VALUE)\n\n    @Synchronized\n    fun lock() {\n        preferences.edit().putBoolean(KEY_LOCK, true).apply()\n        cancelAutoLock()\n    }\n\n    @Synchronized\n    fun unlock() {\n        preferences.edit().putBoolean(KEY_LOCK, false).apply()\n        if (isAutoLockEnabled) {\n            scheduleAutoLock()\n        }\n    }\n\n    @Synchronized\n    fun setPassword(password: String): Boolean {\n        return hashString(password).map { hashedPwd: String? ->\n            preferences.edit().putString(KEY_PASSWORD, hashedPwd).apply()\n            hashedPwd\n        }.isPresent\n    }\n\n    @Synchronized\n    fun passwordMatch(password: String): Boolean {\n        return hashString(password)\n            .map { hashedPwd: String -> hashedPwd == preferences.getString(KEY_PASSWORD, null) }\n            .orElse(false)\n    }\n\n    @Synchronized\n    fun hasPassword(): Boolean {\n        return preferences.getString(KEY_PASSWORD, null) != null\n    }\n\n    @Synchronized\n    fun removePassword() {\n        preferences.edit().remove(KEY_PASSWORD).apply()\n    }\n\n    @get:Synchronized\n    @set:Synchronized\n    var isAutoLockEnabled: Boolean\n        get() = preferences.getBoolean(KEY_AUTO_LOCK, DEFAULT_AUTO_LOCK_VALUE)\n        set(enabled) {\n            preferences.edit().putBoolean(KEY_AUTO_LOCK, enabled).apply()\n\n            if (!isLocked) {\n                if (enabled) {\n                    // If auto-lock is enabled while the storage is unlocked, schedule the job\n                    scheduleAutoLock()\n                } else {\n                    // If auto-lock is disabled while the storage is unlocked, cancel the job\n                    cancelAutoLock()\n                }\n            }\n        }\n\n    @get:Synchronized\n    @set:Synchronized\n    var autoLockDelayMinutes: Long\n        get() = preferences.getLong(KEY_AUTO_LOCK_DELAY_MINUTES, DEFAULT_AUTO_LOCK_DELAY_MINUTES)\n        set(delayMinutes) {\n            preferences.edit().putLong(KEY_AUTO_LOCK_DELAY_MINUTES, delayMinutes).apply()\n\n            if (!isLocked) {\n                if (isAutoLockEnabled) {\n                    // If auto-lock is enabled while the storage is unlocked, schedule new job\n                    cancelAutoLock()\n                    scheduleAutoLock()\n                }\n            }\n        }\n\n    fun canAuthenticateBiometric(): Boolean {\n        return Build.VERSION.SDK_INT >= 29 && biometricManager != null && biometricManager.canAuthenticate() == BiometricManager.BIOMETRIC_SUCCESS\n    }\n\n    @get:Synchronized\n    @set:Synchronized\n    var isBiometricUnlockEnabled: Boolean\n        get() = canAuthenticateBiometric() && preferences.getBoolean(KEY_BIOMETRIC_UNLOCK, false)\n        set(enabled) {\n            preferences.edit().putBoolean(KEY_BIOMETRIC_UNLOCK, enabled).apply()\n        }\n\n    fun addListener(listener: Consumer<Boolean>) {\n        synchronized(listeners) {\n            listeners.add(listener)\n        }\n    }\n\n    fun removeListener(listener: Consumer<Boolean>) {\n        synchronized(listeners) {\n            listeners.remove(listener)\n        }\n    }\n\n    private fun onLockChanged() {\n        val newValue = preferences.getBoolean(KEY_LOCK, DEFAULT_LOCK_VALUE)\n        listeners.forEach(Consumer { listener: Consumer<Boolean> -> listener.accept(newValue) })\n    }\n\n    private fun scheduleAutoLock() {\n        jobScheduler.schedule(\n            JobInfo.Builder(AUTO_LOCK_JOB_ID, autoLockComponent)\n                .setMinimumLatency(millisFromMinutes(autoLockDelayMinutes))\n                .build()\n        )\n    }\n\n    private fun cancelAutoLock() {\n        jobScheduler.cancel(AUTO_LOCK_JOB_ID)\n    }\n\n    private fun hashString(string: String): Optional<String> {\n        try {\n            val digest = MessageDigest.getInstance(HASH_ALGORITHM)\n            digest.update(string.toByteArray())\n            return Optional.of(String(digest.digest()))\n        } catch (e: NoSuchAlgorithmException) {\n            Log.e(TAG, \"Couldn't get hash\", e)\n            return Optional.empty()\n        }\n    }\n\n    // convert minutes to milliseconds\n    private fun millisFromMinutes(minutes: Long): Long {\n        return minutes * 60L * 1000L\n    }\n\n    companion object {\n        private const val TAG = \"LockStore\"\n\n        private const val LOCK_PREFERENCES = \"lock_store\"\n        private const val KEY_LOCK = \"is_locked\"\n        private const val KEY_PASSWORD = \"password_hash\"\n        private const val KEY_AUTO_LOCK = \"auto_lock\"\n        private const val KEY_AUTO_LOCK_DELAY_MINUTES = \"auto_lock_delay_minutes\"\n        private const val KEY_BIOMETRIC_UNLOCK = \"biometric_unlock\"\n        private const val DEFAULT_LOCK_VALUE = false\n        private const val DEFAULT_AUTO_LOCK_VALUE = false\n        private const val DEFAULT_AUTO_LOCK_DELAY_MINUTES = 15L\n\n        private const val HASH_ALGORITHM = \"SHA-256\"\n\n        private const val AUTO_LOCK_JOB_ID = 64\n\n        @Volatile\n        private var instance: LockStore? = null\n\n        @JvmStatic\n        fun getInstance(context: Context): LockStore? {\n            if (instance == null) {\n                synchronized(LockStore::class.java) {\n                    if (instance == null) {\n                        instance = LockStore(context.applicationContext)\n                    }\n                }\n            }\n            return instance\n        }\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/alt/nainapps/aer/lock/LockTileService.kt",
    "content": "/*\n * Copyright (c) 2021 2bllw8\n * SPDX-License-Identifier: GPL-3.0-only\n */\npackage alt.nainapps.aer.lock\n\nimport android.content.ComponentName\nimport android.content.Intent\nimport android.content.pm.PackageManager\nimport android.graphics.drawable.Icon\nimport android.os.Build\nimport android.os.IBinder\nimport android.service.quicksettings.Tile\nimport android.service.quicksettings.TileService\nimport alt.nainapps.aer.R\nimport alt.nainapps.aer.lock.LockStore.Companion.getInstance\nimport java.util.function.Consumer\n\nclass LockTileService : TileService() {\n    private var hasUnlockActivity = false\n    private var lockStore: LockStore? = null\n\n    override fun onBind(intent: Intent): IBinder? {\n        lockStore = getInstance(this)\n\n        val status = packageManager\n            .getComponentEnabledSetting(ComponentName(this, UnlockActivity::class.java))\n        hasUnlockActivity = PackageManager.COMPONENT_ENABLED_STATE_DISABLED != status\n\n        return super.onBind(intent)\n    }\n\n    override fun onStartListening() {\n        super.onStartListening()\n\n        initializeTile()\n        updateTile.accept(lockStore!!.isLocked)\n        lockStore!!.addListener(updateTile)\n    }\n\n    override fun onStopListening() {\n        super.onStopListening()\n        lockStore!!.removeListener(updateTile)\n    }\n\n    override fun onClick() {\n        super.onClick()\n\n        if (lockStore!!.isLocked) {\n            if (hasUnlockActivity) {\n                val intent = Intent(this, UnlockActivity::class.java)\n                    .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)\n                startActivityAndCollapse(intent)\n            } else {\n                lockStore!!.unlock()\n            }\n        } else {\n            lockStore!!.lock()\n        }\n    }\n\n    private fun initializeTile() {\n        val tile = qsTile\n        tile.icon = Icon.createWithResource(\n            this,\n            R.drawable.ic_key_tile\n        )\n    }\n\n    private val updateTile = Consumer { isLocked: Boolean ->\n        val tile = qsTile\n        if (isLocked) {\n            tile.label = getString(R.string.tile_unlock)\n            tile.state = Tile.STATE_INACTIVE\n            if (Build.VERSION.SDK_INT >= 30) {\n                tile.stateDescription = getString(R.string.tile_status_locked)\n            }\n        } else {\n            tile.label = getString(R.string.tile_lock)\n            tile.state = Tile.STATE_ACTIVE\n            if (Build.VERSION.SDK_INT >= 30) {\n                tile.stateDescription = getString(R.string.tile_status_unlocked)\n            }\n        }\n        tile.updateTile()\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/alt/nainapps/aer/lock/UnlockActivity.kt",
    "content": "/*\n * Copyright (c) 2022 2bllw8\n * SPDX-License-Identifier: GPL-3.0-only\n */\npackage alt.nainapps.aer.lock\n\nimport alt.nainapps.aer.R\nimport alt.nainapps.aer.config.ConfigurationActivity\nimport alt.nainapps.aer.config.password.PasswordTextListener\nimport alt.nainapps.aer.lock.LockStore.Companion.getInstance\nimport alt.nainapps.aer.shell.LauncherActivity\nimport android.app.Activity\nimport android.content.DialogInterface\nimport android.content.Intent\nimport android.hardware.biometrics.BiometricPrompt\nimport android.os.Bundle\nimport android.os.CancellationSignal\nimport android.view.View\nimport android.widget.Button\nimport android.widget.EditText\nimport android.widget.ImageView\nimport androidx.annotation.RequiresApi\n\nclass UnlockActivity : Activity() {\n    private var lockStore: LockStore? = null\n    private var onUnlocked: Runnable? = null\n\n    override fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n\n        lockStore = getInstance(this)\n        onUnlocked = getOnUnlocked(intent)\n        if (lockStore!!.hasPassword()) {\n            if (lockStore!!.isBiometricUnlockEnabled) {\n                unlockViaBiometricAuthentication()\n            } else {\n                setupUI()\n            }\n        } else {\n            doUnlock()\n        }\n    }\n\n    private fun setupUI() {\n        setContentView(R.layout.password_input)\n        setFinishOnTouchOutside(true)\n\n        val passwordField = findViewById<EditText>(R.id.passwordFieldView)\n        val configBtn = findViewById<ImageView>(R.id.configurationButton)\n        val unlockBtn = findViewById<Button>(R.id.unlockButton)\n        val cancelBtn = findViewById<Button>(R.id.cancelButton)\n\n        passwordField.addTextChangedListener(PasswordTextListener { text: String? ->\n            unlockBtn.isEnabled = passwordField.text.length >= MIN_PASSWORD_LENGTH\n        })\n\n        configBtn.setOnClickListener { v: View? ->\n            startActivity(Intent(this, ConfigurationActivity::class.java))\n            setResult(RESULT_CANCELED)\n            finish()\n        }\n\n        unlockBtn.isEnabled = false\n        unlockBtn.setOnClickListener { v: View? ->\n            val value = passwordField.text.toString()\n            if (lockStore!!.passwordMatch(value)) {\n                doUnlock()\n            } else {\n                passwordField.error = getString(R.string.password_error_wrong)\n            }\n        }\n\n        cancelBtn.setOnClickListener { v: View? ->\n            setResult(RESULT_CANCELED)\n            finish()\n        }\n    }\n\n    private fun doUnlock() {\n        lockStore!!.unlock()\n        onUnlocked!!.run()\n    }\n\n    @RequiresApi(29)\n    private fun unlockViaBiometricAuthentication() {\n        val executor = mainExecutor\n        val cancellationSignal = CancellationSignal()\n        cancellationSignal.setOnCancelListener { this.finish() }\n\n        val prompt = BiometricPrompt.Builder(this)\n            .setTitle(getString(R.string.tile_unlock))\n            .setDescription(getString(R.string.password_input_biometric_message))\n            .setNegativeButton(\n                getString(R.string.password_input_biometric_fallback), executor\n            ) { dialog: DialogInterface?, which: Int -> setupUI() }\n            .build()\n        prompt.authenticate(cancellationSignal, executor,\n            object : BiometricPrompt.AuthenticationCallback() {\n                override fun onAuthenticationSucceeded(\n                    result: BiometricPrompt.AuthenticationResult\n                ) {\n                    doUnlock()\n                }\n\n                override fun onAuthenticationFailed() {\n                    setResult(RESULT_CANCELED)\n                    finish()\n                }\n            })\n    }\n\n    private fun getOnUnlocked(intent: Intent): Runnable {\n        return if (intent.getBooleanExtra(OPEN_AFTER_UNLOCK, false)) {\n            Runnable {\n                startActivity(\n                    Intent(\n                        this,\n                        LauncherActivity::class.java\n                    )\n                )\n                setResult(RESULT_OK)\n                finish()\n            }\n        } else {\n            Runnable {\n                setResult(RESULT_OK)\n                finish()\n            }\n        }\n    }\n\n    companion object {\n        const val OPEN_AFTER_UNLOCK: String = \"open_after_unlock\"\n        private const val MIN_PASSWORD_LENGTH = 4\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/alt/nainapps/aer/shell/AnemoShell.kt",
    "content": "/*\n * Copyright (c) 2022 2bllw8\n * SPDX-License-Identifier: GPL-3.0-only\n */\npackage alt.nainapps.aer.shell\n\nimport android.content.ComponentName\nimport android.content.Context\nimport android.content.pm.PackageManager\n\nobject AnemoShell {\n    fun isEnabled(context: Context): Boolean {\n        val packageManager = context.packageManager\n        val status = packageManager\n            .getComponentEnabledSetting(ComponentName(context, LauncherActivity::class.java))\n        return PackageManager.COMPONENT_ENABLED_STATE_DISABLED > status\n    }\n\n    fun setEnabled(context: Context, enabled: Boolean) {\n        val packageManager = context.packageManager\n        val newStatus = if (enabled\n        ) PackageManager.COMPONENT_ENABLED_STATE_ENABLED\n        else PackageManager.COMPONENT_ENABLED_STATE_DISABLED\n        packageManager.setComponentEnabledSetting(\n            ComponentName(context, LauncherActivity::class.java), newStatus,\n            PackageManager.DONT_KILL_APP\n        )\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/alt/nainapps/aer/shell/LauncherActivity.kt",
    "content": "/*\n * Copyright (c) 2022 2bllw8\n * SPDX-License-Identifier: GPL-3.0-only\n */\npackage alt.nainapps.aer.shell\n\nimport android.app.Activity\nimport android.content.Intent\nimport android.content.pm.PackageManager\nimport android.net.Uri\nimport android.os.Bundle\nimport android.provider.DocumentsContract\nimport android.widget.Toast\nimport alt.nainapps.aer.R\nimport alt.nainapps.aer.documents.home.HomeEnvironment\nimport alt.nainapps.aer.lock.LockStore\nimport alt.nainapps.aer.lock.UnlockActivity\nimport java.util.Arrays\n\nclass LauncherActivity : Activity() {\n    private val LAUNCHER_INTENTS = arrayOf(\n        // AOSP, up to Android 11\n        Intent(Intent.ACTION_VIEW, ANEMO_URI).setClassName(\n            DOCUMENTS_UI_PACKAGE,\n            DOCUMENTS_UI_ACTIVITY\n        ),\n        Intent(Intent.ACTION_VIEW, ANEMO_URI).setClassName(\n            DOCUMENTS_UI_PACKAGE,\n            DOCUMENTS_UI_ALIAS_ACTIVITY\n        ),  // Pixels, Android 12+\n        Intent(Intent.ACTION_VIEW, ANEMO_URI).setClassName(\n            GOOGLE_DOCUMENTS_UI_PACKAGE,\n            DOCUMENTS_UI_ACTIVITY\n        ),  // Android 13+\n        Intent(Intent.ACTION_VIEW, ANEMO_URI).setType(TYPE_DOCS_DIRECTORY)\n            .setFlags(\n                Intent.FLAG_ACTIVITY_FORWARD_RESULT\n                        or Intent.FLAG_ACTIVITY_PREVIOUS_IS_TOP\n            ),\n    )\n\n    override fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n\n        if (LockStore.getInstance(this)?.isLocked == true) {\n            startActivity(\n                Intent(this, UnlockActivity::class.java)\n                    .putExtra(UnlockActivity.OPEN_AFTER_UNLOCK, true)\n            )\n        } else {\n            val pm = packageManager\n            val fileIntent = Arrays.stream(LAUNCHER_INTENTS)\n                .filter { intent: Intent -> canHandle(pm, intent) }\n                .findAny()\n            if (fileIntent.isPresent) {\n                startActivity(fileIntent.get())\n                overridePendingTransition(0, 0)\n            } else {\n                Toast.makeText(this, R.string.launcher_no_activity, Toast.LENGTH_LONG).show()\n            }\n        }\n        finish()\n    }\n\n    private fun canHandle(pm: PackageManager, intent: Intent): Boolean {\n        return pm.resolveActivity(intent, PackageManager.MATCH_ALL) != null\n    }\n\n    companion object {\n        // https://cs.android.com/android/platform/superproject/+/master:packages/apps/DocumentsUI/AndroidManifest.xml\n        private const val DOCUMENTS_UI_PACKAGE = \"com.android.documentsui\"\n        private const val DOCUMENTS_UI_ACTIVITY = (DOCUMENTS_UI_PACKAGE\n                + \".files.FilesActivity\")\n        private const val DOCUMENTS_UI_ALIAS_ACTIVITY = (DOCUMENTS_UI_PACKAGE\n                + \".FilesActivity\")\n        private const val GOOGLE_DOCUMENTS_UI_PACKAGE = \"com.google.android.documentsui\"\n        private const val TYPE_DOCS_DIRECTORY = \"vnd.android.document/directory\"\n        private val ANEMO_URI: Uri = DocumentsContract.buildRootsUri(HomeEnvironment.AUTHORITY)\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/alt/nainapps/aer/task/TaskExecutor.java",
    "content": "/*\n * Copyright (c) 2021 2bllw8\n * SPDX-License-Identifier: GPL-3.0-only\n */\npackage alt.nainapps.aer.task;\n\nimport android.os.Handler;\nimport android.os.Looper;\nimport android.util.Log;\n\nimport androidx.annotation.MainThread;\nimport androidx.annotation.WorkerThread;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.concurrent.Callable;\nimport java.util.concurrent.ExecutionException;\nimport java.util.concurrent.ExecutorService;\nimport java.util.concurrent.Executors;\nimport java.util.concurrent.Future;\nimport java.util.concurrent.TimeUnit;\nimport java.util.concurrent.TimeoutException;\nimport java.util.function.Consumer;\n\npublic final class TaskExecutor {\n    private static final String TAG = \"TaskExecutor\";\n\n    private final ExecutorService executor = Executors.newFixedThreadPool(2);\n    private final Handler handler = new Handler(Looper.getMainLooper());\n    private final List<Future<?>> execFutures = new ArrayList<>(4);\n\n    public synchronized <T> void runTask(@WorkerThread Callable<T> callable,\n            @MainThread Consumer<T> consumer) {\n        final Future<T> future = executor.submit(callable);\n        execFutures.add(future);\n        try {\n            final T result = future.get(1, TimeUnit.MINUTES);\n            // It's completed, remove to free memory\n            execFutures.remove(future);\n            // Post result\n            handler.post(() -> consumer.accept(result));\n        } catch (InterruptedException e) {\n            Log.w(TAG, e);\n        } catch (ExecutionException | TimeoutException e) {\n            throw new RuntimeException(\"An error occurred while executing task\", e.getCause());\n        }\n    }\n\n    public void terminate() {\n        executor.shutdown();\n        if (hasUnfinishedTasks()) {\n            try {\n                if (!executor.awaitTermination(250, TimeUnit.MILLISECONDS)) {\n                    executor.shutdownNow();\n                    //@formatter:off\n                    //noinspection ResultOfMethodCallIgnored\n                    executor.awaitTermination(100, TimeUnit.MILLISECONDS);\n                    //@formatter:on\n                }\n            } catch (InterruptedException e) {\n                Log.e(TAG, \"Interrupted\", e);\n                // (Re-)Cancel if current thread also interrupted\n                executor.shutdownNow();\n                // Preserve interrupt status\n                Thread.currentThread().interrupt();\n            }\n        }\n    }\n\n    private boolean hasUnfinishedTasks() {\n        for (final Future<?> future : execFutures) {\n            if (!future.isDone()) {\n                return true;\n            }\n        }\n        return false;\n    }\n}\n"
  },
  {
    "path": "app/src/main/res/color/btn_colored_text.xml",
    "content": "<!-- Copyright (C) 2015 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n\n          http://www.apache.org/licenses/LICENSE-2.0\n\n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n\n<!-- Used for the text of a bordered colored button. -->\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item android:alpha=\"?android:attr/disabledAlpha\" android:color=\"?android:attr/colorAccent\" android:state_enabled=\"false\" />\n    <item android:color=\"?android:attr/colorAccent\" />\n</selector>\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_configuration.xml",
    "content": "<!--\n  ~ Copyright (c) 2022 2bllw8\n  ~ SPDX-License-Identifier: GPL-3.0-only\n  -->\n<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"24dp\"\n    android:height=\"24dp\"\n    android:autoMirrored=\"true\"\n    android:tint=\"?android:textColorPrimary\"\n    android:viewportWidth=\"24\"\n    android:viewportHeight=\"24\">\n    <path\n        android:fillColor=\"@android:color/white\"\n        android:pathData=\"M19.43,12.98c0.04,-0.32 0.07,-0.64 0.07,-0.98s-0.03,-0.66 -0.07,-0.98l2.11,-1.65c0.19,-0.15 0.24,-0.42 0.12,-0.64l-2,-3.46c-0.12,-0.22 -0.39,-0.3 -0.61,-0.22l-2.49,1c-0.52,-0.4 -1.08,-0.73 -1.69,-0.98l-0.38,-2.65C14.46,2.18 14.25,2 14,2h-4c-0.25,0 -0.46,0.18 -0.49,0.42l-0.38,2.65c-0.61,0.25 -1.17,0.59 -1.69,0.98l-2.49,-1c-0.23,-0.09 -0.49,0 -0.61,0.22l-2,3.46c-0.13,0.22 -0.07,0.49 0.12,0.64l2.11,1.65c-0.04,0.32 -0.07,0.65 -0.07,0.98s0.03,0.66 0.07,0.98l-2.11,1.65c-0.19,0.15 -0.24,0.42 -0.12,0.64l2,3.46c0.12,0.22 0.39,0.3 0.61,0.22l2.49,-1c0.52,0.4 1.08,0.73 1.69,0.98l0.38,2.65c0.03,0.24 0.24,0.42 0.49,0.42h4c0.25,0 0.46,-0.18 0.49,-0.42l0.38,-2.65c0.61,-0.25 1.17,-0.59 1.69,-0.98l2.49,1c0.23,0.09 0.49,0 0.61,-0.22l2,-3.46c0.12,-0.22 0.07,-0.49 -0.12,-0.64l-2.11,-1.65zM12,15.5c-1.93,0 -3.5,-1.57 -3.5,-3.5s1.57,-3.5 3.5,-3.5 3.5,1.57 3.5,3.5 -1.57,3.5 -3.5,3.5z\" />\n</vector>\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_error.xml",
    "content": "<!--\n  ~ Copyright (c) 2023 2bllw8\n  ~ SPDX-License-Identifier: GPL-3.0-only\n  -->\n<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"24dp\"\n    android:height=\"24dp\"\n    android:tint=\"?android:colorError\"\n    android:viewportWidth=\"24\"\n    android:viewportHeight=\"24\">\n    <path\n        android:fillColor=\"@android:color/white\"\n        android:pathData=\"M11,15h2v2h-2zM11,7h2v6h-2zM11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM12,20c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8z\" />\n</vector>\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_key_tile.xml",
    "content": "<!--\n  ~ Copyright (c) 2021 2bllw8\n  ~ SPDX-License-Identifier: GPL-3.0-only\n  -->\n<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"48dp\"\n    android:height=\"48dp\"\n    android:viewportWidth=\"24\"\n    android:viewportHeight=\"24\">\n    <path\n        android:fillColor=\"@android:color/white\"\n        android:pathData=\"M4,10A1,1 0,0 1,3 9A1,1 0,0 1,4 8H12A2,2 0,0 0,14 6A2,2 0,0 0,12 4C11.45,4 10.95,4.22 10.59,4.59C10.2,5 9.56,5 9.17,4.59C8.78,4.2 8.78,3.56 9.17,3.17C9.9,2.45 10.9,2 12,2A4,4 0,0 1,16 6A4,4 0,0 1,12 10H4M19,12A1,1 0,0 0,20 11A1,1 0,0 0,19 10C18.72,10 18.47,10.11 18.29,10.29C17.9,10.68 17.27,10.68 16.88,10.29C16.5,9.9 16.5,9.27 16.88,8.88C17.42,8.34 18.17,8 19,8A3,3 0,0 1,22 11A3,3 0,0 1,19 14H5A1,1 0,0 1,4 13A1,1 0,0 1,5 12H19M18,18H4A1,1 0,0 1,3 17A1,1 0,0 1,4 16H18A3,3 0,0 1,21 19A3,3 0,0 1,18 22C17.17,22 16.42,21.66 15.88,21.12C15.5,20.73 15.5,20.1 15.88,19.71C16.27,19.32 16.9,19.32 17.29,19.71C17.47,19.89 17.72,20 18,20A1,1 0,0 0,19 19A1,1 0,0 0,18 18Z\" />\n</vector>\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_launcher_foreground.xml",
    "content": "<!--\n  ~ Copyright (c) 2021 2bllw8\n  ~ SPDX-License-Identifier: GPL-3.0-only\n  -->\n<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"108dp\"\n    android:height=\"108dp\"\n    android:viewportWidth=\"108\"\n    android:viewportHeight=\"108\">\n  <group\n      android:scaleX=\"2.178\"\n      android:scaleY=\"2.178\"\n      android:translateX=\"26.896\"\n      android:translateY=\"27.864\">\n    <path\n        android:fillColor=\"@color/launcher_foreground\"\n        android:pathData=\"M4,10A1,1 0,0 1,3 9A1,1 0,0 1,4 8H12A2,2 0,0 0,14 6A2,2 0,0 0,12 4C11.45,4 10.95,4.22 10.59,4.59C10.2,5 9.56,5 9.17,4.59C8.78,4.2 8.78,3.56 9.17,3.17C9.9,2.45 10.9,2 12,2A4,4 0,0 1,16 6A4,4 0,0 1,12 10H4M19,12A1,1 0,0 0,20 11A1,1 0,0 0,19 10C18.72,10 18.47,10.11 18.29,10.29C17.9,10.68 17.27,10.68 16.88,10.29C16.5,9.9 16.5,9.27 16.88,8.88C17.42,8.34 18.17,8 19,8A3,3 0,0 1,22 11A3,3 0,0 1,19 14H5A1,1 0,0 1,4 13A1,1 0,0 1,5 12H19M18,18H4A1,1 0,0 1,3 17A1,1 0,0 1,4 16H18A3,3 0,0 1,21 19A3,3 0,0 1,18 22C17.17,22 16.42,21.66 15.88,21.12C15.5,20.73 15.5,20.1 15.88,19.71C16.27,19.32 16.9,19.32 17.29,19.71C17.47,19.89 17.72,20 18,20A1,1 0,0 0,19 19A1,1 0,0 0,18 18Z\" />\n  </group>\n</vector>\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_launcher_monochrome.xml",
    "content": "<!--\n  ~ Copyright (c) 2022 2bllw8\n  ~ SPDX-License-Identifier: GPL-3.0-only\n  -->\n<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"108dp\"\n    android:height=\"108dp\"\n    android:viewportWidth=\"108\"\n    android:viewportHeight=\"108\">\n  <group\n      android:scaleX=\"2.178\"\n      android:scaleY=\"2.178\"\n      android:translateX=\"26.896\"\n      android:translateY=\"27.864\">\n    <path\n        android:fillColor=\"#000000\"\n        android:pathData=\"M4,10A1,1 0,0 1,3 9A1,1 0,0 1,4 8H12A2,2 0,0 0,14 6A2,2 0,0 0,12 4C11.45,4 10.95,4.22 10.59,4.59C10.2,5 9.56,5 9.17,4.59C8.78,4.2 8.78,3.56 9.17,3.17C9.9,2.45 10.9,2 12,2A4,4 0,0 1,16 6A4,4 0,0 1,12 10H4M19,12A1,1 0,0 0,20 11A1,1 0,0 0,19 10C18.72,10 18.47,10.11 18.29,10.29C17.9,10.68 17.27,10.68 16.88,10.29C16.5,9.9 16.5,9.27 16.88,8.88C17.42,8.34 18.17,8 19,8A3,3 0,0 1,22 11A3,3 0,0 1,19 14H5A1,1 0,0 1,4 13A1,1 0,0 1,5 12H19M18,18H4A1,1 0,0 1,3 17A1,1 0,0 1,4 16H18A3,3 0,0 1,21 19A3,3 0,0 1,18 22C17.17,22 16.42,21.66 15.88,21.12C15.5,20.73 15.5,20.1 15.88,19.71C16.27,19.32 16.9,19.32 17.29,19.71C17.47,19.89 17.72,20 18,20A1,1 0,0 0,19 19A1,1 0,0 0,18 18Z\" />\n  </group>\n</vector>\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_shortcut_configuration.xml",
    "content": "<!--\n  ~ Copyright (c) 2022 2bllw8\n  ~ SPDX-License-Identifier: GPL-3.0-only\n  -->\n<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"24dp\"\n    android:height=\"24dp\"\n    android:autoMirrored=\"true\"\n    android:tint=\"@color/launcher_background\"\n    android:viewportWidth=\"24\"\n    android:viewportHeight=\"24\">\n    <path\n        android:fillColor=\"@android:color/white\"\n        android:pathData=\"M19.43,12.98c0.04,-0.32 0.07,-0.64 0.07,-0.98s-0.03,-0.66 -0.07,-0.98l2.11,-1.65c0.19,-0.15 0.24,-0.42 0.12,-0.64l-2,-3.46c-0.12,-0.22 -0.39,-0.3 -0.61,-0.22l-2.49,1c-0.52,-0.4 -1.08,-0.73 -1.69,-0.98l-0.38,-2.65C14.46,2.18 14.25,2 14,2h-4c-0.25,0 -0.46,0.18 -0.49,0.42l-0.38,2.65c-0.61,0.25 -1.17,0.59 -1.69,0.98l-2.49,-1c-0.23,-0.09 -0.49,0 -0.61,0.22l-2,3.46c-0.13,0.22 -0.07,0.49 0.12,0.64l2.11,1.65c-0.04,0.32 -0.07,0.65 -0.07,0.98s0.03,0.66 0.07,0.98l-2.11,1.65c-0.19,0.15 -0.24,0.42 -0.12,0.64l2,3.46c0.12,0.22 0.39,0.3 0.61,0.22l2.49,-1c0.52,0.4 1.08,0.73 1.69,0.98l0.38,2.65c0.03,0.24 0.24,0.42 0.49,0.42h4c0.25,0 0.46,-0.18 0.49,-0.42l0.38,-2.65c0.61,-0.25 1.17,-0.59 1.69,-0.98l2.49,1c0.23,0.09 0.49,0 0.61,-0.22l2,-3.46c0.12,-0.22 0.07,-0.49 -0.12,-0.64l-2.11,-1.65zM12,15.5c-1.93,0 -3.5,-1.57 -3.5,-3.5s1.57,-3.5 3.5,-3.5 3.5,1.57 3.5,3.5 -1.57,3.5 -3.5,3.5z\" />\n</vector>\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_storage.xml",
    "content": "<!--\n  ~ Copyright (c) 2021 2bllw8\n  ~ SPDX-License-Identifier: GPL-3.0-only\n  -->\n<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"24dp\"\n    android:height=\"24dp\"\n    android:viewportWidth=\"24\"\n    android:viewportHeight=\"24\">\n  <path\n      android:fillColor=\"@color/anemo_accent\"\n      android:pathData=\"M4,10A1,1 0,0 1,3 9A1,1 0,0 1,4 8H12A2,2 0,0 0,14 6A2,2 0,0 0,12 4C11.45,4 10.95,4.22 10.59,4.59C10.2,5 9.56,5 9.17,4.59C8.78,4.2 8.78,3.56 9.17,3.17C9.9,2.45 10.9,2 12,2A4,4 0,0 1,16 6A4,4 0,0 1,12 10H4M19,12A1,1 0,0 0,20 11A1,1 0,0 0,19 10C18.72,10 18.47,10.11 18.29,10.29C17.9,10.68 17.27,10.68 16.88,10.29C16.5,9.9 16.5,9.27 16.88,8.88C17.42,8.34 18.17,8 19,8A3,3 0,0 1,22 11A3,3 0,0 1,19 14H5A1,1 0,0 1,4 13A1,1 0,0 1,5 12H19M18,18H4A1,1 0,0 1,3 17A1,1 0,0 1,4 16H18A3,3 0,0 1,21 19A3,3 0,0 1,18 22C17.17,22 16.42,21.66 15.88,21.12C15.5,20.73 15.5,20.1 15.88,19.71C16.27,19.32 16.9,19.32 17.29,19.71C17.47,19.89 17.72,20 18,20A1,1 0,0 0,19 19A1,1 0,0 0,18 18Z\" />\n</vector>\n"
  },
  {
    "path": "app/src/main/res/layout/configuration.xml",
    "content": "<!--\n  ~ Copyright (c) 2022 2bllw8\n  ~ Copyright (c) 2024 nain\n  ~ SPDX-License-Identifier: GPL-3.0-only\n  -->\n<ScrollView xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\">\n\n    <LinearLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:orientation=\"vertical\"\n        android:paddingVertical=\"8dp\">\n\n        <Switch\n            android:id=\"@+id/configuration_show_shortcut\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:foreground=\"?android:attr/selectableItemBackground\"\n            android:minHeight=\"56dp\"\n            android:paddingHorizontal=\"16dp\"\n            android:text=\"@string/configuration_shortcut\"\n            android:textSize=\"16sp\" />\n\n        <TextView\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_marginTop=\"16dp\"\n            android:paddingHorizontal=\"16dp\"\n            android:text=\"@string/configuration_protection\"\n            android:textColor=\"?android:attr/colorAccent\" />\n\n        <TextView\n            android:id=\"@+id/configuration_lock\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:foreground=\"?android:attr/selectableItemBackground\"\n            android:gravity=\"center_vertical\"\n            android:minHeight=\"56dp\"\n            android:paddingHorizontal=\"16dp\"\n            android:textColor=\"?android:textColorPrimary\"\n            android:textSize=\"16sp\"\n            tools:text=\"@string/configuration_storage_lock\" />\n\n        <TextView\n            android:id=\"@+id/configuration_password_set\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:foreground=\"?android:attr/selectableItemBackground\"\n            android:gravity=\"center_vertical\"\n            android:minHeight=\"56dp\"\n            android:paddingHorizontal=\"16dp\"\n            android:textColor=\"?android:textColorPrimary\"\n            android:textSize=\"16sp\"\n            tools:text=\"@string/configuration_password_set\" />\n\n        <Switch\n            android:id=\"@+id/configuration_biometric_unlock\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:foreground=\"?android:attr/selectableItemBackground\"\n            android:minHeight=\"56dp\"\n            android:paddingHorizontal=\"16dp\"\n            android:text=\"@string/configuration_storage_unlock_biometric\"\n            android:textSize=\"16sp\" />\n\n        <Switch\n            android:id=\"@+id/configuration_auto_lock\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:foreground=\"?android:attr/selectableItemBackground\"\n            android:minHeight=\"56dp\"\n            android:paddingHorizontal=\"16dp\"\n            android:text=\"@string/configuration_storage_lock_auto\"\n            android:textSize=\"16sp\" />\n\n        <LinearLayout\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\"\n            android:orientation=\"horizontal\">\n\n            <TextView\n                android:id=\"@+id/configuration_auto_lock_delay_label\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:labelFor=\"@+id/config_auto_lock_delay_minutes\"\n                android:paddingHorizontal=\"16dp\"\n                android:text=\"@string/configuration_auto_lock_delay_minutes_label\"\n                android:textColor=\"?android:textColorPrimary\"\n                android:textSize=\"16sp\"\n                tools:text=\"@string/configuration_auto_lock_delay_minutes_label\" />\n\n            <EditText\n                android:id=\"@+id/config_auto_lock_delay_minutes\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:autofillHints=\"autoLockDelayMinutes\"\n                android:minHeight=\"56dp\"\n                android:minEms=\"3\"\n                android:maxEms=\"5\"\n                android:inputType=\"number\" />\n        </LinearLayout>\n\n\n    </LinearLayout>\n</ScrollView>\n"
  },
  {
    "path": "app/src/main/res/layout/password_change.xml",
    "content": "<!--\n  ~ Copyright (c) 2021 2bllw8\n  ~ SPDX-License-Identifier: GPL-3.0-only\n  -->\n<ScrollView xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\">\n\n    <LinearLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:orientation=\"vertical\"\n        android:paddingHorizontal=\"?android:attr/dialogPreferredPadding\"\n        android:paddingTop=\"6dp\">\n\n        <TextView\n            style=\"@android:style/TextAppearance.Material.Body1\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_marginBottom=\"12dp\"\n            android:text=\"@string/password_change_message\"\n            android:textColor=\"?android:attr/textColorSecondary\" />\n\n        <TextView\n            style=\"@android:style/TextAppearance.Material.Caption\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:labelFor=\"@id/currentFieldView\"\n            android:text=\"@string/password_hint_current\" />\n\n        <EditText\n            android:id=\"@+id/currentFieldView\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_marginBottom=\"12dp\"\n            android:importantForAutofill=\"no\"\n            android:inputType=\"textPassword\"\n            android:maxLength=\"128\"\n            android:maxLines=\"1\"\n            android:singleLine=\"true\" />\n\n        <TextView\n            style=\"@android:style/TextAppearance.Material.Caption\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:labelFor=\"@id/passwordFieldView\"\n            android:text=\"@string/password_hint_field\" />\n\n        <EditText\n            android:id=\"@+id/passwordFieldView\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_marginBottom=\"12dp\"\n            android:importantForAutofill=\"no\"\n            android:inputType=\"textPassword\"\n            android:maxLength=\"128\"\n            android:maxLines=\"1\"\n            android:singleLine=\"true\" />\n\n        <TextView\n            style=\"@android:style/TextAppearance.Material.Caption\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:labelFor=\"@id/repeatFieldView\"\n            android:text=\"@string/password_hint_repeat\" />\n\n        <EditText\n            android:id=\"@+id/repeatFieldView\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_marginBottom=\"12dp\"\n            android:importantForAutofill=\"no\"\n            android:inputType=\"textPassword\"\n            android:maxLength=\"128\"\n            android:maxLines=\"1\"\n            android:singleLine=\"true\" />\n    </LinearLayout>\n</ScrollView>\n"
  },
  {
    "path": "app/src/main/res/layout/password_first_set.xml",
    "content": "<!--\n  ~ Copyright (c) 2021 2bllw8\n  ~ SPDX-License-Identifier: GPL-3.0-only\n  -->\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\"\n    android:paddingHorizontal=\"?android:attr/dialogPreferredPadding\"\n    android:paddingTop=\"6dp\">\n\n    <TextView\n        style=\"@android:style/TextAppearance.Material.Body1\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginBottom=\"12dp\"\n        android:text=\"@string/password_set_message\"\n        android:textColor=\"?android:attr/textColorSecondary\" />\n\n    <TextView\n        style=\"@android:style/TextAppearance.Material.Caption\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:labelFor=\"@id/passwordFieldView\"\n        android:text=\"@string/password_hint_field\" />\n\n    <EditText\n        android:id=\"@+id/passwordFieldView\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginBottom=\"12dp\"\n        android:importantForAutofill=\"no\"\n        android:inputType=\"textPassword\"\n        android:maxLength=\"128\"\n        android:maxLines=\"1\"\n        android:singleLine=\"true\" />\n\n    <TextView\n        style=\"@android:style/TextAppearance.Material.Caption\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:labelFor=\"@id/repeatFieldView\"\n        android:text=\"@string/password_hint_repeat\" />\n\n    <EditText\n        android:id=\"@+id/repeatFieldView\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginBottom=\"12dp\"\n        android:importantForAutofill=\"no\"\n        android:inputType=\"textPassword\"\n        android:maxLength=\"128\"\n        android:maxLines=\"1\"\n        android:singleLine=\"true\" />\n</LinearLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/password_input.xml",
    "content": "<!--\n  ~ Copyright (c) 2021 2bllw8\n  ~ SPDX-License-Identifier: GPL-3.0-only\n  -->\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\"\n    android:paddingHorizontal=\"?android:attr/dialogPreferredPadding\"\n    android:paddingTop=\"?android:attr/dialogPreferredPadding\"\n    android:paddingBottom=\"6dp\">\n\n    <FrameLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginBottom=\"12dp\">\n\n        <TextView\n            style=\"@android:style/TextAppearance.Material.WindowTitle\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"@string/tile_unlock\" />\n\n        <ImageView\n            android:id=\"@+id/configurationButton\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"end|center_vertical\"\n            android:contentDescription=\"@string/configuration_label\"\n            android:foreground=\"?android:attr/selectableItemBackgroundBorderless\"\n            android:src=\"@drawable/ic_configuration\"\n            android:tooltipText=\"@string/configuration_label\" />\n    </FrameLayout>\n\n    <TextView\n        style=\"@android:style/TextAppearance.Material.Body1\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginBottom=\"12dp\"\n        android:text=\"@string/password_input_message\"\n        android:textColor=\"?android:attr/textColorSecondary\" />\n\n    <TextView\n        style=\"@android:style/TextAppearance.Material.Caption\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:labelFor=\"@id/passwordFieldView\"\n        android:text=\"@string/password_hint_field\" />\n\n    <EditText\n        android:id=\"@+id/passwordFieldView\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginBottom=\"12dp\"\n        android:importantForAutofill=\"no\"\n        android:inputType=\"textPassword\"\n        android:maxLength=\"128\"\n        android:maxLines=\"1\"\n        android:singleLine=\"true\" />\n\n    <LinearLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:gravity=\"end|center_vertical\"\n        android:orientation=\"horizontal\">\n\n        <Button\n            android:id=\"@+id/cancelButton\"\n            style=\"@android:style/Widget.DeviceDefault.Button.Borderless.Small\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"@android:string/cancel\"\n            android:textColor=\"@color/btn_colored_text\" />\n\n        <Button\n            android:id=\"@+id/unlockButton\"\n            style=\"@android:style/Widget.DeviceDefault.Button.Borderless.Small\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"@string/password_input_action\"\n            android:textColor=\"@color/btn_colored_text\" />\n    </LinearLayout>\n</LinearLayout>\n"
  },
  {
    "path": "app/src/main/res/mipmap-anydpi/ic_launcher.xml",
    "content": "<!--\n  ~ Copyright (c) 2021 2bllw8\n  ~ SPDX-License-Identifier: GPL-3.0-only\n  -->\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <background android:drawable=\"@color/launcher_background\" />\n    <foreground android:drawable=\"@drawable/ic_launcher_foreground\" />\n    <monochrome android:drawable=\"@drawable/ic_launcher_monochrome\" />\n</adaptive-icon>\n"
  },
  {
    "path": "app/src/main/res/values/colors.xml",
    "content": "<!--\n  ~ Copyright (c) 2021 2bllw8\n  ~ SPDX-License-Identifier: GPL-3.0-only\n  -->\n<resources>\n    <color name=\"anemo_primary\">#f0f0f0</color>\n    <color name=\"anemo_primary_dark\">#f0f0f0</color>\n    <color name=\"anemo_accent\">@color/launcher_background</color>\n\n    <color name=\"launcher_background\">#2196F3</color>\n    <color name=\"launcher_foreground\">#F9EBF0</color>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/strings.xml",
    "content": "<!--\n  ~ Copyright (c) 2021 2bllw8\n  ~ SPDX-License-Identifier: GPL-3.0-only\n  -->\n<resources>\n    <string name=\"app_name\">Aer</string>\n\n    <string name=\"anemo_description\">Local private storage</string>\n    <string name=\"anemo_info\">Files in Aer storage are not directly accessible to other apps.\\n\\nNote that Aer is in development 🏗️. Accidents happen. Please keeps backups 👷‍♀️ for your protection.</string>\n    <string name=\"anemo_error\">Prior to Android 11, external storage is readily visible to other apps. Prefer Internal storage for better privacy.</string>\n\n    <string name=\"password_label\">Aer password</string>\n\n    <string name=\"password_hint_field\">Password</string>\n    <string name=\"password_hint_repeat\">Type again to confirm</string>\n    <string name=\"password_hint_current\">Current password</string>\n\n    <string name=\"password_error_length\">The password should have length at least %1$d</string>\n    <string name=\"password_error_mismatch\">The passwords do not match</string>\n    <string name=\"password_error_wrong\">Wrong password</string>\n\n    <string name=\"password_input_message\">Type your Aer password to unlock the Aer Storage</string>\n    <string name=\"password_input_action\">Unlock</string>\n    <string name=\"password_input_biometric_message\">Authenticate to unlock the Aer Storage</string>\n    <string name=\"password_input_biometric_fallback\">Use password</string>\n\n    <string name=\"password_set_title\">Add password protection</string>\n    <string name=\"password_set_message\">Set a password to lock the access to the Aer Storage</string>\n    <string name=\"password_set_action\">Set password</string>\n\n    <string name=\"password_change_title\">Change password</string>\n    <string name=\"password_change_message\">Change the password to unlock the Aer Storage</string>\n    <string name=\"password_change_action\">Change</string>\n    <string name=\"password_change_remove\">Remove</string>\n\n    <string name=\"receiver_label\">Import into Aer</string>\n\n    <string name=\"receiver_importing_message\">Importing the file…</string>\n    <string name=\"receiver_importing_done_ok\">Imported to Aer</string>\n    <string name=\"receiver_importing_done_fail\">Could not import the file. Try again</string>\n\n    <string name=\"receiver_default_file_name\">Shared file</string>\n\n    <string name=\"tile_title\">Aer storage</string>\n\n    <string name=\"tile_lock\">Lock Aer</string>\n    <string name=\"tile_unlock\">Unlock Aer</string>\n    <string name=\"tile_status_locked\">Now locked</string>\n    <string name=\"tile_status_unlocked\">Now unlocked</string>\n\n    <string name=\"tile_auto_lock\">Aer storage was automatically locked</string>\n\n    <string name=\"launcher_no_activity\">Can\\'t find system Files app</string>\n    <string name=\"shortcut_config_long\">Access Configuration</string>\n    <string name=\"shortcut_config_short\">Access Config</string>\n    <string name=\"shortcut_config_disabled\">Access Configuration (disabled)</string>\n\n    <string name=\"configuration_label\">Configuration</string>\n    <string name=\"configuration_shortcut\">Show shortcut in app list</string>\n    <string name=\"configuration_protection\">Protection</string>\n    <string name=\"configuration_password_set\">Set password</string>\n    <string name=\"configuration_password_change\">Change password</string>\n    <string name=\"configuration_storage_lock\">Lock storage access</string>\n    <string name=\"configuration_storage_unlock\">Unlock storage access</string>\n    <string name=\"configuration_storage_unlock_biometric\">Allow storage unlock with biometric access</string>\n    <string name=\"configuration_storage_lock_auto\">Automatically lock access after delay</string>\n    <string name=\"title_activity_storage_pref\">StoragePrefActivity</string>\n    <string name=\"shortcut_storageconfig_long\">Storage Configuration</string>\n    <string name=\"shortcut_storageconfig_short\">Storage Config</string>\n    <string name=\"shortcut_storageconfig_disabled\">Storage Config (Disabled)</string>\n    <string name=\"storage_config_select_help\">Tap to select / Drag to reorder:</string>\n    <string name=\"storage_config_screen_title\">Aer Storage Backend</string>\n    <string name=\"configuration_auto_lock_delay_minutes_label\">Auto lock delay (in minutes)</string>\n\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/styles.xml",
    "content": "<!--\n  ~ Copyright (c) 2021 2bllw8\n  ~ SPDX-License-Identifier: GPL-3.0-only\n  -->\n<resources>\n    <style name=\"AppTheme\" parent=\"android:Theme.DeviceDefault.Light\">\n        <item name=\"android:colorAccent\">@color/anemo_accent</item>\n        <item name=\"android:navigationBarColor\">?android:colorPrimary</item>\n        <item name=\"android:statusBarColor\">?android:colorPrimary</item>\n        <item name=\"android:windowLightStatusBar\">true</item>\n    </style>\n\n    <style name=\"DialogTheme\" parent=\"android:Theme.DeviceDefault.Light.Dialog.NoActionBar.MinWidth\">\n        <item name=\"android:colorPrimary\">@color/anemo_primary</item>\n        <item name=\"android:colorPrimaryDark\">@color/anemo_primary_dark</item>\n        <item name=\"android:colorAccent\">@color/anemo_accent</item>\n        <item name=\"android:background\">@null</item>\n    </style>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/themes.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n    <style name=\"Theme.Anemoaer\" parent=\"android:Theme.Material.Light.NoActionBar\" />\n</resources>"
  },
  {
    "path": "app/src/main/res/values-es/strings.xml",
    "content": "<!--\n  ~ Copyright (c) 2021 2bllw8\n  ~ SPDX-License-Identifier: GPL-3.0-only\n  -->\n<resources>\n    <string name=\"app_name\">Aer</string>\n\n    <string name=\"anemo_description\">Almacenamiento privado local</string>\n    <string name=\"anemo_info\">Los archivos almacenados en el almacenamiento de Aer son privados y otras aplicaciones no pueden acceder a ellos sin el consentimiento del usuario.</string>\n\n    <string name=\"password_label\">Contraseña Aer</string>\n\n    <string name=\"password_hint_field\">Contraseña</string>\n    <string name=\"password_hint_repeat\">Escriba de nuevo para confirmar</string>\n    <string name=\"password_hint_current\">Contraseña actual</string>\n\n    <string name=\"password_error_length\">La contraseña debe tener una longitud de al menos %1$d</string>\n    <string name=\"password_error_mismatch\">Las contraseñas no coinciden</string>\n    <string name=\"password_error_wrong\">Contraseña incorrecta</string>\n\n    <string name=\"password_input_message\">Escriba su contraseña de Aer para desbloquear el almacenamiento de Aer</string>\n    <string name=\"password_input_action\">Desbloquear</string>\n\n    <string name=\"password_set_title\">Agregar protección con contraseña</string>\n    <string name=\"password_set_message\">Establezca una contraseña para bloquear el acceso a Aer Storage</string>\n    <string name=\"password_set_action\">Configurar contraseña</string>\n\n    <string name=\"password_change_title\">Cambiar contraseña</string>\n    <string name=\"password_change_message\">Cambiar contraseña para desbloquear Aer Storage</string>\n    <string name=\"password_change_action\">Cambiar</string>\n    <string name=\"password_change_remove\">Eliminar</string>\n\n    <string name=\"receiver_label\">Importar a Aer</string>\n\n    <string name=\"receiver_importing_message\">Importando el archivo…</string>\n    <string name=\"receiver_importing_done_ok\">Importado a Aer</string>\n    <string name=\"receiver_importing_done_fail\">No se pudo importar el archivo. Intentar otra vez</string>\n\n    <string name=\"receiver_default_file_name\">Archivo compartido</string>\n\n    <string name=\"tile_title\">Almacenamiento aer</string>\n\n    <string name=\"tile_lock\">Bloquear Aer</string>\n    <string name=\"tile_unlock\">Desbloquear Aer</string>\n    <string name=\"tile_status_locked\">Ahora bloqueado</string>\n    <string name=\"tile_status_unlocked\">Ahora desbloqueado</string>\n\n    <string name=\"tile_auto_lock\">El almacenamiento de Aer se bloqueó automáticamente</string>\n\n    <string name=\"launcher_no_activity\">No puedo encontrar la aplicación Archivos del sistema</string>\n    <string name=\"shortcut_config_long\">Configuración</string>\n    <string name=\"shortcut_config_short\">Configurar</string>\n    <string name=\"shortcut_config_disabled\">Configuración (deshabilitada)</string>\n\n    <string name=\"configuration_label\">Configuración</string>\n    <string name=\"configuration_shortcut\">Mostrar acceso directo en la lista de aplicaciones</string>\n    <string name=\"configuration_protection\">Proteccion</string>\n    <string name=\"configuration_password_set\">Configurar contraseña</string>\n    <string name=\"configuration_password_change\">Cambiar contraseña</string>\n    <string name=\"configuration_storage_lock\">Bloquear el acceso al almacenamiento</string>\n    <string name=\"configuration_storage_unlock\">Desbloquear el acceso al almacenamiento</string>\n    <string name=\"configuration_storage_lock_auto\">Bloquear automáticamente el acceso después de 15 minutos</string>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values-fr/strings.xml",
    "content": "<!--\n  ~ Copyright (c) 2022 2bllw8\n  ~ SPDX-License-Identifier: GPL-3.0-only\n  -->\n<resources>\n    <string name=\"app_name\">Aer</string>\n\n    <string name=\"anemo_description\">Stockage local privé</string>\n    <string name=\"anemo_info\">Les fichiers stockés dans le stockage Aer sont privés et les autres applications ne peuvent pas y accéder sans le consentement de l\\'utilisateur.</string>\n\n    <string name=\"password_label\">Mot de passe d\\'Aer</string>\n\n    <string name=\"password_hint_field\">Mot de passe</string>\n    <string name=\"password_hint_repeat\">Retaper pour confirmer</string>\n    <string name=\"password_hint_current\">Mot de passe actuel</string>\n\n    <string name=\"password_error_length\">Le mot de passe doit avoir une longueur d\\'au moins %1$d</string>\n    <string name=\"password_error_mismatch\">Les mots de passe ne concordent pas</string>\n    <string name=\"password_error_wrong\">Mot de passe erroné</string>\n\n    <string name=\"password_input_message\">Taper votre mot de passe pour déverrouiller le stockage Aer</string>\n    <string name=\"password_input_action\">Déverrouiller</string>\n\n    <string name=\"password_set_title\">Ajouter un mot de passe par sécurité</string>\n    <string name=\"password_set_message\">Définissez un mot de passe pour verrouiller l\\'accès au stockage Aer.</string>\n    <string name=\"password_set_action\">Définir un mot de passe</string>\n\n    <string name=\"password_change_title\">Modifier le mot de passe</string>\n    <string name=\"password_change_message\">Changez le mot de passe pour déverrouiller le stockage Aer</string>\n    <string name=\"password_change_action\">Modifier</string>\n    <string name=\"password_change_remove\">Supprimer</string>\n\n    <string name=\"receiver_label\">Importer dans Aer</string>\n\n    <string name=\"receiver_importing_message\">Importation de ficher…</string>\n    <string name=\"receiver_importing_done_ok\">Importé dans Aer</string>\n    <string name=\"receiver_importing_done_fail\">Impossible d\\'importer ficher. Réessayer</string>\n\n    <string name=\"receiver_default_file_name\">Ficher partagé</string>\n\n    <string name=\"tile_title\">Stockage Aer</string>\n\n    <string name=\"tile_lock\">Cadenasser Aer</string>\n    <string name=\"tile_unlock\">Décadenasser Aer</string>\n    <string name=\"tile_status_locked\">Verrouillé</string>\n    <string name=\"tile_status_unlocked\">Déverrouillé</string>\n\n    <string name=\"tile_auto_lock\">Le stockage Aer a été verrouillé automatiquement</string>\n\n    <string name=\"launcher_no_activity\">Impossible de trouver l\\'application Fichiers du système</string>\n    <string name=\"shortcut_config_long\">Configuration</string>\n    <string name=\"shortcut_config_short\">Configurer</string>\n    <string name=\"shortcut_config_disabled\">Configuration (désactivé)</string>\n\n    <string name=\"configuration_label\">Préférence</string>\n    <string name=\"configuration_shortcut\">Afficher un raccourci dans la liste des applications</string>\n    <string name=\"configuration_protection\">Sécurité</string>\n    <string name=\"configuration_password_set\">Définir le mot de passe</string>\n    <string name=\"configuration_password_change\">Modifier le mot de passe</string>\n    <string name=\"configuration_storage_lock\">Verrouiller l\\'accès au stockage</string>\n    <string name=\"configuration_storage_unlock\">Déverrouiller l\\'accès au stockage</string>\n    <string name=\"configuration_storage_lock_auto\">Verrouiller automatiquement l\\'accès après 15 minutes</string>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values-it/strings.xml",
    "content": "<!--\n  ~ Copyright (c) 2022 2bllw8\n  ~ SPDX-License-Identifier: GPL-3.0-only\n  -->\n<resources>\n    <string name=\"app_name\">Aer</string>\n\n    <string name=\"anemo_description\">Archiviazione privata locale</string>\n    <string name=\"anemo_info\">I file archiviati nell\\'archivio di Aer sono privati e le altre app non possono accedervi senza il consenso dell\\'utente</string>\n\n    <string name=\"password_label\">Password di Aer</string>\n\n    <string name=\"password_hint_field\">Password</string>\n    <string name=\"password_hint_repeat\">Digita di nuovo per confermare</string>\n    <string name=\"password_hint_current\">Password attuale</string>\n\n    <string name=\"password_error_length\">La password dovrebbe essere lunga almeno %1$d caratteri</string>\n    <string name=\"password_error_mismatch\">Le password non corrispondono</string>\n    <string name=\"password_error_wrong\">Password errata</string>\n\n    <string name=\"password_input_message\">Digita la tua password di Aer per sbloccare l\\'archiviazione</string>\n    <string name=\"password_input_action\">Sblocca</string>\n\n    <string name=\"password_set_title\">Aggiungi la protezione con password</string>\n    <string name=\"password_set_message\">Imposta una password per bloccare l\\'accesso all\\'archiviazione di Aer</string>\n    <string name=\"password_set_action\">Imposta password</string>\n\n    <string name=\"password_change_title\">Modifica password</string>\n    <string name=\"password_change_message\">Modifica la password per sbloccare l\\'archiviazione di Aer</string>\n    <string name=\"password_change_action\">Modifica</string>\n    <string name=\"password_change_remove\">Rimuovi</string>\n\n    <string name=\"receiver_label\">Importa in Aer</string>\n\n    <string name=\"receiver_importing_message\">Importando file…</string>\n    <string name=\"receiver_importing_done_ok\">Importato in Aer</string>\n    <string name=\"receiver_importing_done_fail\">Impossibile importare file. Riprova</string>\n\n    <string name=\"receiver_default_file_name\">File condiviso</string>\n\n    <string name=\"tile_title\">Archiviazione di Aer</string>\n\n    <string name=\"tile_lock\">Blocca Aer</string>\n    <string name=\"tile_unlock\">Sblocca Aer</string>\n    <string name=\"tile_status_locked\">Bloccato</string>\n    <string name=\"tile_status_unlocked\">Sbloccato</string>\n\n    <string name=\"tile_auto_lock\">L\\'archiviazione di Aer è stata bloccata automaticamente</string>\n\n    <string name=\"launcher_no_activity\">Impossibile trovare l\\'app File di sistema</string>\n    <string name=\"shortcut_config_long\">Configurazione</string>\n    <string name=\"shortcut_config_short\">Configura</string>\n    <string name=\"shortcut_config_disabled\">Configurazione (disattivata)</string>\n\n    <string name=\"configuration_label\">Configurazione</string>\n    <string name=\"configuration_shortcut\">Mostra il collegamento nell\\'elenco delle app</string>\n    <string name=\"configuration_protection\">Protezione</string>\n    <string name=\"configuration_password_set\">Imposta password</string>\n    <string name=\"configuration_password_change\">Modifica password</string>\n    <string name=\"configuration_storage_lock\">Blocca l\\'accesso allo spazio di archiviazione</string>\n    <string name=\"configuration_storage_unlock\">Sblocca l\\'accesso allo spazio di archiviazione</string>\n    <string name=\"configuration_storage_lock_auto\">Blocca automaticamente l\\'accesso dopo 15 minuti</string>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values-night/colors.xml",
    "content": "<!--\n  ~ Copyright (c) 2022 2bllw8\n  ~ SPDX-License-Identifier: GPL-3.0-only\n  -->\n<resources>\n    <color name=\"anemo_primary\">#1b1b1b</color>\n    <color name=\"anemo_primary_dark\">#1b1b1b</color>\n    <color name=\"anemo_accent\">#F19D7D</color>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values-night/styles.xml",
    "content": "<!--\n  ~ Copyright (c) 2021 2bllw8\n  ~ SPDX-License-Identifier: GPL-3.0-only\n  -->\n<resources>\n    <style name=\"AppTheme\" parent=\"android:Theme.DeviceDefault\">\n        <item name=\"android:colorPrimary\">@color/anemo_primary</item>\n        <item name=\"android:colorPrimaryDark\">@color/anemo_primary_dark</item>\n        <item name=\"android:colorAccent\">@color/anemo_accent</item>\n    </style>\n\n    <style name=\"DialogTheme\" parent=\"android:Theme.DeviceDefault.Dialog.NoActionBar.MinWidth\">\n        <item name=\"android:colorPrimary\">@color/anemo_primary</item>\n        <item name=\"android:colorPrimaryDark\">@color/anemo_primary_dark</item>\n        <item name=\"android:colorAccent\">@color/anemo_accent</item>\n        <item name=\"android:background\">@null</item>\n    </style>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values-night-v31/colors.xml",
    "content": "<!--\n  ~ Copyright (c) 2022 2bllw8\n  ~ SPDX-License-Identifier: GPL-3.0-only\n  -->\n<resources>\n    <color name=\"anemo_primary\">@android:color/system_neutral1_900</color>\n    <color name=\"anemo_primary_dark\">@android:color/system_neutral1_900</color>\n    <color name=\"anemo_accent\">@android:color/system_accent1_100</color>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values-pt-rBR/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">Aer</string>\n\n    <string name=\"anemo_description\">Armazenamento privado local</string>\n    <string name=\"anemo_info\">Os arquivos no armazenamento do Aer não são diretamente acessíveis a outros aplicativos.\\n\\nObserve que o Aer ainda está em desenvolvimento 🏗️. Acidentes podem acontecer. Por favor, mantenha backups 👷‍♀️ para sua proteção.</string>\n\n    <string name=\"password_label\">Senha do Aer</string>\n\n    <string name=\"password_hint_field\">Senha</string>\n    <string name=\"password_hint_repeat\">Digite novamente para confirmar</string>\n    <string name=\"password_hint_current\">Senha atual</string>\n\n    <string name=\"password_error_length\">A senha deve ter comprimento mínimo de %1$d</string>\n    <string name=\"password_error_mismatch\">As senhas não correspondem</string>\n    <string name=\"password_error_wrong\">Senha incorreta</string>\n\n    <string name=\"password_input_message\">Digite a senha do Aer para desbloquear o Armazenamento do Aer</string>\n    <string name=\"password_input_action\">Desbloquear</string>\n    <string name=\"password_input_biometric_message\">Autentique-se para desbloquear o Armazenamento do Aer</string>\n    <string name=\"password_input_biometric_fallback\">Usar senha</string>\n\n    <string name=\"password_set_title\">Adicionar proteção por senha</string>\n    <string name=\"password_set_message\">Defina uma senha para bloquear o acesso ao Armazenamento do Aer</string>\n    <string name=\"password_set_action\">Definir senha</string>\n\n    <string name=\"password_change_title\">Trocar senha</string>\n    <string name=\"password_change_message\">Troque a senha para desbloquear o Armazenamento do Aer</string>\n    <string name=\"password_change_action\">Trocar</string>\n    <string name=\"password_change_remove\">Remover</string>\n\n    <string name=\"receiver_label\">Importar para o Aer</string>\n\n    <string name=\"receiver_importing_message\">Importando o arquivo…</string>\n    <string name=\"receiver_importing_done_ok\">Importado para o Aer</string>\n    <string name=\"receiver_importing_done_fail\">Não foi possível importar o arquivo. Tente novamente</string>\n\n    <string name=\"receiver_default_file_name\">Arquivo compartilhado</string>\n\n    <string name=\"tile_title\">Armazenamento do Aer</string>\n\n    <string name=\"tile_lock\">Bloquear Aer</string>\n    <string name=\"tile_unlock\">Desbloquear Aer</string>\n    <string name=\"tile_status_locked\">Agora bloqueado</string>\n    <string name=\"tile_status_unlocked\">Agora desbloqueado</string>\n\n    <string name=\"tile_auto_lock\">O armazenamento do Aer foi bloqueado automaticamente</string>\n\n    <string name=\"launcher_no_activity\">Não é possível encontrar o aplicativo Arquivos do sistema</string>\n    <string name=\"shortcut_config_long\">Acessar Configuração</string>\n    <string name=\"shortcut_config_short\">Acessar Config</string>\n    <string name=\"shortcut_config_disabled\">Acessar Configuração (desativado)</string>\n\n    <string name=\"configuration_label\">Configuração</string>\n    <string name=\"configuration_shortcut\">Mostrar atalho na lista de aplicativos</string>\n    <string name=\"configuration_protection\">Proteção</string>\n    <string name=\"configuration_password_set\">Definir senha</string>\n    <string name=\"configuration_password_change\">Trocar senha</string>\n    <string name=\"configuration_storage_lock\">Bloquear acesso ao armazenamento</string>\n    <string name=\"configuration_storage_unlock\">Desbloquear acesso ao armazenamento</string>\n    <string name=\"configuration_storage_unlock_biometric\">Permitir desbloqueio do armazenamento com acesso biométrico</string>\n    <string name=\"configuration_storage_lock_auto\">Bloquear acesso automaticamente após 15 minutos</string>\n    <string name=\"title_activity_storage_pref\">StoragePrefActivity</string>\n    <string name=\"shortcut_storageconfig_long\">Configuração do Armazenamento</string>\n    <string name=\"shortcut_storageconfig_short\">Config do Armazenamento</string>\n    <string name=\"shortcut_storageconfig_disabled\">Config do Armazenamento (desativado)</string>\n    <string name=\"storage_config_select_help\">Toque para selecionar / Arraste para reordenar:</string>\n    <string name=\"storage_config_screen_title\">Backend de Armazenamento do Aer</string>\n\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values-v27/styles.xml",
    "content": "<!--\n  ~ Copyright (c) 2022 2bllw8\n  ~ SPDX-License-Identifier: GPL-3.0-only\n  -->\n<resources>\n    <style name=\"AppTheme\" parent=\"android:Theme.DeviceDefault.Light\">\n        <item name=\"android:colorAccent\">@color/anemo_accent</item>\n        <item name=\"android:navigationBarColor\">?android:colorPrimary</item>\n        <item name=\"android:statusBarColor\">?android:colorPrimary</item>\n        <item name=\"android:windowLightStatusBar\">true</item>\n        <item name=\"android:windowLightNavigationBar\">true</item>\n    </style>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values-v31/colors.xml",
    "content": "<!--\n  ~ Copyright (c) 2021 2bllw8\n  ~ SPDX-License-Identifier: GPL-3.0-only\n  -->\n<resources>\n    <color name=\"anemo_primary\">@android:color/system_neutral1_100</color>\n    <color name=\"anemo_primary_dark\">@android:color/system_neutral1_50</color>\n    <color name=\"anemo_accent\">@android:color/system_accent1_600</color>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/xml/backup_rules.xml",
    "content": "<!--\n  ~ Copyright (c) 2022 2bllw8\n  ~ SPDX-License-Identifier: GPL-3.0-only\n  -->\n<full-backup-content>\n    <include\n        domain=\"sharedpref\"\n        path=\".\" />\n</full-backup-content>\n"
  },
  {
    "path": "app/src/main/res/xml/data_extraction_rules.xml",
    "content": "<!--\n  ~ Copyright (c) 2022 2bllw8\n  ~ SPDX-License-Identifier: GPL-3.0-only\n  -->\n<data-extraction-rules>\n    <cloud-backup>\n        <include\n            domain=\"sharedpref\"\n            path=\".\" />\n    </cloud-backup>\n</data-extraction-rules>\n"
  },
  {
    "path": "app/src/main/res/xml/shortcuts.xml",
    "content": "<!--\n  ~ Copyright (c) 2022 2bllw8\n  ~ SPDX-License-Identifier: GPL-3.0-only\n  -->\n<shortcuts xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <shortcut\n        android:enabled=\"true\"\n        android:icon=\"@drawable/ic_shortcut_configuration\"\n        android:shortcutDisabledMessage=\"@string/shortcut_config_disabled\"\n        android:shortcutId=\"configuration\"\n        android:shortcutLongLabel=\"@string/shortcut_config_long\"\n        android:shortcutShortLabel=\"@string/shortcut_config_short\">\n\n        <intent\n            android:action=\"android.intent.action.VIEW\"\n            android:targetClass=\"alt.nainapps.aer.config.ConfigurationActivity\"\n            android:targetPackage=\"alt.nainapps.aer\" />\n    </shortcut>\n    <shortcut\n        android:enabled=\"true\"\n        android:icon=\"@drawable/ic_shortcut_configuration\"\n        android:shortcutDisabledMessage=\"@string/shortcut_storageconfig_disabled\"\n        android:shortcutId=\"storageconfig\"\n        android:shortcutLongLabel=\"@string/shortcut_storageconfig_long\"\n        android:shortcutShortLabel=\"@string/shortcut_storageconfig_short\">\n\n        <intent\n            android:action=\"alt.nainapps.aer.STORAGE_CONFIG\"\n            android:targetClass=\"alt.nainapps.aer.config.StorageConfigActivityKt\"\n             />\n    </shortcut>\n</shortcuts>\n"
  },
  {
    "path": "build.gradle",
    "content": "/*\n * Copyright (c) 2021 2bllw8\n * SPDX-License-Identifier: GPL-3.0-only\n */\nbuildscript {\n    repositories {\n        gradlePluginPortal()\n        mavenCentral()\n        google()\n    }\n    dependencies {\n        classpath libs.android.gradle.plugin\n        classpath libs.kotlin.gradle.plugin\n    }\n}\n\nplugins {\n    // Existing plugins\n    alias(libs.plugins.compose.compiler) apply false\n    alias(libs.plugins.android.application)  apply false\n    alias(libs.plugins.org.jetbrains.kotlin.android) apply false\n}\n\nallprojects {\n    repositories {\n        mavenCentral()\n        google()\n    }\n}\n\ntasks.register('clean', Delete) {\n    delete rootProject.getLayout().getBuildDirectory()\n}\n\nfinal Properties localProps = new Properties()\nif (file('local.properties').exists()) {\n    localProps.load(file('local.properties').newDataInputStream())\n}\n\next {\n    minSdkVersion = 26\n    targetSdkVersion = 35\n\n    sourceCompatibilityVersion = JavaVersion.VERSION_17\n    targetCompatibilityVersion = JavaVersion.VERSION_17\n\n    keyStoreFile = localProps.getProperty('androidStoreFile')\n    if (keyStoreFile != null && keyStoreFile != '') {\n        keyStoreFile = file(keyStoreFile)\n    }\n    keyStorePassword = localProps.getProperty('androidStorePassword')\n    keyAlias = localProps.getProperty('androidKeyAlias')\n    keyPassword = localProps.getProperty('androidKeyPassword')\n}\n"
  },
  {
    "path": "gradle/libs.versions.toml",
    "content": "[versions]\nannotation = \"1.9.1\"\ncoreKtx = \"1.15.0\"\neitherLib = \"3.4.0\"\nagp = \"8.6.1\"\nkotlin = \"2.0.20\"\nexifinterface = \"1.3.7\"\nlifecycleRuntimeKtx = \"2.8.7\"\nactivityCompose = \"1.9.3\"\ncomposeBom = \"2024.12.01\"\nreorderable = \"2.3.3\"\n\n\n[libraries]\nandroidx-annotation = { module = \"androidx.annotation:annotation\", version.ref = \"annotation\" }\nandroidx-core-ktx = { module = \"androidx.core:core-ktx\", version.ref = \"coreKtx\" }\neitherLib = { module = \"io.github.2bllw8:either\", version.ref = \"eitherLib\" }\nandroid-gradle-plugin = { module = \"com.android.tools.build:gradle\", version.ref = \"agp\" }\nkotlin-gradle-plugin = { module = \"org.jetbrains.kotlin:kotlin-gradle-plugin\", version.ref = \"kotlin\" }\nandroidx-exifinterface = { group = \"androidx.exifinterface\", name = \"exifinterface\", version.ref = \"exifinterface\" }\nandroidx-lifecycle-runtime-ktx = { group = \"androidx.lifecycle\", name = \"lifecycle-runtime-ktx\", version.ref = \"lifecycleRuntimeKtx\" }\nandroidx-activity-compose = { group = \"androidx.activity\", name = \"activity-compose\", version.ref = \"activityCompose\" }\nandroidx-compose-bom = { group = \"androidx.compose\", name = \"compose-bom\", version.ref = \"composeBom\" }\nandroidx-ui = { group = \"androidx.compose.ui\", name = \"ui\" }\nandroidx-ui-graphics = { group = \"androidx.compose.ui\", name = \"ui-graphics\" }\nandroidx-ui-tooling = { group = \"androidx.compose.ui\", name = \"ui-tooling\" }\nandroidx-ui-tooling-preview = { group = \"androidx.compose.ui\", name = \"ui-tooling-preview\" }\nandroidx-ui-test-manifest = { group = \"androidx.compose.ui\", name = \"ui-test-manifest\" }\nandroidx-ui-test-junit4 = { group = \"androidx.compose.ui\", name = \"ui-test-junit4\" }\nandroidx-material3 = { group = \"androidx.compose.material3\", name = \"material3\" }\nreorderable = { module = \"sh.calvin.reorderable:reorderable\", version.ref = \"reorderable\" }\n\n[plugins]\norg-jetbrains-kotlin-android = { id = \"org.jetbrains.kotlin.android\", version.ref = \"kotlin\" }\ncompose-compiler = { id = \"org.jetbrains.kotlin.plugin.compose\", version.ref = \"kotlin\" }\nandroid-application = { id = \"com.android.application\", version.ref = \"agp\" }\n"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "content": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-8.7-bin.zip\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "gradle.properties",
    "content": "#\n# Copyright (c) 2021 2bllw8\n# SPDX-License-Identifier: GPL-3.0-only\n#\n\n## For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n#\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\n# Default value: -Xmx1024m -XX:MaxPermSize=256m\n# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\n#\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true\nandroid.nonFinalResIds=false\nandroid.nonTransitiveRClass=true\nandroid.useAndroidX=true\norg.gradle.jvmargs=\\\n  --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \\\n  --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \\\n  --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \\\n  --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \\\n  --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED\n"
  },
  {
    "path": "gradlew",
    "content": "#!/bin/sh\n\n#\n# Copyright 2015-2021 the original authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n##############################################################################\n#\n#   Gradle start up script for POSIX generated by Gradle.\n#\n#   Important for running:\n#\n#   (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is\n#       noncompliant, but you have some other compliant shell such as ksh or\n#       bash, then to run this script, type that shell name before the whole\n#       command line, like:\n#\n#           ksh Gradle\n#\n#       Busybox and similar reduced shells will NOT work, because this script\n#       requires all of these POSIX shell features:\n#         * functions;\n#         * expansions ?$var?, ?${var}?, ?${var:-default}?, ?${var+SET}?,\n#           ?${var#prefix}?, ?${var%suffix}?, and ?$( cmd )?;\n#         * compound commands having a testable exit status, especially ?case?;\n#         * various built-in commands including ?command?, ?set?, and ?ulimit?.\n#\n#   Important for patching:\n#\n#   (2) This script targets any POSIX shell, so it avoids extensions provided\n#       by Bash, Ksh, etc; in particular arrays are avoided.\n#\n#       The \"traditional\" practice of packing multiple parameters into a\n#       space-separated string is a well documented source of bugs and security\n#       problems, so this is (mostly) avoided, by progressively accumulating\n#       options in \"$@\", and eventually passing that to Java.\n#\n#       Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,\n#       and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;\n#       see the in-line comments for details.\n#\n#       There are tweaks for specific operating systems such as AIX, CygWin,\n#       Darwin, MinGW, and NonStop.\n#\n#   (3) This script is generated from the Groovy template\n#       https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt\n#       within the Gradle project.\n#\n#       You can find Gradle at https://github.com/gradle/gradle/.\n#\n##############################################################################\n\n# Attempt to set APP_HOME\n\n# Resolve links: $0 may be a link\napp_path=$0\n\n# Need this for daisy-chained symlinks.\nwhile\n    APP_HOME=${app_path%\"${app_path##*/}\"}  # leaves a trailing /; empty if no leading path\n    [ -h \"$app_path\" ]\ndo\n    ls=$( ls -ld \"$app_path\" )\n    link=${ls#*' -> '}\n    case $link in             #(\n      /*)   app_path=$link ;; #(\n      *)    app_path=$APP_HOME$link ;;\n    esac\ndone\n\nAPP_HOME=$( cd \"${APP_HOME:-./}\" && pwd -P ) || exit\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=${0##*/}\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS='\"-Xmx64m\" \"-Xms64m\"'\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=maximum\n\nwarn () {\n    echo \"$*\"\n} >&2\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n} >&2\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"$( uname )\" in                #(\n  CYGWIN* )         cygwin=true  ;; #(\n  Darwin* )         darwin=true  ;; #(\n  MSYS* | MINGW* )  msys=true    ;; #(\n  NONSTOP* )        nonstop=true ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=$JAVA_HOME/jre/sh/java\n    else\n        JAVACMD=$JAVA_HOME/bin/java\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=java\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif ! \"$cygwin\" && ! \"$darwin\" && ! \"$nonstop\" ; then\n    case $MAX_FD in #(\n      max*)\n        MAX_FD=$( ulimit -H -n ) ||\n            warn \"Could not query maximum file descriptor limit\"\n    esac\n    case $MAX_FD in  #(\n      '' | soft) :;; #(\n      *)\n        ulimit -n \"$MAX_FD\" ||\n            warn \"Could not set maximum file descriptor limit to $MAX_FD\"\n    esac\nfi\n\n# Collect all arguments for the java command, stacking in reverse order:\n#   * args from the command line\n#   * the main class name\n#   * -classpath\n#   * -D...appname settings\n#   * --module-path (only if needed)\n#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.\n\n# For Cygwin or MSYS, switch paths to Windows format before running java\nif \"$cygwin\" || \"$msys\" ; then\n    APP_HOME=$( cygpath --path --mixed \"$APP_HOME\" )\n    CLASSPATH=$( cygpath --path --mixed \"$CLASSPATH\" )\n\n    JAVACMD=$( cygpath --unix \"$JAVACMD\" )\n\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    for arg do\n        if\n            case $arg in                                #(\n              -*)   false ;;                            # don't mess with options #(\n              /?*)  t=${arg#/} t=/${t%%/*}              # looks like a POSIX filepath\n                    [ -e \"$t\" ] ;;                      #(\n              *)    false ;;\n            esac\n        then\n            arg=$( cygpath --path --ignore --mixed \"$arg\" )\n        fi\n        # Roll the args list around exactly as many times as the number of\n        # args, so each arg winds up back in the position where it started, but\n        # possibly modified.\n        #\n        # NB: a `for` loop captures its iteration list before it begins, so\n        # changing the positional parameters here affects neither the number of\n        # iterations, nor the values presented in `arg`.\n        shift                   # remove old arg\n        set -- \"$@\" \"$arg\"      # push replacement arg\n    done\nfi\n\n# Collect all arguments for the java command;\n#   * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of\n#     shell script including quotes and variable substitutions, so put them in\n#     double quotes to make sure that they get re-expanded; and\n#   * put everything else in single quotes, so that it's not re-expanded.\n\nset -- \\\n        \"-Dorg.gradle.appname=$APP_BASE_NAME\" \\\n        -classpath \"$CLASSPATH\" \\\n        org.gradle.wrapper.GradleWrapperMain \\\n        \"$@\"\n\n# Use \"xargs\" to parse quoted args.\n#\n# With -n1 it outputs one arg per line, with the quotes and backslashes removed.\n#\n# In Bash we could simply go:\n#\n#   readarray ARGS < <( xargs -n1 <<<\"$var\" ) &&\n#   set -- \"${ARGS[@]}\" \"$@\"\n#\n# but POSIX shell has neither arrays nor command substitution, so instead we\n# post-process each arg (as a line of input to sed) to backslash-escape any\n# character that might be a shell metacharacter, then use eval to reverse\n# that process (while maintaining the separation between arguments), and wrap\n# the whole thing up as a single \"set\" statement.\n#\n# This will of course break if any of these variables contains a newline or\n# an unmatched quote.\n#\n\neval \"set -- $(\n        printf '%s\\n' \"$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\" |\n        xargs -n1 |\n        sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' |\n        tr '\\n' ' '\n    )\" '\"$@\"'\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "gradlew.bat",
    "content": "@rem\r\n@rem Copyright 2015 the original author or authors.\r\n@rem\r\n@rem Licensed under the Apache License, Version 2.0 (the \"License\");\r\n@rem you may not use this file except in compliance with the License.\r\n@rem You may obtain a copy of the License at\r\n@rem\r\n@rem      https://www.apache.org/licenses/LICENSE-2.0\r\n@rem\r\n@rem Unless required by applicable law or agreed to in writing, software\r\n@rem distributed under the License is distributed on an \"AS IS\" BASIS,\r\n@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n@rem See the License for the specific language governing permissions and\r\n@rem limitations under the License.\r\n@rem\r\n\r\n@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Resolve any \".\" and \"..\" in APP_HOME to make it shorter.\r\nfor %%i in (\"%APP_HOME%\") do set APP_HOME=%%~fi\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\"-Xmx64m\" \"-Xms64m\"\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %*\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "metadata/en-US/full_description.txt",
    "content": "Aer is a private local (+secondary) storage utility application for android.\n\nDo you worry about your private pictures or files appearing in other apps?\nThat's where Aer private storage comes in. Files in Aer storage won't appear in the other apps.\n\nNote: Aer is in development 🏗️. Accidents happen. Please keeps backups 👷‍♀️ for your protection.\n\nInstead of being a stand-alone file manager, Aer hooks into various components of Android,\nmaking it feel like a native part of the operating system. Moreover, it provides ways for the user\nto export contents from other apps and save them in Aer storage.\n\n<em>Features</em>\n\n<ul>\n<li> Create folders and organize files freely\n<li> All files in the Aer private storage won't appear in the other apps\n<li> Access using the system Files application (the DocumentsProviderUI)\n    <li> An optional shortcut is offered for devices that do not expose the system Files app\n    <li> The system Files app is also used as file picker, so you can pick Aer files to share\n<li> Lock access to the private storage\n    <li> Quick tile\n    <li> Auto lock after set delay (experimental)\n    <li> Password for locking access to the files\n<li> Import content into Aer using the Android share functionality\n</ul>\n\n<em>Aer vs Anemo</em>\n\nIn addition to Anemo features above, Aer adds support for external storage, like encrypted SD cards.\nWhen available Aer will store your files on external storage (which tend to have larger capacity).\nThis also allows accessing your private files on your computer when connected using USB cable (MTP).\nThe storage backend used is also manually configurable.\n"
  },
  {
    "path": "metadata/en-US/short_description.txt",
    "content": "Private storage utility for android with support for external storage media\n"
  },
  {
    "path": "metadata/en-US/title.txt",
    "content": "Aer - Fork of Anemo\n"
  },
  {
    "path": "metadata/es-ES/full_description.txt",
    "content": "Anemo es una aplicación de utilidad de almacenamiento local privado para Android.\nEn lugar de ser una interfaz de usuario de administrador de archivos independiente, se conecta a varios componentes de\nAndroid haciéndolo sentir como una parte nativa del sistema operativo.\nAdemás, proporciona formas para que el usuario exporte contenidos de otras aplicaciones y los guarde como archivos.\n\nCaracterísticas\n\n- Crea carpetas y organiza archivos libremente\n- Todos los archivos en el almacenamiento privado no aparecerán en las otras aplicaciones\n- Acceso en la aplicación Archivos del sistema (the _DocumentsProviderUI_)\n    - Se ofrece un acceso directo opcional para dispositivos que no exponen la aplicación Archivos del sistema\n- Bloquear el acceso al almacenamiento privado\n  - Mosaico rápido\n  - Bloqueo automático después de 15 minutos\n  - Contraseña para bloquear el acceso a los archivos\n- Importar contenido usando la funcionalidad de compartir de Android\n"
  },
  {
    "path": "metadata/es-ES/short_description.txt",
    "content": "Una aplicación de utilidad de almacenamiento local privado para Android.\n"
  },
  {
    "path": "metadata/es-ES/title.txt",
    "content": "Anemo"
  },
  {
    "path": "metadata/fr-FR/full_description.txt",
    "content": "Anemo est un utilitaire de stockage local privé pour Android.\nAu lieu de n'être qu'une interface de gestion de fichiers autonome, il s'intègre à divers composants \nd'Android donnant l'impression d'être une partie native du système d'exploitation.\nDe plus, il offre à l'utilisateur des moyens d'exporter le contenu d'autres applications et de les enregistrer sous forme de fichiers.\n\nFonctionnalités\n\n- Créez des dossiers et organisez librement vos fichiers\n- Les fichiers du stockage privé n'apparaîtront pas dans les autres applications\n- Accès dans l'application Fichiers système (via le _DocumentsProviderUI_)\n     - Un raccourci facultatif est proposé pour les appareils qui n'exposent pas l'application Fichiers système\n\n- Verrouiller l'accès au stockage privé\n    - Tuile rapide\n    - Verrouillage automatique après 15 minutes\n    - Mot de passe pour cadenasser l'accès aux fichiers\n- Importer du contenu à l'aide de la fonctionnalité de partage d'Android\n"
  },
  {
    "path": "metadata/fr-FR/short_description.txt",
    "content": "Un utilitaire de stockage local privé pour Android.\n"
  },
  {
    "path": "metadata/fr-FR/title.txt",
    "content": "Anemo\n"
  },
  {
    "path": "metadata/it-IT/full_description.txt",
    "content": "Anemo è un'applicazione di archiviazione locale privata per Android.\nInvece di essere un'interfaccia utente di gestione file autonoma, si collega a vari componenti di\nAndroid facendola sentire come una parte nativa del sistema operativo.\nInoltre fornisce all'utente modi per esportare contenuti da altre app e salvarli come file.\n\nCaratteristiche\n\n- Crea cartelle e organizza i file liberamente\n- Tutti i file nella memoria privata non verranno visualizzati nelle altre app\n- Accesso nell'applicazione File di sistema (_DocumentsProviderUI_)\n    - Viene offerto un collegamento facoltativo per i dispositivi che non espongono l'app File di sistema\n- Blocca l'accesso all'archivio privato\n  - Riquadro nelle impostazioni rapide\n  - Blocco automatico dopo 15 minuti\n  - Password per bloccare l'accesso ai file\n- Importa contenuti utilizzando la funzionalità Android di condivisione\n"
  },
  {
    "path": "metadata/it-IT/short_description.txt",
    "content": "Un'applicazione di archiviazione locale privata per Android."
  },
  {
    "path": "metadata/it-IT/title.txt",
    "content": "Anemo\n"
  },
  {
    "path": "metadata/pt-rBR/full_description.txt",
    "content": "Aer é um aplicativo utilitário de armazenamento (+secundário) local privado para Android.\n\nVocê se preocupa com suas fotos ou arquivos privados aparecendo em outros aplicativos?\nÉ aí que entra o armazenamento privado do Aer. Arquivos no armazenamento do Aer não aparecerão nos outros aplicativos.\n\nObservação: Aer ainda está em desenvolvimento 🏗️. Acidentes podem acontecer. Por favor, mantenha backups 👷‍♀️ para sua proteção.\n\nEm vez de ser um gerenciador de arquivos independente, o Aer se conecta a vários componentes do Android,\nfazendo com que pareça uma parte nativa do sistema operacional. Além disso, ele fornece maneiras para o usuário\nexportar conteúdos de outros aplicativos e salvá-los no armazenamento do Aer.\n\nFuncionalidades\n\n- Crie pastas e organize arquivos livremente\n- Todos os arquivos no armazenamento privado do Aer não aparecerão nos outros aplicativos\n- Acesse usando o aplicativo Arquivos do sistema (DocumentsProviderUI)\n  - Um atalho opcional é oferecido para dispositivos que não expõem o aplicativo Arquivos do sistema\n  - O aplicativo Arquivos do sistema também é usado como seletor de arquivos, assim você pode escolher arquivos do Aer para compartilhar\n- Bloquear acesso ao armazenamento privado\n  - Atalho nas Configurações Rápidas\n  - Bloqueio automático após 15 minutos\n  - Senha para bloquear o acesso aos arquivos\n- Importe conteúdo para o Aer usando a funcionalidade de compartilhamento do Android\n\nAer vs Anemo\n\nAlém dos recursos do Anemo citados acima, o Aer adiciona suporte para armazenamento externo, como cartões SD criptografados.\nQuando disponível, o Aer armazenará seus arquivos no armazenamento externo (que tende a ter maior capacidade).\nIsso também permite acessar seus arquivos privados no seu computador quando conectado usando um cabo USB (MTP).\nO backend de armazenamento usado também é configurável manualmente."
  },
  {
    "path": "metadata/pt-rBR/short_description.txt",
    "content": "Utilitário de armazenamento privado para Android com suporte para mídia de armazenamento externa\n"
  },
  {
    "path": "metadata/pt-rBR/title.txt",
    "content": "Aer - Fork do Anemo"
  },
  {
    "path": "settings.gradle.kts",
    "content": "/*\n * Copyright (c) 2021 2bllw8\n * SPDX-License-Identifier: GPL-3.0-only\n */\npluginManagement {\n\n    /**\n     * The pluginManagement.repositories block configures the\n     * repositories Gradle uses to search or download the Gradle plugins and\n     * their transitive dependencies. Gradle pre-configures support for remote\n     * repositories such as JCenter, Maven Central, and Ivy. You can also use\n     * local repositories or define your own remote repositories. The code below\n     * defines the Gradle Plugin Portal, Google's Maven repository,\n     * and the Maven Central Repository as the repositories Gradle should use to look for its\n     * dependencies.\n     */\n\n    repositories {\n        gradlePluginPortal()\n        google()\n        mavenCentral()\n    }\n}\n\ninclude(\":app\")\n"
  }
]