Table of contents

  1. Gradle
  2. API Key 숨기기
  3. Commandline Tools
  4. Github actions
    1. Gradle secrets.properties
    2. Android espresso test on github actions

Gradle

API Key 숨기기

결론: Absolute security does not exist. Security is a set of measures, being piled up and combined, trying to slow down the inevitable. > 완벽한 방법은 없고 방법을 뒤섞어서 해킹을 늦추는 방법 밖에 없다

Commandline Tools

ADB

  • 삭제하기: adb uninstall some.package.name
  • 설치하기: adb install --user 0 -r some.apk
  • 강제 중지: adb shell am force-stop some.package.name
  • 데이터 삭제: adb shell pm clear some.package.name
  • Runtime permission Grant: adb shell pm grant some.package.name android.permission.READ_EXTERNAL_STORAGE
  • 앱 실행: adb shell monkey -p some.package.name 1
  • Package Dumpsys: adb shell pm dump some.package.name

AAPT

  • check apk version: aapt d badging myapk.apk | grep 'pack'

Github actions

Gradle secrets.properties

https://stackoverflow.com/a/62071199

secrets.properties 을 base64 로 인코딩

base64 secrets.properties

Gradle 추가

def secretsPropertiesFile = rootProject.file("./secrets.properties")
def secretsProperties = new Properties()
secretsProperties.load(new FileInputStream(secretsPropertiesFile))

Github actions 스크립트 추가

- name: Decode secrets.properties file
  env:
    SECRETS_PROPERTIES: $
  run: echo "$SECRETS_PROPERTIES" | base64 -d > ./secrets.properties

Android espresso test on github actions

https://github.com/marketplace/actions/android-emulator-runner

- name: Instrumentation Tests
  uses: reactivecircus/android-emulator-runner@v2
  with:
    api-level: 29
    target: google_apis
    profile: pixel_3a
    script: ./gradlew connectedCheck --no-build-cache --no-daemon --stacktrace