1

I need help from an expert in Smali language.

I need to change the color of a string with public Id of 0x7f0f0042 in the program below. The reason for this is that I'm building a theme for an android application.

How can I achieve this?

Here's the Smali code google drive link. And following is the partial transcription of it. The full code is too extensive for the body of an SO question. You'll notice the ... separating the top, middle, and bottom of the code. In the middle part is the line where 0x7f0f0042 is defined.

.class public Lcom/samsung/dialer/impl/k;
.super Ljava/lang/Object;
.source "CallLogContextMenuHandlerImpl.java"

# interfaces
.implements Lcom/samsung/contacts/b/a;
# static fields
.field public static a:Ljava/lang/String;
.field public static b:Ljava/lang/Integer;
.field private static c:Ljava/lang/String;
.field private static d:Ljava/lang/Integer;

...
...
...

move-result v0

if-eqz v0, :cond_e

const/4 v0, 0x1

const/16 v1, 0x9

const/4 v2, 0x0

const v3, 0x7f0f0042

invoke-interface {p1, v0, v1, v2, v3}, Landroid/view/ContextMenu;->add(IIII)Landroid/view/MenuItem;

:cond_c
:goto_7
const-string v0, "KOR"

invoke-static {}, Lcom/samsung/contacts/util/l;->a()Lcom/samsung/contacts/util/l;

move-result-object v1

invoke-virtual {v1}, Lcom/samsung/contacts/util/l;->K()Ljava/lang/String;

move-result-object v1

...
...
...

.method public b(Landroid/view/View;)V
    .locals 1

    iget-object v0, p0, Lcom/samsung/dialer/impl/k;->A:Landroid/content/Context;

    check-cast v0, Landroid/app/Activity;

    invoke-virtual {v0, p1}, Landroid/app/Activity;->unregisterForContextMenu(Landroid/view/View;)V

    return-void
.end method
armatita
  • 12,825
  • 8
  • 48
  • 49
Badboy
  • 151
  • 1
  • 6
  • Please post your code here, don't link it. – Aurasphere May 14 '16 at 18:18
  • Please avoid dumping the whole thing on us and waiting for us to do all the work. You should narrow down the issue into a reasonable [MCVE](http://stackoverflow.com/help/mcve). I'm sure you can build a small isolated example of the question with a much smaller piece of code. – doug65536 May 14 '16 at 18:30
  • Formatted text with corrections. Highlighted relevant keywords. Edited the title. Inserted partial code given in link (the full code was too extensive). Removed typical "please help me" and so on sentences. – armatita May 16 '16 at 19:29
  • @Badboy The first step into obtaining a good answer is to provide a good question. This implies an effort into giving the necessary information for other SO users. I've made some changes in your question that will, hopefully, help other users into helping you. I'm not a specialist in Smali and the partial code I've inserted is the part where the ´0x7f0f0042´ appears. I do not know if this is enough so listen to other users and try to provide them with the information they need to help you. Best of luck. This was a moderation request from review (Help and Improvement). – armatita May 16 '16 at 19:38

1 Answers1

0

Android's strings have no color associated with them. Any color will typically be specified in the layout. E.g. for a TextView, the color of the text is specified with the android:textColor attribute.

You'll want to use apktool to disassemble the resources and layouts of the apk, and then find the layout file that references the string you're talking about. Assuming it's a TextView or some subclass thereof, you can then set or change the android:textColor attribute to the color you want.

JesusFreke
  • 19,784
  • 5
  • 65
  • 68