Showing posts with label bootloader. Show all posts
Showing posts with label bootloader. Show all posts

Sunday, February 5, 2017

How to add reboot recovery and bootloader options in Power menu

How to add reboot recovery and bootloader options in Power menu


So lets Start

Required
1-apktool
2-notepad++
3-some brains



STEP-1

Decompile Framework-res.apk

goto to res/vlaues/arrays.xml

and add these lines at the end

Code:
 <string-array name="reboot_options">
<item>@string/reboot_normal</item>
<item>@string/reboot_recovery</item>
<item>@string/reboot_bootloader</item>
</string-array>
<string-array name="reboot_actions">
<item>now</item>
<item>recovery</item>
<item>bootloader</item>
</string-array>

now goto res/values/strings
and add these lines at the end


Code:
 <string name="reboot">Reboot</string>
<string name="reboot_normal">Reboot</string>
<string name="reboot_recovery">Recovery</string>
<string name="reboot_bootloader">Bootloader</string>

goto add the ic_lock_reboot.png which i have i provided in the resources attached below this post to drawablw-hdpi folder

so before compiling the framework-res.apk follow erorcuns guide to properly recompile framework-res.apk

once recompile is done ....decompile again to get the HEX IDs

STEP-2

decompile android.policy.jar

goto classoutcomandroidinternalpolicyimpl

and add the 3 smalis files which i provided in the resources attached below

Now option classoutcomandroidinternalpolicyimplGlobalAc tions.smali

and find these lines and add the red marked lines between them

Code:
 .line 235
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;

new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$2;

const v2, 0x1080030

const v3, 0x10400fa

invoke-direct {v1, p0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$2;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V

invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

.line 213
move-object/from16 v0, p0

iget-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;

new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$11;

const v3, 0x1080827

const v4, 0x104060b

move-object/from16 v0, p0

invoke-direct {v2, v0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$11;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V

invoke-virtual {v1, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z


.line 260
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;

iget-object v1, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;

invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

now we need to assign the Hex ids as per ur Public.xml

NOTE: the hex ids might be different from mine and yours so be careful while comparing

new as per the above changes in GlobalActions.xml

assign the ids as below

<public type="drawable" name="ic_lock_reboot" id="0x01080827" />

Code:
 new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$11;

const v3, 0x1080827

<public type="string" name="reboot" id="0x0104060b" />

Code:
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$11;

const v3, 0x1080827

const v4, 0x104060b


Now option up classoutcomandroidinternalpolicyimplGlobalAc tions$11.smali

find and replace the following

@line 70
<public type="string" name="reboot" id="0x0104060b" />


Code:
const v3, 0x104060b

@line 90
<public type="array" name="reboot_options" id="0x0107003b" />


Code:
const v3, 0x107003b

@line 105
<public type="string" name="ok" id="0x0104000a" />



Code:
 const v2, 0x104000a

@line 147
<public type="bool" name="config_sf_slowBlur" id="0x0111000b" />


Code:
const v3, 0x111000b

now open up classoutcomandroidinternalpolicyimplGlobalAc tions$11$2.smali

@line 59
<public type="array" name="reboot_actions" id="0x0107003c" />


Code:
const v2, 0x107003c

save it and recompile android.policy.jar


now push all the files into ut phone...will have the new Advanced reboot options

ATTACHED FILES
File Type: rarreboot_option_resources.rar - [Click for QR Code] (4.5 KB, 140 views)


Available link for download

Read more »

Saturday, January 7, 2017

GUIDE Unlock Bootloader Moto G 2nd Gen

GUIDE Unlock Bootloader Moto G 2nd Gen


UNLOCK YOUR BOOTLOADER

WARNING: UNLOCKING YOUR BOOTLOADER VOIDS YOUR WARRANTY.PROCEED AT YOUR OWN RISK.
NOTE: Unlocking the bootloader will Wipe/ factory reset your device, and will delete all personal data from your device such as apps, photos, messages, and settings.


INSTRUCTIONS:

  1. Make sure to take a backup of your entire device data.
  2. Download the Android SDK OR Download the Minimal ADB and Fastboot 
  3. Install the latest Motorola USB Drivers on your desktop. Download here.
  4. Put your device in fastboot mode (power off, then press the power and volume down buttons simultaneously).
  5. Open Command Prompt on androidsdk/platform-tools/ (Hold Shift and right click and press open command window here)
  6. Connect your Phone to PC
  7. Type this in the CMD prompt window - fastboot oem get_unlock_data
  8. You will get a return string. Copy it. [Right Click-Mark- Mark the text by pressing the shift key-Now press Ctrl+C]
  9. Paste all the lines together in a notepad. Remove the empty spaces.
  10. Now go to the Motorola Site.Sign in using your Google account or Motorola ID. Scroll down the page and paste the copied string in the field at step #6. Then click on ‘Can my device be unlocked?’, after which a "REQUEST UNLOCK KEY" button will appear at the bottom of page.
  11. To get your unlock key, select the ‘I Agree’ option. Note: You will receive an email with your Unlock Key at the email address you used to log in there.
  12. Important – Copy the 20-character key that Motorola sent you via email. Make sure your device is connected.
  13. Then in CMD type: fastboot devices (To check your device is connected)
  14. Then type: fastboot oem unlock UNIQUE_KEY

    NOTE: In above command, replace the word ‘UNIQUE_KEY’ with the unlock code that you got via email. Then hit enter and the unlocking process should begin. Wait for a while and soon you’ll see ‘Bootloader Unlocked’ warning on your Moto G(2nd Gen).

    To relock the bootloader:

    Go to Fastboot and give the command fastboot oem lock


You can always appreciate my work by pressing the Thanks Button.
Good Day 


Available link for download

Read more »