All Projects → amank22 → ApkSize-Analyzer

amank22 / ApkSize-Analyzer

Licence: GPL-3.0 license
An Apk analyzer with CI/CD support and multiple reports in HTML, PDF, JSON

Programming Languages

HTML
75241 projects
kotlin
9241 projects

Projects that are alternatives of or similar to ApkSize-Analyzer

AndroidEasySQL-Library
An Easier & Lazier approach to SQL database for Android
Stars: ✭ 28 (+47.37%)
Mutual labels:  android-development
box
BOX is the Android framework from MyRealTrip which is a MVI architecture for Android apps that is created out of the box.
Stars: ✭ 38 (+100%)
Mutual labels:  android-development
CircularDialogs
Android dialog library to give user feedback about the common operations like Success, Warning and Errors.
Stars: ✭ 35 (+84.21%)
Mutual labels:  android-development
Bitcamp-2019
Won the most innovative solution at Bitcamp 2019.🎖🎉
Stars: ✭ 15 (-21.05%)
Mutual labels:  android-development
Android-Weekly
Android Weekly is a free newsletter that helps you to stay cutting-edge with your Android Development. The newsletter comes once a week and covers a broad range of topics like tutorials, screencasts, news... just everything that's awesome in the Android Development world!
Stars: ✭ 66 (+247.37%)
Mutual labels:  android-development
codee-app
Android IDE for programming fully written on Kotlin
Stars: ✭ 42 (+121.05%)
Mutual labels:  android-development
awesome-android-libraries
😎 A curated list of awesome Android libraries
Stars: ✭ 135 (+610.53%)
Mutual labels:  android-development
buildAPKsApps
Android APK app sources that build in Termux on Amazon Fire, Android and Chromebook! https://sdrausty.github.io/buildAPKsApps/
Stars: ✭ 32 (+68.42%)
Mutual labels:  android-development
android-developer-roadmap
🗺 The 2022 Android Developer Roadmap suggests learning paths to understanding Android development.
Stars: ✭ 5,533 (+29021.05%)
Mutual labels:  android-development
android-compose-mvvm-foodies
Android sample app following best practices: Kotlin, Compose, Coroutines and Flow, Hilt, JetPack Navigation, ViewModel, MVVM, Retrofit, Coil
Stars: ✭ 374 (+1868.42%)
Mutual labels:  android-development
MockSMS
Android application to create/craft fake sms.
Stars: ✭ 63 (+231.58%)
Mutual labels:  android-development
AndroidTools
🔧 Many useful tools for Android development, adb wrapper, smali, languages etc.
Stars: ✭ 32 (+68.42%)
Mutual labels:  android-development
VideoPreLoading
Demo for video PreLoading/ PreCaching using ExoPlayer 2.13.3 in Android.
Stars: ✭ 61 (+221.05%)
Mutual labels:  android-development
appsweep-gradle
This Gradle plugin can be used to continuously integrate app scanning using AppSweep into your Android app build process
Stars: ✭ 30 (+57.89%)
Mutual labels:  android-development
ValidUtil
No description or website provided.
Stars: ✭ 23 (+21.05%)
Mutual labels:  android-development
wtm-udacity-scholars-nanodegree-resources
A List of Resources for Udacity Nanodegrees
Stars: ✭ 15 (-21.05%)
Mutual labels:  android-development
VSpot
A nice focus view intro for your app. Focus a specific view on first time launch
Stars: ✭ 27 (+42.11%)
Mutual labels:  android-development
antimalwareapp
Anti-malware for Android using machine learning
Stars: ✭ 206 (+984.21%)
Mutual labels:  android-development
Age-Gender Estimation TF-Android
Age + Gender Estimation on Android with TensorFlow Lite
Stars: ✭ 34 (+78.95%)
Mutual labels:  android-development
github-commit-browser
A blog companion sample project that demonstrates saving UI state after process death on Android utilizing the community established 3rd party libraries
Stars: ✭ 55 (+189.47%)
Mutual labels:  android-development

Logo

ApkSize Analyzer is a command line java program to analyze the size of Apk and give report in multiple formats which you can then use in CI/CD environments (jenkins etc) to get deeper insights for your apk.

It can also be used to compare two APKs and generate report of the differences. You can do it in Android Studio also right? This will give you differences on source packages level so that you know what code exactly increased and not just differences in dex files.

Features:

  • Analyzes Apk for files, dex, resources.
  • Package level differences between two APKs.
  • The report generates JSON, HTML, pdf for easy integration and reading.
  • You can provide a specific app package prefix which will be reported separately for easy classification.
  • The package sizes are calculated as combination of all the dex files.
  • Included a separate list for the images listed according to decreasing size.
  • Most of the lists are sorted in the decreasing order of their sizes.

