본문 바로가기

정보공유/팁/강좌

갤럭시노트3 crt-off,fade-off 효과 적용하기.


갤럭시노트3  Crt-off, Fade-off 효과 적용하기.

 

SK노트3로 작업했습니다. 타사기종은 해보지않아서 구문이 100% 동일할지는 모르겠습니다.


디오덱스된 services.jar 파일을 디컴파일 하셔서, 아래처럼 수정하시고

빌드프롭에 아래처럼 구문을 추가해주시면됩니다.


Fade 효과로 적용할땐 아래처럼 추가하시고

# Fade-Off effect

persist.sys.screen_off=fade

persist.sys.screen_on=fade


Crt 효과로 하실땐 아래처럼 추가해주시면 됩니다.

# Crt-Off effect

persist.sys.screen_off=crt

persist.sys.screen_on=fade



수정할 파일 : services.jar\smali\com\android\server\power\DisplayPowerController.smali  



# annotations 를 검색하여 아래처럼 빨간색 구문을 추가합니다. 



# interfaces

.implements Landroid/animation/Animator$AnimatorListener;


# annotations





.method private getDynamicAutoBrightnessHighHysteresis(F)F 를 검색하여 아래처럼 빨간색 구문을 추가합니다. 


.end method


.method static getBeamCfg(Ljava/lang/String;I)I

    .locals 3

    .parameter

    .parameter


    .prologue

    move v0, p1


    invoke-static {p0}, Landroid/os/SystemProperties;->get(Ljava/lang/String;)Ljava/lang/String;


    move-result-object v1


    const-string v2, "none"


    invoke-virtual {v1, v2}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z


    move-result v2


    if-eqz v2, :cond_0


    const v0, 0x0


    return v0


    :cond_0

    const-string v2, "crt"


    invoke-virtual {v1, v2}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z


    move-result v2


    if-eqz v2, :cond_1


    const v0, 0x1


    return v0


    :cond_1

    const-string v2, "fade"


    invoke-virtual {v1, v2}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z


    move-result v2


    if-eqz v2, :cond_2


    const v0, 0x2


    :cond_2

    return v0

.end method


