이해를 도와드리기위한 사진^^
허니컴 소리만 들어도 곡소리를 내며 도망치시겠지만(물론 과장입니다^^),
락스크린 효과만은 허니컴이 가장 이쁜 것 같더군요.(젤리빈도 만만치 않게 이쁩니다~)
*이 강좌는 XDA의 글을 기반으로 작성되었으며, XDA의 글이 java로 이루어진것을 smali로 바꾸어 작성하였습니다.
원문 XDA 링크 : http://forum.xda-developers.com/showthread.php?p=23456320 (evilisto님 게시물)
**XWLPG 펌웨어, KT노트 UF13 펌웨어의 파일을 비교해본 결과, 거의 동일한 것으로 밝혀졌습니다. 그러므로 기기에 따라서 다르게 적는 부분은 array 딱 한부분 외엔 없습니다.
--------------------------준비물---------------------------------------
deodex 하는 방법을 터득(칵이닷 님께서 정말 자세하게 정리를 잘 해두셨습니다.
방법을 모르신다면, 읽어보고 오세요. 추천 드리는거 잊지 마시구요. http://matcl.com/?c=1/10&uid=112566)
framework2.jar
framework-res.apk
아래에 첨부된 허니컴 리소스(modified는 제가 약간 수정한 버전입니다.)
-----------------------------------------------------------------------
1.framework2.jar 수정
본문에서는 framework.jar 이라고 표기하고 있지만,
사실 아무리 뒤져봐도 MultiWaveView.java 파일은 framework.jar 안에 없습니다.
그래서 이웃동네인 framework2.jar을 분해해봤더니 떡하니 나오더군요!
그러므로, framework2.jar을 deodex하고 baksmali해줍니다.
그 다음, comandroidinternalwidgetmultiwaveview 경로로 가서 MultiWaveView.smali 를 엽니다.
1-1 애니메이션 재생 속도
XDA 원문에서는 CHEVRON_ANIMATION_DURATION:I 와 CHEVRON_INCREMENTAL_DELAY:I 를 수정해주면 된다고 말하지만, 사실 smali는 얘들을 안읽어옵니다. 바꿔도 헛짓이더군요.
알고보니 그냥 const로 즉석에서 정의를 내려서 사용하고 있었어요.
그래서 추적해서 바꿔줍니다.
CHEVRON_INCREMENTAL_DELAY 의 기본값은 160이므로, 0xa0을 찾아봅니다.
3640줄에 mul-int/lit16 v3, v2, 0xa0 라는 내용이 있습니다.
0xa0을 0x320으로 바꿉니다. 즉, mul-int/lit16 v3, v2, 0x320
CHEVRON_ANIMATION_DURATION 의 기본값은 850이므로, 0x352을 찾아봅니다.
3680줄에 const-wide/16 v12, 0x352 라는 내용이 있습니다.
0x352를 0xfa0으로 바꿉니다. 즉, const-wide/16 v12, 0xfa0
1-2 계산 식 수정
XDA 원문에서는
{mWaveCenterX + r, mWaveCenterY}, // right 와
{mWaveCenterX + chevronAnimationDistance, mWaveCenterY}, // right 를
{mWaveCenterX, mWaveCenterY}, // right로 고치라고 하고 있습니다.
java는 한 줄인데 smali는 엄청 식이 길어집니다.
iget v14, v0, Lcom/android/internal/widget/multiwaveview/MultiWaveView;->mWaveCenterX:F add-float/2addr v14, v8 aput v14, v12, v13 const/4 v13, 0x1 move-object/from16 v0, p0 |
이 부분이 mWaveCenterX + r 의 부분입니다.
add-float/2addr v14, v8 을 삭제합니다.
결과물은
iget v14, v0, Lcom/android/internal/widget/multiwaveview/MultiWaveView;->mWaveCenterX:F aput v14, v12, v13 const/4 v13, 0x1 move-object/from16 v0, p0 |
가 됩니다.
그리고
iget v14, v0, Lcom/android/internal/widget/multiwaveview/MultiWaveView;->mWaveCenterX:F add-float/2addr v14, v1 aput v14, v12, v13 const/4 v13, 0x1 move-object/from16 v0, p0 |
가 mWaveCenterX + chevronAnimationDistance 의 부분이므로
iget v14, v0, Lcom/android/internal/widget/multiwaveview/MultiWaveView;->mWaveCenterX:F aput v14, v12, v13 const/4 v13, 0x1 move-object/from16 v0, p0 |
로 수정해줍니다.
1-3 스타팅 스케일과 엔드 스케일
smali는 dalvik-opcode로 이루어져있는데, 이놈은 float과 integar을 구분을 못합니다.
그냥 무작정 전부 16진수로 표현해버립니다.
그래서 소수는 구하기 힘들기 때문에 그냥 디컴파일용으로 apk를 하나 만들어서 값을 구해오는게 가장 편합니다.
어쨋든, XDA 원문에서는 스타팅 스케일을 0,3으로, 엔드 스케일을 1.1로 바꾸라고 하고 있습니다.
3613번 줄의 const/high16 v9, 0x3f00 를 const v9, 0x3e99999a로,
3618번 줄의 const/high16 v5, 0x4000을 const v5, 0x3f8ccccd로 바꾸시면 됩니다.
1-4 smali이기에 해주어야하는 끔찍한 수정
java의 이부분,
|
는 smali에서는 따로따로 정의를 해준 다음 array값으로 대체하게 됩니다.
startChevronAnimation 메서드의 맨 아래에 있는 어레이 값 3개가 각각
:array_1bc (XWLPG 펌웨어는 :array_1c0)
는 투명도를 의미하며,
:array_1c4 (XWLPG 펌웨어는 :array_1c8)
는 퍼져나가는 가로 크기.
:array_1cc (XWLPG 펌웨어는 :array_1d0)
는 퍼져나가는 세로 크기를 의미한다는 것만 압니다.
3884번~3900번 줄의 어레이들 중
투명도는 수정해주실 분만 수정해주시고,
(다만, 0x80t는 81 이상의 수치를 적으면 나타나지 않습니다. 0x3ft는 3e이하의 수치를 적으면 나타나지 않습니다.
3번째 값과 4번째 값이 동일할 시에도 나타나지 않습니다. 0x80t, 0x40을 적으면 깜빡거리는 물결이 나타납니다.
0x80t, 0x79를 적으면 처음부터 끝까지 투명도가 변하지 않는 물결이 퍼져나갑니다.)
퍼져나가는 가로크기의 어레이는
0x0t 0x0t 0x0t 0x3ft
0x0t 0x0t 0x0t 0x40t
에서
0x9at 0x99t 0x99t 0x3et
0xcdt 0xcct 0x8ct 0x3ft
로,
세로 크기의 어레이 역시
0x0t 0x0t 0x0t 0x3ft
0x0t 0x0t 0x0t 0x40t
에서
0x9at 0x99t 0x99t 0x3et
0xcdt 0xcct 0x8ct 0x3ft
로 바꿔주시면 됩니다.
1번 줄이 물결파의 최소 크기구요, 2번 줄이 최대 크기입니다. 값을 줄였다 늘렸다해보세요. 뭔지 아시게 됩니다.
(덧붙임)
smali의 array 값은 사실
const v9, 0x3e99999a 의 0x3e99999a를 반대로 쓴 것이였습니다
그래서 0x9at 0x99t 0x99t 0x3et가 되는거죠...
3e 99 99 9a
0x9at 0x99t 0x99t 0x3et
이제 이해가 가시죠?
------------------
여기까지가 smali 수정입니다.
classes.dex로 다시 컴파일해주시고, framework2.jar에 넣으신 다음 odex화 시켜주세요.
2.framework-res.apk 수정
아까 다운받은 Honeycomb.zip 있으시죠?
일단 그걸 drawable-hdpi에 덮어씌워줍니다.
그 다음 reslayoutkeyguard_screen_tab_unlock.xml 을 열어줍니다.
<RelativeLayout android:layout_width="fill_parent" android:layout_height="302.0dip"> <com.android.internal.widget.multiwaveview.MultiWaveView android:orientation="horizontal" android:id="@id/unlock_widget" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentBottom="true" android:targetDescriptions="@array/lockscreen_target_descriptions_with_camera" android:directionDescriptions="@array/lockscreen_direction_descriptions" android:targetDrawables="@array/lockscreen_targets_with_camera" android:handleDrawable="@drawable/ic_lockscreen_handle" android:rightChevronDrawable="@drawable/ic_lockscreen_chevron_right" android:waveDrawable="@drawable/ic_lockscreen_outerring" android:outerRadius="@dimen/multiwaveview_target_placement_radius" android:hitRadius="@dimen/multiwaveview_hit_radius" android:vibrationDuration="20" android:snapMargin="@dimen/multiwaveview_snap_margin" android:feedbackCount="3" android:verticalOffset="60.0dip" android:horizontalOffset="0.0dip" /> <TextView android:textAppearance="?textAppearanceMedium" android:textSize="@dimen/keyguard_lockscreen_status_line_font_size" android:textColor="?textColorSecondary" android:ellipsize="marquee" android:gravity="center_horizontal" android:id="@id/carrier" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="12.0dip" android:singleLine="true" android:layout_alignParentBottom="true" /> <TextView android:textAppearance="?textAppearanceMedium" android:ellipsize="marquee" android:id="@id/statement" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="12.0dip" android:singleLine="true" android:drawablePadding="4.0dip" android:layout_below="@id/carrier" android:layout_centerHorizontal="true" android:marqueeRepeatLimit="marquee_forever" /> </RelativeLayout> |
를
<RelativeLayout android:layout_width="fill_parent" android:layout_height="370.0dip" android:layout_marginTop="-100.0dip"> <com.android.internal.widget.multiwaveview.MultiWaveView android:orientation="horizontal" android:id="@id/unlock_widget" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentBottom="true" android:targetDescriptions="@array/lockscreen_target_descriptions_with_camera" android:directionDescriptions="@array/lockscreen_direction_descriptions" android:targetDrawables="@array/lockscreen_targets_with_camera" android:handleDrawable="@drawable/ic_lockscreen_handle" android:rightChevronDrawable="@drawable/ic_lockscreen_chevron_right" android:waveDrawable="@drawable/ic_lockscreen_outerring" android:outerRadius="@dimen/multiwaveview_target_placement_radius" android:hitRadius="@dimen/multiwaveview_hit_radius" android:vibrationDuration="20" android:snapMargin="@dimen/multiwaveview_snap_margin" android:feedbackCount="5" android:verticalOffset="0.0dip" android:horizontalOffset="0.0dip" /> <TextView android:visibility="gone" android:textAppearance="?textAppearanceMedium" android:textSize="@dimen/keyguard_lockscreen_status_line_font_size" android:textColor="?textColorSecondary" android:ellipsize="marquee" android:gravity="center_horizontal" android:id="@id/carrier" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="72.0dip" android:singleLine="true" android:layout_alignParentBottom="true" /> <TextView android:textAppearance="?textAppearanceMedium" android:ellipsize="marquee" android:id="@id/statement" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="12.0dip" android:singleLine="true" android:drawablePadding="4.0dip" android:layout_below="@id/carrier" android:layout_centerHorizontal="true" android:marqueeRepeatLimit="marquee_forever" /> </RelativeLayout> |
로 바꿔주게 되면, 락스크린의 락이 위 사진과 같은 위치에 오고, 통신사 문구가 사라집니다.
*주의 : 게시물을 등록하니까 사라지는 단어들이 몇몇개 있습니다. 절대로 복사해서 붙여넣지 마시고 비교하면서 하세요.
여기서 진동을 없에고싶으신 분은
android:vibrationDuration="20" 를 android:vibrationDuration="0"으로,
물결의 갯수를 5개에서 바꾸고 싶으신 분은
android:feedbackCount="5" 안의 5에 원하는 값을 넣어주시면 됩니다.
다 하셨으면,
resvaluesdimens.xml 를 엽니다.
keyguard_lockscreen_outerring_diameter 를 290으로,
multiwaveview_target_placement_radius 을 140으로 바꿔줍니다.
이렇게 하면 물결과 바깥원의 크기가 딱 맞아떨어집니다.
framework-res.apk의 수정이 끝났으니 저장하고 컴파일하신 후 투척하시면 됩니다.
3.보너스
Honeycomb(modified).zip 은 이 효과를 만들 때 쓰입니다.
MutiWaveView.smali에서 X,Y 최소값을 0x3et에서 0x3dt로 수정,
framework-res.apk의 keyguard_screen_tab_unlock.xml에서 android:feedbackCount 를 3으로 수정,
그리고 drawable-hdpi에 zip 안의 내용물을 쏟아부으시면 됩니다.
항상 테마 만들기에 도움을 주시는 AzDesign :F★님 감사드려요!
-끝-
언제나 힘써주는 빙긜님 감사합니다 ㅎㅎ