AXMLPrinter2.jar查看apk中的布局xml文件

1.用 AXMLPrinter2.jar查看apk中的布局xml文件:(注意事实证明不如apktool工具好,它能生成完整的资源文件包括xml)

将ApkInstaller应用生成的ApkInstaller.apk(为了方便起见放到tools目录里)用WinRAR等工具打开,将res/layout/main.xml解压出来(也还是放在tools目录里哦)

打开main.xml文件,内容如下(一堆天文):

这时候AXMLPrinter2.jar派上用场了,打开cmd终端,一直进入到tools目录下,输入如下命令:

java -jar AXMLPrinter2.jar main.xml > main.txt. (如下图所示)

打开main.txt代码如下(是不是有个123了呵呵~):

view plaincopy to clipboardprint?
<?xml version="1.0" encoding="utf-8"?>  
<LinearLayout  
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="1"
    android:layout_width="-1"
    android:layout_height="-1"
    >  
    <WebView  
        android:id="@7F050000"
        android:layout_width="-1"
        android:layout_height="-2"
        >  
    </WebView>  
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="1"
android:layout_width="-1"
android:layout_height="-1"
>
<WebView
   android:id="@7F050000"
   android:layout_width="-1"
   android:layout_height="-2"
   >
</WebView>
</LinearLayout>

为了比对打开源程序中的main.xml代码如下(大家比对一下吧):

view plaincopy to clipboardprint?
<?xml version="1.0" encoding="utf-8"?>  
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >  
<WebView  
    android:id="@+id/apk_web"
    android:layout_height="wrap_content"
    android:layout_width="fill_parent"
      
/>  
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<WebView
android:id="@+id/apk_web"
android:layout_height="wrap_content"
android:layout_width="fill_parent"

/>
</LinearLayout>

Related posts:

转载于:https://www.cnblogs.com/Bluze/p/3229347.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值