学习smali
添加控件id
在R$id.smali文件下添加:
.field public static final adposition:I = 0x7f05003d
添加类中常量
MainActivity.smali文件下添加:
# static fields
.field public static final InlinePPID:Ljava/lang/String; = "16TLwebvAchksY6iO_8oSb-i"
.field public static final PUBLISHER_ID:Ljava/lang/String; = "56OJyM1ouMGoaSnvCK"
添加多盟广告
.line 16
const v2, 0x7f05003d
invoke-virtual {p0, v2}, Lcom/example/adtest/MainActivity;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Landroid/widget/RelativeLayout;
.line 17
.local v0, ad:Landroid/widget/RelativeLayout;
new-instance v1, Lcn/domob/android/ads/DomobAdView;
const-string v2, "56OJyM1ouMGoaSnvCK"
const-string v3, "16TLwebvAchksY6iO_8oSb-i"
invoke-direct {v1, p0, v2, v3}, Lcn/domob/android/ads/DomobAdView;-><init>(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V
.line 18
.local v1, mAdview:Lcn/domob/android/ads/DomobAdView;
invoke-virtual {v0, v1}, Landroid/widget/RelativeLayout;->addView(Landroid/view/View;)V
posted on 2014-07-06 22:43 clarenceV1 阅读(473) 评论(0) 编辑 收藏 举报