Closed nylonW closed 7 years ago
Have you made sure that these images are really the ones which are used? The most reliable way would be to replace them manually in the APK, sign it yourself and install it.
Once this is verified, please find out which method the app uses to access the images. Things like getDrawable()
should work fine, but maybe they use something else or even native code.
Yes, i am sure, I created APK file before. How can I use getDrawable()
in this code? How can i find that specific method in smali or xml files? Thanks for reply.
I have decompiled apk too
How can I use getDrawable() in this code?
I meant to check whether the Facebook app uses getDrawable() or something like that, not your app.
How can i find that specific method in smali or xml files?
I usually use Notepad++ to search in all files in a subdirectory. On Linux, you would obviously use grep. You should be able to find out the resource ID from public.xml (or something like that), and then you can search for it in the smali files using the tools I mentioned.
I found
const v8, 0x7f02077a
move v1, v8
invoke-virtual {v0, v7, v1, v6}, Lcom/facebook/feed/ui/BaseFeedStoryMenuHelper;-
a(Lcom/facebook/feed/ui/api/BottomsheetChevronMenuItem;ILcom/facebook/graphql/model/FeedUnit;)V
what should I do now?
and
.method protected final a(Lcom/facebook/feed/ui/api/BottomsheetChevronMenu;Lcom/facebook/feed/rows/core/props/FeedProps;Landroid/content/Context;)V
.locals 9
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/facebook/feed/ui/api/ChevronMenu;",
"Lcom/facebook/feed/rows/core/props/FeedProps",
"<",
"Lcom/facebook/graphql/model/GraphQLStory;",
">;",
"Landroid/content/Context;",
")V"
}
.end annotation
Formatting hint: Instead of a single backtick, use three backticks and also add "smali" to format a block of code and add syntax highlighting, see also https://guides.github.com/features/mastering-markdown/
The second method doesn't exactly match the one that was called with the constant (parameter types are different). Could you please post the full content of the method with the correct parameters?
.method protected final a(Lcom/facebook/feed/ui/api/BottomsheetChevronMenu;Lcom/facebook/feed/rows/core/props/FeedProps;Landroid/content/Context;)V
.locals 9
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/facebook/feed/ui/api/ChevronMenu;",
"Lcom/facebook/feed/rows/core/props/FeedProps",
"<",
"Lcom/facebook/graphql/model/GraphQLStory;",
">;",
"Landroid/content/Context;",
")V"
}
.end annotation
.prologue
.line 897
invoke-virtual {p2}, Lcom/facebook/feed/rows/core/props/FeedProps;->a()Landroid/os/Parcelable;
move-result-object v0
move-object v6, v0
check-cast v6, Lcom/facebook/graphql/model/GraphQLStory;
.line 898
const v0, 0x7f0809e8
invoke-virtual {p1, v0}, Lcom/facebook/feed/ui/api/BottomsheetChevronMenu;->g(I)Lcom/facebook/feed/ui/api/BottomsheetChevronMenuItem;
move-result-object v7
.line 899
sget-object v0, Lcom/facebook/zero/common/constants/AssistedOnboardingConst$LinkSource;->COPY_LINK:Lcom/facebook/zero/common/constants/AssistedOnboardingConst$LinkSource;
invoke-virtual {v0}, Lcom/facebook/zero/common/constants/AssistedOnboardingConst$LinkSource;->name()Ljava/lang/String;
move-result-object v4
.line 900
iget-object v0, p0, Lcom/facebook/feed/ui/BaseFeedStoryMenuHelper$BaseFeedStoryMenuOptions;->a:Lcom/facebook/feed/ui/BaseFeedStoryMenuHelper;
invoke-virtual {p1, v7}, Lcom/facebook/feed/ui/api/BottomsheetChevronMenu;->b(Lcom/facebook/feed/ui/api/BottomsheetChevronMenuItem;)I
move-result v1
const/4 v2, 0x0
invoke-virtual {v0, p2, v1, v4, v2}, Lcom/facebook/feed/ui/BaseFeedStoryMenuHelper;->a(Lcom/facebook/feed/rows/core/props/FeedProps;ILjava/lang/String;Z)V
.line 901
new-instance v0, Lcom/facebook/feed/ui/BaseFeedStoryMenuHelper$BaseFeedStoryMenuOptions$1;
move-object v1, p0
move-object v2, p2
move-object v3, p1
move-object v5, p3
invoke-direct/range {v0 .. v5}, Lcom/facebook/feed/ui/BaseFeedStoryMenuHelper$BaseFeedStoryMenuOptions$1;-><init>(Lcom/facebook/feed/ui/BaseFeedStoryMenuHelper$BaseFeedStoryMenuOptions;Lcom/facebook/feed/rows/core/props/FeedProps;Lcom/facebook/feed/ui/api/BottomsheetChevronMenu;Ljava/lang/String;Landroid/content/Context;)V
invoke-virtual {v7, v0}, Lcom/facebook/feed/ui/api/BottomsheetChevronMenuItem;->a(Lcom/facebook/feed/ui/api/ChevronMenuItem$OnChevronMenuItemClickListener;)V
.line 911
iget-object v0, p0, Lcom/facebook/feed/ui/BaseFeedStoryMenuHelper$BaseFeedStoryMenuOptions;->a:Lcom/facebook/feed/ui/BaseFeedStoryMenuHelper;
.line 94
const v8, 0x7f02077a
move v1, v8
invoke-virtual {v0, v7, v1, v6}, Lcom/facebook/feed/ui/BaseFeedStoryMenuHelper;->a(Lcom/facebook/feed/ui/api/BottomsheetChevronMenuItem;ILcom/facebook/graphql/model/FeedUnit;)V
.line 912
return-void
.end method
Thanks for protip. 0x7f02077a is my drawable
Ok, so can you post the content of this method please?
Lcom/facebook/feed/ui/BaseFeedStoryMenuHelper;->a(Lcom/facebook/feed/ui/api/BottomsheetChevronMenuItem;ILcom/facebook/graphql/model/FeedUnit;)V
As you can see, it takes your drawable ID as second argument, so I need to know what it does with it.
.method protected final a(Lcom/facebook/feed/ui/api/BottomsheetChevronMenuItem;ILcom/facebook/graphql/model/FeedUnit;)V
.locals 1
.prologue
.line 1340
invoke-virtual {p0}, Lcom/facebook/feed/ui/BaseFeedStoryMenuHelper;->i()Z
move-result v0
if-eqz v0, :cond_0
.line 1341
invoke-virtual {p1, p2}, Lcom/facebook/feed/ui/api/BottomsheetChevronMenuItem;->c(I)V
.line 1343
:cond_0
return-void
.end method
and here is full smali file http://pastebin.com/eBiTHrt5
So the ID (p2
/ second parameter) is passed on to Lcom/facebook/feed/ui/api/BottomsheetChevronMenuItem;->c(I)V
. That would be the next method to check. Could you please follow the code flow until you get to a place where the Android SDK (not Facebook-internal code) is called?
I can't find it, but i found another method of another drawable. This time my id is 0x7f021597
.method private b()V
.locals 3
.prologue
.line 129
const v0, 0x7f0d1e7a
const v1, 0x7f08090c
const v2, 0x7f021597
invoke-direct {p0, v0, v1, v2}, Lcom/facebook/reviews/ui/ReviewFeedRowView;->a(III)Lcom/facebook/feed/widget/FeedbackCustomPressStateButton;
move-result-object v0
iput-object v0, p0, Lcom/facebook/reviews/ui/ReviewFeedRowView;->s:Lcom/facebook/feed/widget/FeedbackCustomPressStateButton;
.line 135
const v0, 0x7f0d1e7b
const v1, 0x7f08090e
const v2, 0x7f021596
invoke-direct {p0, v0, v1, v2}, Lcom/facebook/reviews/ui/ReviewFeedRowView;->a(III)Lcom/facebook/feed/widget/FeedbackCustomPressStateButton;
move-result-object v0
iput-object v0, p0, Lcom/facebook/reviews/ui/ReviewFeedRowView;->t:Lcom/facebook/feed/widget/FeedbackCustomPressStateButton;
.line 139
return-void
.end method
and i think this is it
.method private a(III)Lcom/facebook/feed/widget/FeedbackCustomPressStateButton;
.locals 3
.prologue
.line 145
invoke-virtual {p0, p1}, Lcom/facebook/widget/CustomLinearLayout;->a(I)Landroid/view/View;
move-result-object v0
check-cast v0, Lcom/facebook/feed/widget/FeedbackCustomPressStateButton;
.line 146
invoke-virtual {p0}, Lcom/facebook/reviews/ui/ReviewFeedRowView;->getResources()Landroid/content/res/Resources;
move-result-object v1
invoke-virtual {v1, p2}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Lcom/facebook/feed/widget/FeedbackCustomPressStateButton;->setText(Ljava/lang/CharSequence;)V
.line 147
iget-object v1, p0, Lcom/facebook/reviews/ui/ReviewFeedRowView;->b:Lcom/facebook/fbui/glyph/GlyphColorizer;
const v2, -0x6e685d
invoke-virtual {v1, p3, v2}, Lcom/facebook/fbui/glyph/GlyphColorizer;->a(II)Landroid/graphics/drawable/Drawable;
move-result-object v1
invoke-virtual {v0, v1}, Lcom/facebook/fbui/widget/text/ImageWithTextView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V
.line 149
iget-object v1, p0, Lcom/facebook/reviews/ui/ReviewFeedRowView;->c:Ljavax/inject/Provider;
invoke-interface {v1}, Ljavax/inject/Provider;->get()Ljava/lang/Object;
move-result-object v1
check-cast v1, Lcom/facebook/widget/springbutton/TouchSpring;
invoke-virtual {v0, v1}, Lcom/facebook/feed/widget/FeedbackCustomPressStateButton;->setSpring(Lcom/facebook/widget/springbutton/TouchSpring;)V
.line 150
return-object v0
.end method
what now?
Well, like I said - follow it down to a call to the Android SDK. This should be the next hop:
invoke-virtual {v1, p3, v2}, Lcom/facebook/fbui/glyph/GlyphColorizer;->a(II)Landroid/graphics/drawable/Drawable;
i am using this
and text is replacing but images are same as before