.method private getDynamicAutoBrightnessHighHysteresis(F)F






 new-instance v0, Lcom/android/server/power/RampAnimator; 를 검색하여 아래처럼 빨간색 구문을 추가합니다. 


    iput-object v0, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;


    const v4, 0x2


    iget-object v0, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;


    sget-object v1, Lcom/android/server/power/DisplayPowerState;->ELECTRON_BEAM_LEVEL:Landroid/util/FloatProperty;


    new-array v2, v4, [F


    fill-array-data v2, :array_0


    invoke-static {v0, v1, v2}, Landroid/animation/ObjectAnimator;->ofFloat(Ljava/lang/Object;Landroid/util/Property;[F)Landroid/animation/ObjectAnimator;


    move-result-object v0


    iput-object v0, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOnAnimator:Landroid/animation/ObjectAnimator;


    .line 6120

    iget-object v0, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOnAnimator:Landroid/animation/ObjectAnimator;


    const-wide/16 v1, 0xfa


    invoke-virtual {v0, v1, v2}, Landroid/animation/ObjectAnimator;->setDuration(J)Landroid/animation/ObjectAnimator;


    .line 6130

    iget-object v0, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOnAnimator:Landroid/animation/ObjectAnimator;


    invoke-virtual {v0, p0}, Landroid/animation/ObjectAnimator;->addListener(Landroid/animation/Animator$AnimatorListener;)V


    .line 6150

    iget-object v0, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;


    sget-object v1, Lcom/android/server/power/DisplayPowerState;->ELECTRON_BEAM_LEVEL:Landroid/util/FloatProperty;


    new-array v2, v4, [F


    fill-array-data v2, :array_1


    invoke-static {v0, v1, v2}, Landroid/animation/ObjectAnimator;->ofFloat(Ljava/lang/Object;Landroid/util/Property;[F)Landroid/animation/ObjectAnimator;


    move-result-object v0


    iput-object v0, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOffAnimator:Landroid/animation/ObjectAnimator;


    .line 6170

    iget-object v0, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOffAnimator:Landroid/animation/ObjectAnimator;


    const-wide/16 v1, 0x190


    invoke-virtual {v0, v1, v2}, Landroid/animation/ObjectAnimator;->setDuration(J)Landroid/animation/ObjectAnimator;


    .line 6180

    iget-object v0, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOffAnimator:Landroid/animation/ObjectAnimator;


    invoke-virtual {v0, p0}, Landroid/animation/ObjectAnimator;->addListener(Landroid/animation/Animator$AnimatorListener;)V


    const-string v2, "persist.sys.screen_off"


    const v3, 0x1


    invoke-static {v2, v3}, Lcom/android/server/power/DisplayPowerController;->getBeamCfg(Ljava/lang/String;I)I


    move-result v4


    iput v4, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOff:I


    const-string v2, "persist.sys.screen_on"


    const v3, 0x2


    invoke-static {v2, v3}, Lcom/android/server/power/DisplayPowerController;->getBeamCfg(Ljava/lang/String;I)I


    move-result v2


    const v3, 0x1


    if-ne v3, v2, :cond_0


    const v3, 0x2


    if-ne v3, v4, :cond_0


    move v2, v4


    :cond_0

    iput v2, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOn:I


    .line 618

    new-instance v0, Lcom/android/server/power/RampAnimator;







조금 아래쪽에 return-void 구문밑에  아래처럼 빨간색 구문을 추가합니다. 



    .line 620

    return-void


    nop


    :array_0

    .array-data 0x4

        0x0t 0x0t 0x0t 0x0t

        0x0t 0x0t 0x80t 0x3ft

    .end array-data


    .line 615

    :array_1

    .array-data 0x4

        0x0t 0x0t 0x80t 0x3ft

        0x0t 0x0t 0x0t 0x0t

    .end array-data

.end method





   iget-boolean v6, v6, Lcom/android/server/power/DisplayPowerRequest;->blockScreenOn:Z  (파란색구문)

 를 검색하여 아래처럼 빨간색 구문을 추가합니다. 



    invoke-static {v6}, Lcom/android/server/power/DisplayPowerController;->wantScreenOn(I)Z


    move-result v6


    if-eqz v6, :cond_21 (cond_1d -> cond_21 수정)


    iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOffAnimator:Landroid/animation/ObjectAnimator;


    invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->isStarted()Z


    move-result v6


    if-nez v6, :cond_9


    .line 842

    invoke-direct {p0, v7}, Lcom/android/server/power/DisplayPowerController;->setScreenOn(Z)V


    .line 843

    iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;


    iget-boolean v6, v6, Lcom/android/server/power/DisplayPowerRequest;->blockScreenOn:Z


    if-eqz v6, :cond_1c


    iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;


    invoke-virtual {v6}, Lcom/android/server/power/DisplayPowerState;->getElectronBeamLevel()F


    move-result v6


    const v10, 0x0


    cmpl-float v6, v6, v10


    if-nez v6, :cond_1c


    .line 844

    invoke-direct {p0}, Lcom/android/server/power/DisplayPowerController;->blockScreenOn()V


    .line 921

    :cond_9

    :goto_9

    if-eqz v1, :cond_0


    iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOnWasBlocked:Z


    if-nez v6, :cond_0


    iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOnAnimator:Landroid/animation/ObjectAnimator;


    invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->isStarted()Z


    move-result v6


    if-nez v6, :cond_0


    iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOffAnimator:Landroid/animation/ObjectAnimator;


    invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->isStarted()Z


    move-result v6


    if-nez v6, :cond_0


    iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;






    invoke-direct {p0}, Lcom/android/server/power/DisplayPowerController;->unblockScreenOn()V

 를 검색하여 파란색 구문을 빨간색 구문으로 수정합니다.



    .line 846

    :cond_1c

    invoke-direct {p0}, Lcom/android/server/power/DisplayPowerController;->unblockScreenOn()V


    goto/16 :goto_9


    .line 849

    :cond_1d

    invoke-direct {p0, v8}, Lcom/android/server/power/DisplayPowerController;->setScreenOn(Z)V


    .line 851

    iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;


    iget-boolean v6, v6, Lcom/android/server/power/DisplayPowerRequest;->blockScreenOn:Z


    if-nez v6, :cond_9


    .line 852

    invoke-direct {p0}, Lcom/android/server/power/DisplayPowerController;->unblockScreenOn()V


    goto/16 :goto_9



  --------------------------------------------------------------------------------------------------------
  --------------------------------------------------------------------------------------------------------


    .line 846

    :cond_1c

    invoke-direct {p0}, Lcom/android/server/power/DisplayPowerController;->unblockScreenOn()V


    .line 7840

    iget v10, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOn:I


    if-nez v10, :cond_1d


    iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;


    const/high16 v7, 0x3f80


    invoke-virtual {v6, v7}, Lcom/android/server/power/DisplayPowerState;->setElectronBeamLevel(F)V


    invoke-virtual {v6}, Lcom/android/server/power/DisplayPowerState;->dismissElectronBeam()V


    goto/16 :goto_9


    :cond_1d

    iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOnAnimator:Landroid/animation/ObjectAnimator;


    invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->isStarted()Z


    move-result v6


    if-nez v6, :cond_9


    .line 7720

    iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;


    invoke-virtual {v6}, Lcom/android/server/power/DisplayPowerState;->getElectronBeamLevel()F


    move-result v6


    const/high16 v7, 0x3f80


    cmpl-float v6, v6, v7


    if-nez v6, :cond_1e


    .line 7850

    iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;


    invoke-virtual {v6}, Lcom/android/server/power/DisplayPowerState;->dismissElectronBeam()V


    goto/16 :goto_9


    :cond_1e

    const v6, 0x2


    if-eq v6, v10, :cond_1f


    const v10, 0x0


    :cond_1f

    iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;


    invoke-virtual {v6, v10}, Lcom/android/server/power/DisplayPowerState;->prepareElectronBeam(I)Z


    move-result v6


    if-eqz v6, :cond_20


    .line 778

    iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOnAnimator:Landroid/animation/ObjectAnimator;


    invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->start()V


    goto/16 :goto_9


    .line 780

    :cond_20

    iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOnAnimator:Landroid/animation/ObjectAnimator;


    invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->end()V


    goto/16 :goto_9


    .line 849

    :cond_21

    iget v10, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOff:I


    if-nez v10, :cond_22


    invoke-direct {p0, v8}, Lcom/android/server/power/DisplayPowerController;->setScreenOn(Z)V


    .line 851

    iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;


    iget-boolean v6, v6, Lcom/android/server/power/DisplayPowerRequest;->blockScreenOn:Z


    if-nez v6, :cond_9


    .line 852

    invoke-direct {p0}, Lcom/android/server/power/DisplayPowerController;->unblockScreenOn()V


    goto/16 :goto_9


    :cond_22

    iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOnAnimator:Landroid/animation/ObjectAnimator;


    invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->isStarted()Z


    move-result v6


    if-nez v6, :cond_9


    .line 7930

    iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOffAnimator:Landroid/animation/ObjectAnimator;


    invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->isStarted()Z


    move-result v6


    if-nez v6, :cond_9


    .line 7940

    iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;


    invoke-virtual {v6}, Lcom/android/server/power/DisplayPowerState;->getElectronBeamLevel()F


    move-result v6


    const v10, 0x0


    cmpl-float v6, v6, v10


    if-nez v6, :cond_23


    invoke-direct {p0, v8}, Lcom/android/server/power/DisplayPowerController;->setScreenOn(Z)V


    goto/16 :goto_9


    .line 7960

    :cond_23

    iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;


    iget v10, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOff:I


    invoke-virtual {v6, v10}, Lcom/android/server/power/DisplayPowerState;->prepareElectronBeam(I)Z


    move-result v6


    if-eqz v6, :cond_24


    iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;


    invoke-virtual {v6}, Lcom/android/server/power/DisplayPowerState;->isScreenOn()Z


    move-result v6


    if-eqz v6, :cond_24


    .line 8010

    iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOffAnimator:Landroid/animation/ObjectAnimator;


    invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->start()V


    goto/16 :goto_9


    .line 8030

    :cond_24

    iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOffAnimator:Landroid/animation/ObjectAnimator;


    invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->end()V


    goto/16 :goto_9






.method public requestPowerState(Lcom/android/server/power/DisplayPowerRequest;ZZ)Z

  를 검색하여 윗줄에 아래처럼 빨간색 구문을 추가합니다. 



    goto :goto_0

.end method


.method public onAnimationCancel(Landroid/animation/Animator;)V

    .locals 0

    .parameter "animation"


    .prologue

    return-void

.end method


.method public onAnimationEnd(Landroid/animation/Animator;)V

    .locals 0

    .parameter "animation"


    .prologue

    invoke-direct {p0}, Lcom/android/server/power/DisplayPowerController;->sendUpdatePowerState()V


    return-void

.end method


.method public onAnimationRepeat(Landroid/animation/Animator;)V

    .locals 0

    .parameter "animation"


    .prologue

    return-void

.end method


.method public onAnimationStart(Landroid/animation/Animator;)V

    .locals 0

    .parameter "animation"


    .prologue

    return-void

.end method


.method public requestPowerState(Lcom/android/server/power/DisplayPowerRequest;ZZ)Z


수정 끝.

 

  

제 글이 도움이 되셨다면 하단의 "ViewON" 한번씩

클릭해주시고 응원의 댓글들도 남겨주세요^^