Android Application Research Series 2
알림 센터에 동영상 미리보기 (preview of video)
Android Application Research Series 2
안드로이드 알림에 있는 동영상 미리보기
지난번에 여러 묶인 사진 미리보는 것에 이어서 영상을 미리 확인할 수 있는 방법을 재확인하였다.
사실 지난번에는 불가능할 거 같았는데 다른 데이터랑 헷갈려서 착각했었다. 다시 확인해보니 영상 역시 가능해보였다.
들어가기 앞서 안드로이드에서 앱이 올라올 때 바이너리 파일부터 런타임 메모리를 보면서
아래 안드로이드 로드 과정을 정리해본다. 왜냐면 기억력을 믿을 수 없기 때문에.. 그리고 나중에 또 찾아보겠지..
안드로이드 앱 실행 과정 확인해보기
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┐
1단계: 런처 처리
Launcher.startActivity()
↓
ActivityTaskManager.startActivity()
↓ (Binder IPC, Inter-Process Communication)
ActivityManagerService.startActivity()
└ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┘
↓
┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┐
2단계: 프로세스 생성
Process.start()
↓
ZygoteProcess.start()
↓
Zygote.fork()
↓
ActivityThread.main()
└ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┘
↓
┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┐
3단계: SO 로드
LoadedApk.loadLibrary()
↓
System.loadLibrary()
↓
Runtime.loadLibrary0()
↓
DexPathList.findLibrary()
└ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┘
↓
┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┐
4단계: DEX 로드
PathClassLoader.loadClass()
↓
BaseDexClassLoader.loadClass()
↓
DexPathList.findClass()
↓
DexFile.loadClassBinaryName()
└ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┘
↓
┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┐
5단계: Application 생성
LoadedApk.makeApplication()
↓
Instrumentation.newApplication()
↓
Application.attach()
↓
Application.onCreate()
└ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┘
↓
┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┐
6단계: Activity 시작
ActivityThread.handleLaunchActivity()
↓
ActivityThread.performLaunchActivity()
↓
Instrumentation.newActivity()
↓
Activity.onCreate()
└ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┘
↓
┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┐
7단계: 뷰 렌더링
Activity.setContentView()
↓
PhoneWindow.setContentView()
↓
LayoutInflater.inflate()
↓
ViewRootImpl.performTraversals()
↓
measure() → layout() → draw()
└ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┘
데이터 구조 확인
이어서 본격적으로 지난번에 분석한 시점에서 이어서 동영상을 받았을 때 데이터를 확인해보겠다.
동영상을 받았을 떄 데이터 구조를 보면 아래와 같다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
NotificationMessage(title=redacted
, message=redacted.
, messageWithoutEmoticonAltText=redacted.
, profileUrl=null
, iconResId=0
, subText=null
, ticker=redacted : 동영상을 보냈습니다.
, unreadCount=3
, hasNotificationKeyword=false
, quiet=false
, chatLog=[class:class Tl.d0] ChatLog [id=redacted
, type=redacted
, chatRoomId=redacted
, userId=redacted
, message=video
, attachment={\"url\":\"https://talk.kakaocdn.net/redacted/redacted/redacted/redacted/redacted.mp4?credential=redacted&expires=redacted&signature=redacted\"
,\"tk\":\"redacted/redacted/redacted/redacted.mp4\"
,\"cs\":\"redacted\"
,\"s\":redacted
,\"d\":4
,\"w\":414
,\"h\":720
}
, createdAt=redacted
, v={\"notDecoded\":false
,\"origin\":\"MSG\"
,\"c\":\"redacted\"
,\"modifyRevision\":0
,\"isSingleDefaultEmoticon\":false
,\"defaultEmoticonsCount\":0
,\"isMine\":false
,\"enc\":redacted
}
, userId=redacted
, chatId=redacted
, chatLogId=redacted
, messageType=Video
, emoticonUrl=null
, emojiResId=0
, xconVersion=-1
, uri=null
, notificationId=null
, hasNotificationReply=false
, mentioned=false
, hasNotificationVoiceroom=false
, isGroupChat=false
, isOpenChat=false
, isSecretChat=false
, isInSilentChatRoom=false)
attachment 부분에 링크가 있는데 해당 링크로 접근하면 아래와 같이 알림을 열어보지 않고 어떤 영상이 왔는지 확인해볼 수 있다.
다음엔 영상도 파싱하는 부분을 진행해보려고 한다.
This post is licensed under CC BY 4.0 by the author.
If you find any errors, please let me know by comment or email. Thank you.
If you find any errors, please let me know by comment or email. Thank you.