diff options
-rw-r--r-- | writeups/google-calendar-flairs/README.ko.md | 264 |
1 files changed, 264 insertions, 0 deletions
diff --git a/writeups/google-calendar-flairs/README.ko.md b/writeups/google-calendar-flairs/README.ko.md new file mode 100644 index 0000000..a10ade3 --- /dev/null +++ b/writeups/google-calendar-flairs/README.ko.md @@ -0,0 +1,264 @@ +# 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 + +[^1]: https://www.reddit.com/r/google/comments/166rtrh/google_calendar_banners_i_have_found/ +[^2]: https://developer.android.com/training/multiscreen/screendensities + +## 참고 +- https://github.com/mifran/google-calendar-image-keyword + +## 과정 +구글 켈린더 apk를 AVD 혹은 픽셀 폰에서 빼오기. + +기기상의 APK 경로 확인 +```sh +adb shell pm path com.google.android.calendar +``` + +APK 호스트로 다운 +```sh +adb pull /system/priv-app/CalendarProvider/CalendarProvider.apk +``` + +압축 해제 +```sh +mkdir CalendarProvider +cd CalendarProvider +unzip ../CalendarProvider.apk +``` + +Protobuf 파일에서 문자열 추출해 보기. Hack: 영어 버전보다는 한국어 버전을 쓰면 +다른 영단어 키워드가 나오지 않아 편함. + +```sh +strings ./assets/flairs/flairdata_ko.pb +``` + +다운받기 + +```sh +for res in mdpi hdpi xhdpi xxhdpi +do + mkdir "$res" + cd "$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 +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 +``` + +## 겔러리 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + |