Com afegir el botó de recuperació del reinici al menú d’energia del Galaxy S7 Edge

adb pull /system/framework/services.jar



Canvieu la carpeta a la vostra elecció.

  1. Ara obriu l'APK Easy Tool i trieu Selecciona al costat de ' Fitxer APK per treballar ”. Trieu el framework-res.apk que heu extret del Galaxy S7. Ara feu clic al botó Descompila.



  1. Ara aneu al directori del fitxer .APK descompilat i enganxeu els fitxers del fitxer .zip de framework-res que he proporcionat al carpeta descompilada del vostre framework-res.apk.
  2. Ara, amb un editor de text, recomano alguna cosa com Notepad ++ que pugui organitzar el codi XML, obriu res / values ​​/ arrays.xml
  3. Ara és aquí on ens posarem molt tècnics. Heu d’afegir totes les línies que mostro atrevit en els següents fragments de codi.
  4. Cerca i afegir el que tinc en negreta.

poder
mode de dades
avió
reinicia
confinament
informe d'error
usuaris
reinici de recuperació
emergencymode
subscreen
screenrec



  • Ara aneu a res / values ​​/ strings.xml i afegir el atrevit .

S'està carregant el dispositiu connectat mitjançant USB ...
10,32,768,10,60
Reinicieu la recuperació



  • D’acord, ja hem acabat amb framework-res.apk. Ara podeu recompilar-lo a APK Easy Tool.
  • Ara treballarem a Services.jar, així que descompileu Services.jar amb APK Easy Tool i copieu els fitxers del fitxer .zip de serveis jar que he proporcionat anteriorment a la carpeta Services.jar recentment descompilada.
  • Ara amb un editor de text, obriu smali / com / android / server / policy / GlobalActions.smali i, de nou, afegirà el en negreta línia als camps # instància

.field mEmergencyStringId: I
.field private mRebootRecovery: Lcom / android / server / policy / GlobalActions $ SinglePressAction;

  • Ara cerqueu ' .method private createDialog () Lcom / android / server / policy / GlobalActions $ GlobalActionsDialog; '
if-eqz v4,: cond_8 const v4, 0x10809f4: goto_4 const v6, 0x10406e2 move-object / from16 v0, p0 invoke-direct {v5, v0, v4, v6}, Lcom / android / server / policy / GlobalActions $ 20; - > (Lcom / android / server / policy / GlobalActions; II) V move-object / from16 v0, p0 iput-object v5, v0, Lcom / android / server / policy / GlobalActions; -> mRestart: Lcom / android / server / política / GlobalActions $ SinglePressAction; nova instància v4, Lcom / android / server / policy / GlobalActions $ 47; move-object / from16 v0, p0 iget-object v0, v0, Lcom / android / server / policy / GlobalActions; -> mContext: Landroid / content / Context; invoke-virtual {v0}, Landroid / content / Context; -> getResources () Landroid / content / res / Resources; move-result-object v0 const-string v1, 'tw_ic_do_rebootrecovery' const-string v2, 'drawable' const-string v3, 'android' invoke-virtual {v0, v1, v2, v3}, Landroid / content / res / Resources ; -> getIdentifier (Ljava / lang / String; Ljava / lang / String; Ljava / lang / String;) I move-result v5 move-object / from16 v0, p0 iget-object v0, v0, Lcom / android / server / policy / GlobalActions; -> mContext: Landroid / content / Context; invoke-virtual {v0}, Landroid / content / Context; -> getResources () Landroid / content / res / Resources; move-result-object v0 const-string v1, 'tw_ic_do_rebootrecovery' const-string v2, 'string' const-string v3, 'android' invoke-virtual {v0, v1, v2, v3}, Landroid / content / res / Resources ; -> getIdentifier (Ljava / lang / String; Ljava / lang / String; Ljava / lang / String;) I move-result v6 move-object / from16 v0, p0 invoke-direct {v4, v0, v5, v6}, Lcom / android / server / policy / GlobalActions $ 47; -> (Lcom / android / server / policy / GlobalActions; II) V move-object / from16 v0, p0 iput-object v4, v0, Lcom / android / server / policy / GlobalActions; -> mRebootRecovery: Lcom / android / server / policy / GlobalActions $ SinglePressAction; invoke-static {}, Lcom / samsung / android / feature / SemCscFeature; -> getInstance () Lcom / samsung / android / feature / SemCscFeature; move-result-object v4 const-string / jumbo v5, 'CscFeature_Common_ConfigBikeMode'
  • La següent part és complicada, cal afegiu les línies en negreta i modifiqueu el subratllat.
