[Galaxy S II Android Development] sieuan:
Hi [MENTION=3065070]Goldieking[/MENTION]! How can i replace the id of string name with the text in smali file sir?

I'm moding 3 way boot to power menu with this guide: http://xdaforums.com/showthread.php?t=2225970

This use the public id of string name in framework-res.apk to use in smali file. But i have problem with my stock framework-res.apk, can not recompile it. So i think that I can change the public id of string name with the text.

This code working good for me:

.line 217
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, [COLOR="Magenta"]0x104012f[/COLOR]

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 217
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;

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

const v2, 0x1080030

const v3, [COLOR="Blue"]0x104012f[/COLOR]

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

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

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

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

const v2, 0x1080030

const v3, [COLOR="Red"]0x104012f[/COLOR]

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

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

And I change it to:

.line 217
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, [COLOR="Magenta"]0x104012f[/COLOR]

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 217
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;

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

const v2, 0x1080030

[COLOR="Blue"]const-string v3, "Reboot"[/COLOR]

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

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

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

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

const v2, 0x1080030

[COLOR="Red"]const-string v3, "Recovery"[/COLOR]

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

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

But it not work, i lost my power button. What is the wrong, sir? How can i replace this id with text?

Thanks

/// sorry for my bad english...