Example command to run analyzer:

This needs a json file as input which contains all the arguments as defined below. This is done because of large number of variables you can change in customise result according to your needs. You can find sample config.json in samples directory of this project.

java -jar apkSize-0.2-beta-all.jar relative --config=input/config.json

How to compare 2 apks? For comparing 2 apks, along with apk paths, there are arguments for comparing. isDiffMode must be true. You can find the sample config for comparing in samples directory.

Screenshot
Screenshot



Arguments: 0. (REQUIRED) relative/abs -> Tells how to look for the path you have given whether relative to the current folder or absolute paths.

  1. (REQUIRED) --config -> json file path containing all the required arguments.
Config Json Parameters:
/**
 * Must
 * Input apk file to test with.
 */
inputFilePath = ""

/**
 * Input proguard mapping file to test with. (Optional)
 */
inputFileProguardPath = ""

/**
 * Output folder path to put all the output files. (This is must)
 */
outputFolderPath = ""
/**
* The app name to print in the html & pdf report
* @default empty
*/
appName = ""
/**
* Boolean whether to generate a HTML report for this analyzer.
* @Default true
*/
generateHtmlReport = true
/**
 * This is the size filter for top images, top files.
 * This is the minimum size above which these data will be recorded and others below this will be discarded.
 * This is in bytes.
 */
topFilesImagesSizeLimiter = 10240L
/**
 * This is the size filter for filtered files.
 * This is the minimum size above which these data will be recorded and others below this will be discarded.
 * This is in bytes.
 */
filteredFilesSizeLimiter = 51200L
/**
 * This is the max number of count that will be added to json data.
 * These are for top images, top files, filtered files.
 * If the list of items is less than 30, full list is returned else sliced to only this count.
 * This will be a positive integer.
 */
filesListMaxCount = 20

//dex constants
/**
 * We classify few special packages (app related mostly) and show them as a separate item in the output json.
 * This is just to filter out and see data for your our code.
 * This checks if the package name starts with this prefix.
 * If you have any code other than this package, it might miss this filtering.
 */
appPackagePrefix = ""
/**
 * Every dex package & file we process has a depth to it.
 * Like com -> 1, com.apkDemo -> 2, com.apkDemo.home -> 3
 * It starts with 1.
 * We filter the packages that we output in json by this constants.
 * This is the minimum depth that will be filtered out to reduce the noise.
 * We don't want packages like 'com' to come in our result.
 * Change it to filter out even more.
 * A positive integer.
 * Depth starts with 1.
 */
dexPackagesMinDepth = 2
/**
 * This is the max count for the list of app packages (special appPackagePrefix filtered list)
 * Positive integer.
 */
appPackagesMaxCount = 20
/**
 * This is the max count of dex packages in the output json.
 * Positive integer.
 */
dexPackagesMaxCount = 30
/**
 * This is the minimum size in bytes that we use to filter.
 * Any packages/filter below this size is filtered and not included in the output json.
 * Size in bytes.
 */
dexPackagesSizeLimiter = 51200L
/**
* aapt2 executable file path according to the system.
* If this path is given then only resources stats are generated.
* This is absolute path of aapt2 file.
*/
aapt2Executor = ""
/**
 * Set this value to true if you want to compare 2 apks.
 * Program will ignore second apk file if this is false
 * Default value is false.
 */
isDiffMode = false

/**
 * Apk path according to abs/relative argument of the apk which needs to be compared to 1st one.
 * Default path is empty.
 * isDiffMode must be true for this comparison mode to enable.
 */
compareFilePath = ""

/**
 * Apk proguard mapping file for the second/comparing file.
 * Default path is empty.
 * isDiffMode must be true for this comparison mode to enable.
 */
compareFileProguardPath = ""

/**
 * This is the size limiter for differences of dex packages.
 * Any package size increase/decrease below this value will be discarded from report.
 * Default : 10000 (~10kb).
 * Value must be in bytes.
 */
diffSizeLimiter = 10000L

/**
 * This is a check to enable/disable file-to-file comparison of both the apks.
 * This comparison usually takes really long with big apks (Around 4-8 mins for 50 MB apks)
 * Dex package comparison will still run.
 */
disableFileByFileComparison = false

Future tasks:

  • Add Test Cases
  • Integrate with CI/CD
  • Make proguard or other minification tool work and reduce the size
  • Make HTML report for appPackages more readable
  • Make it as a gradle plugin
  • Work to support the bundle files too. Currently, bundle files doesn't give dex results.

Note: These items are not in the order

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].