Skip to main content

Check if your android resources are being unused.

Project description

Android Resources Checker

Flake8 Black Coverage License

What

This program will inspect the resources of your app and help you understand which ones are not being used and could potentially be removed.

Main features:

  • Identify the unused resources in your android project.
  • Identify the unused resources in your android library (when you have a multi-repo setup)
  • Listing of the unused resources (name, type and size)
  • Deletion of the unused resources

Installing

This program requires Python, supporting from 3.8.x and 3.9.x

In order to install run:

pip install -U android-resources-checker

Using

Inspecting your app resources.

Imagining your app in the project subject-app, you can trigger the resources inspection by running:

android-resources-checker --app /path/to/subject-app

Inspecting your library app resources.

In the case you have two projects in separate repos, where a client-app depends on a lib-app, you can check the unused resources of the library app by running:

android-resources-checker \
  --app /path/to/lib-app \
  --client /path/to/client-app-1 \
  --client /path/to/client-app-2

An example of a run could look like this:

Reports

The default behavior is to generate reports on both the stdout and CSV.

You can specify a single type of report using the --report=(CSV|STDOUT) option.

If using CSV reports, you can specify the directory where to write the reports in the form of CSV files. For that use the --reports-dir option.

For example:

android-resources-checker \
  --app /path/to/app \ 
  --reports-dir /path/to/reports

Validation

There is also the option to run this as a validation tool. In this case, it will fail with an error if any unused resources are found.

To specify the validation use the --check flag (the default behavior is to perform no validation).

Automatic Deletion

You can use this tool to also delete the unused resources by using the --delete option.

License


Copyright (c) 2021 Dotanuki Labs, Fabio Carballo

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

android-resources-checker-0.0.10.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file android-resources-checker-0.0.10.tar.gz.

File metadata

  • Download URL: android-resources-checker-0.0.10.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.8.8 Linux/5.4.0-1043-azure

File hashes

Hashes for android-resources-checker-0.0.10.tar.gz
Algorithm Hash digest
SHA256 a3e7e9c65266c0cd869a14d62ee33e7841c596924d9357b15bb9f0be7f1e7623
MD5 79249c5449514f94e1529c1452d170d1
BLAKE2b-256 f1f501ac7f951ffb2e8bf211f1cd5540cc862ef760fd4e9c61193b8afe76859f

See more details on using hashes here.

File details

Details for the file android_resources_checker-0.0.10-py3-none-any.whl.

File metadata

File hashes

Hashes for android_resources_checker-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 91f014acb42276b759f72c8df3f42ddd2e619d3dfd67fc8f75c6ca03b0f08283
MD5 06e7c4d19d39f46bddbc49c4b73e07db
BLAKE2b-256 a2aea3e6e7ce95955c7a2588208064b22a627f046b082e3701ae7dc67da5f622

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page