aboutsummaryrefslogtreecommitdiff

Google Calendar Flairs

구글 켈린터 기능 중 하나인 이벤트 이름에 따라 "flair" 이미지를 표시하는 기능이 있다^1. 이 이미지를 빼오는 과정을 적어보았음.

이미지가 apk에 다 포함되어 있으리라 예상했으나, 코드 상에선 이벤트 내용 텍스트를 bag of words 방식으로 분석한 뒤 CDN에서 해당 키워드의 이미지를 동적으로 받아오는 식으로 되어 있있다. dp는 mdpi에서 xxhdpi까지만 있음^2.

  • https://ssl.gstatic.com/tmly/f8944938hffheth4ew890ht4i8/flairs/mdpi/
  • https://ssl.gstatic.com/tmly/f8944938hffheth4ew890ht4i8/flairs/hdpi/
  • https://ssl.gstatic.com/tmly/f8944938hffheth4ew890ht4i8/flairs/xhdpi/
  • https://ssl.gstatic.com/tmly/f8944938hffheth4ew890ht4i8/flairs/xxhdpi/

예시:

  • https://ssl.gstatic.com/tmly/f8944938hffheth4ew890ht4i8/flairs/mdpi/img_hiking.jpg
  • https://ssl.gstatic.com/tmly/f8944938hffheth4ew890ht4i8/flairs/xxhdpi/img_lunch.jpg

참고

  • https://github.com/mifran/google-calendar-image-keyword

과정

구글 켈린더 apk를 AVD 혹은 픽셀 폰에서 빼오기.

기기상의 APK 경로 확인

adb shell pm path com.google.android.calendar

APK 호스트로 다운

adb pull /system/priv-app/CalendarProvider/CalendarProvider.apk

압축 해제

mkdir CalendarProvider
cd CalendarProvider
unzip ../CalendarProvider.apk

Protobuf 파일에서 문자열 추출해 보기. Hack: 영어 버전보다는 한국어 버전을 쓰면 다른 영단어 키워드가 나오지 않아 편함.

strings ./assets/flairs/flairdata_ko.pb

다운받기

for res in mdpi hdpi xhdpi xxhdpi
do
    mkdir "$res"
    pushd "$res"

    strings ./assets/flairs/flairdata_ko.pb |
        sed -E -e 's/^\s+//' -e 's/\s+$//' -e 's/ /-/g' |
        sort |
        uniq |
        while read f
        do
            wget "https://ssl.gstatic.com/tmly/f8944938hffheth4ew890ht4i8/flairs/$res/img_$f.jpg"
        done

    popd
done

목록

img_hiking.jpg
img_lunch.jpg
img_athleticsjumping.jpg
img_cricket.jpg
img_nowruz.jpg
img_repair.jpg
img_dancing.jpg
img_volleyball.jpg
img_quinceanera.jpg
img_rhythmicgymnastics.jpg
img_saintpatricksday.jpg
img_learnlanguage.jpg
img_xmasmeal.jpg
img_drinks.jpg
img_cycling.jpg
img_pride.jpg
img_running.jpg
img_code.jpg
img_halloween.jpg
img_boxing.jpg
img_sailing.jpg
img_xmas.jpg
img_rowing.jpg
img_walkingdog.jpg
img_read.jpg
img_shooting.jpg
img_bookclub.jpg
img_manicure.jpg
img_wedding.jpg
img_climbing.jpg
img_cooking.jpg
img_theatreopera.jpg
img_planmyday.jpg
img_gamenight.jpg
img_americanfootball.jpg
img_kayaking.jpg
img_graduation.jpg
img_valentinesday.jpg
img_waterpolo.jpg
img_fencing.jpg
img_massage.jpg
img_violin2.jpg
img_camping.jpg
img_reachout.jpg
img_artisticgymnastics.jpg
img_cinema.jpg
img_wrestling.jpg
img_archery.jpg
img_pingpong.jpg
img_santa.jpg
img_breakfast.jpg
img_sleep.jpg
img_golf.jpg
img_xmasparty.jpg
img_backtoschool.jpg
img_fieldhockey.jpg
img_bowling.jpg
img_karate.jpg
img_handcraft.jpg
img_athleticsthrowing.jpg
img_birthday.jpg
img_billiard.jpg
img_dentist.jpg
img_soccer.jpg
img_clean.jpg
img_datenight.jpg
img_beer.jpg
img_thanksgiving.jpg
img_learninstrument.jpg
img_babyshower.jpg
img_mardigras.jpg
img_handball.jpg
img_swimming.jpg
img_badminton.jpg
img_baseball.jpg
img_walk.jpg
img_genericnewyear.jpg
img_concert.jpg
img_carmaintenance.jpg
img_rugbysevens.jpg
img_haircut.jpg
img_equestrian.jpg
img_tennis.jpg
img_oilchange.jpg
img_basketball.jpg
img_dinner.jpg
img_skiing2.jpg
img_islamicnewyear.jpg
img_chinesenewyear.jpg
img_coffee.jpg
img_videogaming.jpg
img_yoga.jpg
img_triathlon.jpg
img_cyclingbmx.jpg

겔러리

Flair image "athleticsjumping" Flair image "hiking" Flair image "lunch" Flair image "cricket" Flair image "nowruz" Flair image "repair" Flair image "dancing" Flair image "volleyball" Flair image "quinceanera" Flair image "rhythmicgymnastics" Flair image "saintpatricksday" Flair image "learnlanguage" Flair image "xmasmeal" Flair image "drinks" Flair image "cycling" Flair image "pride" Flair image "running" Flair image "code" Flair image "halloween" Flair image "boxing" Flair image "sailing" Flair image "xmas" Flair image "rowing" Flair image "walkingdog" Flair image "read" Flair image "shooting" Flair image "bookclub" Flair image "manicure" Flair image "wedding" Flair image "climbing" Flair image "cooking" Flair image "theatreopera" Flair image "planmyday" Flair image "gamenight" Flair image "americanfootball" Flair image "kayaking" Flair image "graduation" Flair image "valentinesday" Flair image "waterpolo" Flair image "fencing" Flair image "massage" Flair image "violin2" Flair image "camping" Flair image "reachout" Flair image "artisticgymnastics" Flair image "cinema" Flair image "wrestling" Flair image "archery" Flair image "pingpong" Flair image "santa" Flair image "breakfast" Flair image "sleep" Flair image "golf" Flair image "xmasparty" Flair image "backtoschool" Flair image "fieldhockey" Flair image "bowling" Flair image "karate" Flair image "handcraft" Flair image "athleticsthrowing" Flair image "birthday" Flair image "billiard" Flair image "dentist" Flair image "soccer" Flair image "clean" Flair image "datenight" Flair image "beer" Flair image "thanksgiving" Flair image "learninstrument" Flair image "babyshower" Flair image "mardigras" Flair image "handball" Flair image "swimming" Flair image "badminton" Flair image "baseball" Flair image "walk" Flair image "genericnewyear" Flair image "concert" Flair image "carmaintenance" Flair image "rugbysevens" Flair image "haircut" Flair image "equestrian" Flair image "tennis" Flair image "oilchange" Flair image "basketball" Flair image "dinner" Flair image "skiing2" Flair image "islamicnewyear" Flair image "chinesenewyear" Flair image "coffee" Flair image "videogaming" Flair image "yoga" Flair image "triathlon" Flair image "cyclingbmx"