当前位置:操作系统 > 安卓/Android >>

Android去广告


使用Choose APK来选择一个APK文件

 

点击Decode APK之后,选择一个Decode目录

 

Decode APK按钮会自动创建与APK文件同名的目录

 

点击Find Ads来查找有广告代码的文件。可以看到上图中main_lite.xml和一些smali文件中都有广告代码。xml文件中的是布局文件,smali文件需要将其中的广告代码的网址替换就可以了。

 

点击Open File之后,可以看到

<TextView android:textStyle="bold" android:textColor="#ffcccccc" android:gravity="center" android:id="@id/ad_bk_view" android:background="#ff888888" android:focusable="false" android:focusableInTouchMode="false" android:longClickable="false" android:layout_width="fill_parent" android:layout_height="48.0dip" android:text="" android:layout_alignParentTop="true" />
    <com.admob.android.ads.AdView android:id="@id/ad" android:visibility="visible" android:layout_width="fill_parent" android:layout_height="48.0dip" android:layout_alignParentTop="true" qwad:backgroundColor="#ff000000" qwad:primaryTextColor="#ffffffff" qwad:secondaryTextColor="#ffcccccc" qwad:refreshInterval="60" />

需要将上面的改为:

<TextView android:textStyle="bold" android:textColor="#ffcccccc" android:gravity="center" android:id="@id/ad_bk_view" android:background="#ff888888" android:focusable="false" android:focusableInTouchMode="false" android:longClickable="false" android:layout_width="0dip" android:layout_height="0dip" android:text="" android:layout_alignParentTop="true" />
    <com.admob.android.ads.AdView android:id="@id/ad" android:visibility="visible" android:layout_width="0dip" android:layout_height="0dip" android:layout_alignParentTop="true" qwad:backgroundColor="#ff000000" qwad:primaryTextColor="#ffffffff" qwad:secondaryTextColor="#ffcccccc" qwad:refreshInterval="60" />

 

改动之后,保存。点击“BuildAPK”,之后点击“SignAPK”,之后,可以使用Install按钮来安装到虚拟机。

 

虚拟机上的运行效果如图。

补充:移动开发 , Android ,
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,