const / 16 v6, 0x80 const / 4 v7, 0x1 move-object / from16 v0, p0 invoke-direct {v0, v6, v4, v5, v7}, Lcom / android / server / policy / GlobalActions; -> addDialogItemsIfEnabled (ILcom / android / server / policy / GlobalActions $ Action; Ljava / util / ArrayList; Z) Z nova instància v4, Lcom / android / server / policy / GlobalActions $ BugReportAction; move-object / from16 v0, p0 invoke-direct {v4, v0}, Lcom / android / server / policy / GlobalActions $ BugReportAction; -> (Lcom / android / server / policy / GlobalActions;) V move-object / from16 v0 , p0 iget-object v5, v0, Lcom / android / server / policy / GlobalActions; -> mItems: Ljava / util / ArrayList; const / 16 v6, 0x100 move-object / from16 v0, p iget-object v4, v0, Lcom / android / server / policy / GlobalActions; -> mRebootRecovery: Lcom / android / server / policy / GlobalActions $ SinglePressAction; move-object / from16 v0, p0 iget-object v5, v0, Lcom / android / server / policy / GlobalActions; -> mItems: Ljava / util / ArrayList; const / 4 v7, 0x1 move-object / from16 v0, p0 invoke-direct {v0, v6, v4, v5, v7}, Lcom / android / server / policy / GlobalActions; -> addDialogItemsIfEnabled (ILcom / android / server / policy / GlobalActions $ Action; Ljava / util / ArrayList; Z) Z const / 16 v6, 0x200 #before was 0x100 const / 4 v7, 0x1 move-object / from16 v0, p0 invoke-direct {v0, v6, v4, v5, v7}, Lcom / android / server / policy / GlobalActions; -> addDialogItemsIfEnabled (ILcom / android / server / policy / GlobalActions $ Action; Ljava / util / ArrayList; Z) Z
  • Ara cerqueu const-string / jumbo v4 , 'Silenci' i afegiu aquestes línies per sobre. Les dues línies en negreta han de coincidir.
const-string / jumbo v4, 'mode d'emergència' invoca-virtual {v4, v11}, Ljava / lang / String; object / from16 v0, p0 iget-object v4, v0, Lcom / android / server / policy / GlobalActions; -> mItems: Ljava / util / ArrayList; move-object / from16 v0, p0 iget-object v5, v0, Lcom / android / server / policy / GlobalActions; -> mEmergency: Lcom / android / server / policy / GlobalActions $ ToggleAction; invoke-virtual {v4, v5}, Ljava / util / ArrayList; -> add (Ljava / lang / Object;) Z go / 16: anar_7 : cond_15 const-string / jumbo v4, 'rebootrecovery' invoke-virtual {v4, v11}, Ljava / lang / String; -> equals (Ljava / lang / Object;) Z move-result v4 if-eqz v4,: cond_asc1 move-object / from16 v0, p0 iget-object v4, v0, Lcom / android / server / policy / GlobalActions; -> mItems: Ljava / util / ArrayList; move-object / from16 v0, p0 iget-object v5, v0, Lcom / android / server / policy / GlobalActions; -> mRebootRecovery: Lcom / android / server / policy / GlobalActions $ SinglePressAction; invoke-virtual {v4, v5}, Ljava / util / ArrayList; -> add (Ljava / lang / Object;) Z go / 16: anar_7 : cond_asc1 const-string / jumbo v4, 'silent'

A continuació, hem d'afegir una part que falti d'Android 7 services.jar, de manera que la tornarem a afegir perquè funcioni aquesta modificació.
Cerqueu la línia de .method private addCustomDialogItems (Landroid / graphics / drawable / BitmapDrawable; Ljava / lang / String; Landroid / content / Intent; ILjava / util / ArrayList;) Z

I afegiu aquest mètode anterior:



.method accés sintètic estàtic $ 500 (Lcom / android / server / policy / GlobalActions;) Landroid / content / Context; .locals 1 iget-object v0, p0, Lcom / android / server / policy / GlobalActions; -> mContext: Landroid / content / Context; mètode return-object v0 .end

Això és tot, ara torneu a compilar services.jar i podeu tornar a introduir tant el framework rec-compilat-res.apk com services.jar al vostre telèfon, ja sigui amb adb push o amb el botó d'instal·lació al telèfon de l'APK Easy Tool.

Si obteniu un bucle d'arrencada després de prémer al telèfon, inicieu la recuperació personalitzada i netegeu-la Dalvik + Cache.

3 minuts de lectura