[Android Themes] SuperDroid-BOND:
Hello Everyone,

Here, being on XDA, is like learning new things in a school and getting project homework on daily basis. And Speaking for this, I really like it.

So here is the project that I cleared today morning at around 4.30 AM IST (Indian Standard Time).

But before beginning for project let me THANK few IDOLS of XDA.

@tdunham - You are the master of Power menu Sir. Compared files with your guide. [MENTION=5204709]Adi Aisiteru Reborn[/MENTION] - The GOD of MOD & Guides for CM / AOSP / AOKP [MENTION=5302958]ankurbata[/MENTION]- For the files I used for comparing.

@Dzol Cp- You are the One brother who taught me these things.

@bombaybadboy-Awesome Thread by You Sir. Got everything working whenever I take help from your thread.

@Goldieking- For helping me in rectifying error.

@Ticklefish- Awesome and Simplest tool for Themers and noobs like me.

@My Wife - My Life's Companion, Dearest Friend, My Love & Encouragement. I love you Sweet-Heart. @Xda Forum- The School for New born Techie child like me.

Before beginning to this guide, please make sure that you followed this guide by tdunham line by line and you failed doing so.

I tried this on my Stock ROMs and Other ported ROMs of My Device forum and got this working.

PART-1
​

1st Step:-

Decompile Your framework-res.apk and go to - res/value/strings.xml

add this line at the end.

<string name="global_action_screenshot_txt">Screenshot</string>
<string name="global_action_recovery_txt">BOND Recovery</string>

And add the png attached in this thread to - res/value/drawable-hdpi/mdpi/xhdpi (any one folder you can choose to add the images as according to your device resolution).

Step-2

Now recompile the framework-res.apk and then again decompile the newly compiled framework-res.apk

Then go to - res/values/public.xml and leave it open.

PART-2

Step-1

Now Decompile your stock "android.policy.jar" and add the attached "android.policy" files to - "android.policy.jar\smali\com\android\internal\policy\impl"

Now open GlobalActions.smali.

and find this lines.

.field private mRingerModeReceiverRegistered:Z

Just below this line make space for a line just like as its there (One space above the line & One space below)

Then Add these lines

.field mScreenshotConnection:Landroid/content/ServiceConnection;

.field final mScreenshotLock:Ljava/lang/Object;

.field final mScreenshotTimeout:Ljava/lang/Runnable;

Now find this line

iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneState:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;

Add these line below that.

.line 315
new-instance v4, Ljava/lang/Object;

invoke-direct {v4}, Ljava/lang/Object;-><init>()V

iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotLock:Ljava/lang/Object;

.line 317
const/4 v4, 0x0

iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotConnection:Landroid/content/ServiceConnection;

.line 318
new-instance v4, Lcom/android/internal/policy/impl/GlobalActions$12;

invoke-direct {v4, p0}, Lcom/android/internal/policy/impl/GlobalActions$12;-><init>(Lcom/android/internal/policy/impl/GlobalActions;)V

iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotTimeout:Ljava/lang/Runnable;

Now Find This line -

.method static synthetic access$1800(Lcom/android/internal/policy/impl/GlobalActions;)V
.locals 0
.parameter "x0"

.prologue
.line 68
invoke-direct {p0}, Lcom/android/internal/policy/impl/GlobalActions;->handleShow()V

return-void
.end method

And Add the line below end method.

.method static synthetic access$1900(Lcom/android/internal/policy/impl/GlobalActions;)V
.locals 0
.parameter "x0"

.prologue
.line 64
invoke-direct {p0}, Lcom/android/internal/policy/impl/GlobalActions;->takeScreenshot()V

return-void
.end method

Now find this line

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

And add this line below this method and above the line starting with-".line XXX"

.line 232
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, 0x1080691 [COLOR=Lime]<-------- This is the ID of "bond_screenshot"[/COLOR]

const v4, 0x1040516 [COLOR=Red] <-------- This is the ID of "global_action_screenshot_txt"[/COLOR]

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

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$14;

const v3, 0x1080692[COLOR=Lime] <-------- This is the ID of "bond_recovery"[/COLOR]

const v4, 0x1040517 [COLOR=Red]<-------- This is the ID of "global_action_recovery_txt"[/COLOR]

move-object/from16 v0, p0

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

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

Now Find this line--

# virtual methods

And add this lines just above it with gap of 2(two) Space between "end method" & "Virtual methods"

.method private takeScreenshot()V
.locals 8

.prologue
.line 330
iget-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotLock:Ljava/lang/Object;

monitor-enter v4

.line 331
:try_start_0
iget-object v3, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotConnection:Landroid/content/ServiceConnection;

if-eqz v3, :cond_0

.line 332
monitor-exit v4

.line 391
:goto_0
return-void

.line 334
:cond_0
new-instance v0, Landroid/content/ComponentName;

const-string v3, "com.android.systemui"

const-string v5, "com.android.systemui.screenshot.TakeScreenshotService"

invoke-direct {v0, v3, v5}, Landroid/content/ComponentName;-><init>(Ljava/lang/String;Ljava/lang/String;)V

.line 336
.local v0, cn:Landroid/content/ComponentName;
new-instance v2, Landroid/content/Intent;

invoke-direct {v2}, Landroid/content/Intent;-><init>()V

.line 337
.local v2, intent:Landroid/content/Intent;
invoke-virtual {v2, v0}, Landroid/content/Intent;->setComponent(Landroid/content/ComponentName;)Landroid/content/Intent;

.line 338
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$BondB;

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

.line 386
.local v1, conn:Landroid/content/ServiceConnection;
iget-object v3, p0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;

const/4 v5, 0x1

invoke-virtual {v3, v2, v1, v5}, Landroid/content/Context;->bindService(Landroid/content/Intent;Landroid/content/ServiceConnection;I)Z

move-result v3

if-eqz v3, :cond_1

.line 387
iput-object v1, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotConnection:Landroid/content/ServiceConnection;

.line 388
iget-object v3, p0, Lcom/android/internal/policy/impl/GlobalActions;->mHandler:Landroid/os/Handler;

iget-object v5, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotTimeout:Ljava/lang/Runnable;

const-wide/16 v6, 0x2710

invoke-virtual {v3, v5, v6, v7}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z

.line 390
:cond_1
monitor-exit v4

goto :goto_0

.end local v0 #cn:Landroid/content/ComponentName;
.end local v1 #conn:Landroid/content/ServiceConnection;
.end local v2 #intent:Landroid/content/Intent;
:catchall_0
move-exception v3

monitor-exit v4
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0

throw v3
.end method

Few Things to remeber:-

1) The ID's Need to be Same as in public.xml or else boot loop will shake your hands.

2) The register values like - v0,v1,v2.... need to be managed like what it is in your GlobalActions.smali. For the Comparison I have attached My-GlobalActions.smali for comparison.

Just change the extention from zip to smali.

3) I am also human and will be here after my daily life. So please have patience. I will try to get you out of your problem, if and only if you have a adb logcat.

4) If you find any difficulties then post it in the thread.

The Results after successful completion of this will be same as screenshot.

http://dl.xda-developers.com/attach.../7/6/5/2/2/Screenshot_2013-08-09-02-00-21.jpg

Last But Not Least - Don't get bothered to hit thanks. It will not cost you anything but will surely increase my courage to work and try new things.