Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Including apk compare in a gitlab CI/CD pipeline script breaks the script. Error inside the description. #21

Closed
AresDragoi opened this issue Apr 15, 2024 · 2 comments

Comments

@AresDragoi
Copy link

$ find ./ -name "*.apk" | xargs -I {} ./analyze.sh {} abc
Exception in thread "main" java.lang.IllegalStateException: The tools directory property is not set, please make sure you are executing apkanalyzer. Got /opt/android-sdk-linux/cmdline-tools

My specific usecase:

relevant part of .yaml file configuration:

analyze_samples:
    stage: analyze
    image: warnyul/android-build-tools 
    script:
        - ls -lah
        - find ./ -name "*.sh" | xargs -I {} chmod a+x {}
        - find ./ -name "*.apk" | xargs -I {} ./analyze.sh {} abc
        - pwd && ls -lah && ls obf/

analyze.sh script:

#!/bin/bash

#outputs number of defined methods, referenced methods, byte size respectively  
apkanalyzer dex packages "$1" | head -n 1 | awk '$1 {print $3, $4, $5}' # works just fine

apkanalyzer compare "$1" "obf/$1.obf" #causes the error. Verified that parameters are correct. Tried it with literals too.
@warnyul
Copy link
Owner

warnyul commented Apr 23, 2024

I think this issue is related with this SO question: https://stackoverflow.com/questions/60925741/cant-execute-apkanalyzer

@warnyul
Copy link
Owner

warnyul commented Apr 23, 2024

The fixed version available on docker hub.

@warnyul warnyul closed this as completed Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants