ApkTool反编译《新浪微博》《万能钥匙》android a

2023-10-29 10:50

本文主要是介绍ApkTool反编译《新浪微博》《万能钥匙》android a,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

1、需要的材料

  1. ApkTool.jar
  2. ApkTool.bat
  3. aapt.exe  
  4. 签名工具
  5. 万能钥匙apk安装包

apktool下载地址:https://code.google.com/p/android-apktool/  必须下载最新的!

2、反编译万能钥匙

将apktool.jar 、apktool.bat 、aapt.exe 、wannengyaoshi.apk放在同一目录下。

1、反编译:在目录下打开cmd,输入apktool d wannengyaoshi.apk。将会在此目录生成wannengyaoshi文件夹。

这里提示了两个worning。

W: Cant find 9patch chunk in file: "drawable-xhdpi/ic_indication_white.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/sc_overlay_start.9.png". Renaming it to *.png.

这里非常关键,意思是图片为.9.png,却没有黑块,于是强行去掉了.9后缀,黑块指的是

例如:(这是我自己做的正常的.9图片,并不是万能钥匙里的。)上下左右四条边上的黑线,这是9png图片特有的东西。

让我们看看反编译后的图片

sc_overlay_start.png


去掉了.9的后缀,并且没有发现黑线。先不管这两个worning。

2、修改:进入生成后的wannengyaoshi目录,修改res/walue/string.xml改变应用名称“大便”。
3、回编译:在目录下打开cmd,输入apktool b wannengyaoshi。将会在wannengyaoshi/dis/下生成未签名的apk。

这里将会出现问题

D:\wannengyaoshi\res\drawable-xhdpi\ic_indication_white.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
D:\wannengyaoshi\res\drawable-hdpi\sc_overlay_start.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
D:\wannengyaoshi\res\values\styles.xml:975: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/Theme.Holo.Dialog.Alert'.

显然是这三个文件有问题。前两个是图片无法编译,第三个是xml错误。

图片的问题,上面已经提及到了,解决方法是,替换这两张图片,或者重新制作。

xml的问题,找到相应行,改为Theme.AppCompat.Dialog即可。

其实这两个问题,在eclipse下编译完全可以通过。但是apktool是不允许的。

为什么图片会没有黑线?因为开发者用特殊软件去掉了,强行骗我们,这不是.9


4、打开APKSign.exe进行签名,随便一个签名文件都可以。(不签名无法安装)

大功告成,安装后看看名称是否为大便?哈哈哈哈



-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


下面让我反编译新浪微博,提前说,回编译之后只能打开第一个启动页,然后会崩溃,目测是和签名有关系,毕竟我们没有新浪微博真正的签名文件。

第一第二步相同,你会发现worning的变多了。

W: Cant find 9patch chunk in file: "drawable-xhdpi/messages_queue_state_failed.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/empty_button_highlighted.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-xhdpi/import_video_time.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-xhdpi/messages_queue_state_failed_highlighted.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-xhdpi/empty_button_highlighted.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/messages_queue_state_failed_highlighted.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/empty_button.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/messages_queue_state_failed.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-xhdpi/empty_button.9.png". Renaming it to *.png.
此时执行第三步之前,替换以上文件已经不管用了,会出现一种新的错误,例如

D:\ApkTool\apktool\sina\res\values\public.xml:932: error: Public symbol drawable/widget_btn_up declared here is not defined.
D:\ApkTool\apktool\sina\res\values\public.xml:804: error: Public symbol drawable/widget_btn_up_d declared here is not defined.
D:\ApkTool\apktool\sina\res\values\public.xml:933: error: Public symbol drawable/widget_btn_up_sel declared here is not defined.
D:\ApkTool\apktool\sina\res\values\public.xml:805: error: Public symbol drawable/widget_edit_block_bg declared here is not defined.
D:\ApkTool\apktool\sina\res\values\public.xml:806: error: Public symbol drawable/widget_edit_block_bg_normal declared here is not defined.
D:\ApkTool\apktool\sina\res\values\public.xml:934: error: Public symbol drawable/widget_edit_block_bg_selected declared here is not defined.
D:\ApkTool\apktool\sina\res\values\public.xml:807: error: Public symbol drawable/widget_edit_icon declared here is not defined.
D:\ApkTool\apktool\sina\res\values\public.xml:935: error: Public symbol drawable/widget_edit_icon_normal declared here is not defined.
D:\ApkTool\apktool\sina\res\values\public.xml:936: error: Public symbol drawable/widget_edit_icon_selected declared here is not defined.
D:\ApkTool\apktool\sina\res\values\public.xml:2988: error: Public symbol drawable/widget_head_mask declared here is not defined.
D:\ApkTool\apktool\sina\res\values\public.xml:2989: error: Public symbol drawable/widget_icon_picture declared here is not defined.
D:\ApkTool\apktool\sina\res\values\public.xml:2990: error: Public symbol drawable/widget_icon_play declared here is not defined.
D:\ApkTool\apktool\sina\res\values\public.xml:2991: error: Public symbol drawable/widget_icon_refresh declared here is not defined.
D:\ApkTool\apktool\sina\res\values\public.xml:2992: error: Public symbol drawable/widget_icon_refresh_highlighted declared here is not defined.
D:\ApkTool\apktool\sina\res\values\public.xml:2993: error: Public symbol drawable/widget_icon_write declared here is not defined.
D:\ApkTool\apktool\sina\res\values\public.xml:2994: error: Public symbol drawable/widget_icon_write_highlighted declared here is not defined.
D:\ApkTool\apktool\sina\res\values\public.xml:2995: error: Public symbol drawable/widget_left declared here is not defined.
D:\ApkTool\apktool\sina\res\values\public.xml:2996: error: Public symbol drawable/widget_left_highlighted declared here is not defined.
D:\ApkTool\apktool\sina\res\values\public.xml:937: error: Public symbol drawable/widget_line declared here is not defined.
D:\ApkTool\apktool\sina\res\values\public.xml:2997: error: Public symbol drawable/widget_list declared here is not defined.
D:\ApkTool\apktool\sina\res\values\public.xml:938: error: Public symbol drawable/widget_logo declared here is not defined.
D:\ApkTool\apktool\sina\res\values\public.xml:808: error: Public symbol drawable/widget_logo_btn declared here is not defined.
D:\ApkTool\apktool\sina\res\values\public.xml:939: error: Public symbol drawable/widget_logo_selected declared here is not defined.
D:\ApkTool\apktool\sina\res\values\public.xml:2998: error: Public symbol drawable/widget_middle declared here is not defined.
D:\ApkTool\apktool\sina\res\values\public.xml:2999: error: Public symbol drawable/widget_middle_highlighted declared here is not defined.
D:\ApkTool\apktool\sina\res\values\public.xml:3179: error: Public symbol drawable/widget_preview declared here is not defined.
D:\ApkTool\apktool\sina\res\values\public.xml:3000: error: Public symbol drawable/widget_right declared here is not defined.
D:\ApkTool\apktool\sina\res\values\public.xml:3001: error: Public symbol drawable/widget_right_highlighted declared here is not defined.
D:\ApkTool\apktool\sina\res\values\public.xml:3002: error: Public symbol drawable/widget_top declared here is not defined.
D:\ApkTool\apktool\sina\res\values\public.xml:3003: error: Public symbol drawable/widget_top_shadow declared here is not defined.
D:\ApkTool\apktool\sina\res\values\public.xml:3180: error: Public symbol drawable/widgets_icon_info declared here is not defined.
D:\ApkTool\apktool\sina\res\values\public.xml:3181: error: Public symbol drawable/widgets_icon_logo declared here is not defined.
D:\ApkTool\apktool\sina\res\values\public.xml:3004: error: Public symbol drawable/widgets_image_default declared here is not defined.
D:\ApkTool\apktool\sina\res\values\public.xml:809: error: Public symbol drawable/yw_1222 declared here is not defined.
好多好多

没办法,只有把所有图片都替换了,但是有4000多个文件,怎么办?

这里我写了个小程序

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;public class Test {/*** @param args*/public static void main(String[] args) {// TODO Auto-generated method stubReadAllFile("res");}public static void ReadAllFile(String filePath) {  File f = null;  f = new File(filePath);  File[] files = f.listFiles(); List<File> list = new ArrayList<File>();  for (File file : files) {  if(file.isDirectory()) {  ReadAllFile(file.getAbsolutePath());  } else {  list.add(file);  }  }  for(File file : files) {  if(file.getName().indexOf(".9.png")>0){copyFile("reply_9_png.9.png", file.getPath());}else if(file.getName().indexOf(".png")>0){copyFile("reply_png.png", file.getPath());}else if(file.getName().indexOf(".gif")>0){copyFile("reply_gif.gif", file.getPath());}else if(file.getName().indexOf(".jpg")>0){copyFile("reply_jpg.jpg", file.getPath());}}  }  public static void copyFile(String oldPath, String newPath) { try { int bytesum = 0; int byteread = 0; File oldfile = new File(oldPath); if (oldfile.exists()) { InputStream inStream = new FileInputStream(oldPath); FileOutputStream fs = new FileOutputStream(newPath); byte[] buffer = new byte[1444]; int length; while ( (byteread = inStream.read(buffer)) != -1) { bytesum += byteread; fs.write(buffer, 0, byteread); } inStream.close(); } } catch (Exception e) { e.printStackTrace(); } } 
}

用4张图片,分别替换所有以.9.png、.png、.gif、.jpg为结尾的图片。

将他打包成jar,制作bat文件,运行即可。方法在这里 http://my.oschina.net/fangshaowei/blog/202892

替换了所有文件之后便可执行第三步、第四步了。




这篇关于ApkTool反编译《新浪微博》《万能钥匙》android a的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/300141

相关文章

Android使用ImageView.ScaleType实现图片的缩放与裁剪功能

《Android使用ImageView.ScaleType实现图片的缩放与裁剪功能》ImageView是最常用的控件之一,它用于展示各种类型的图片,为了能够根据需求调整图片的显示效果,Android提... 目录什么是 ImageView.ScaleType?FIT_XYFIT_STARTFIT_CENTE

Android实现在线预览office文档的示例详解

《Android实现在线预览office文档的示例详解》在移动端展示在线Office文档(如Word、Excel、PPT)是一项常见需求,这篇文章为大家重点介绍了两种方案的实现方法,希望对大家有一定的... 目录一、项目概述二、相关技术知识三、实现思路3.1 方案一:WebView + Office Onl

Android实现两台手机屏幕共享和远程控制功能

《Android实现两台手机屏幕共享和远程控制功能》在远程协助、在线教学、技术支持等多种场景下,实时获得另一部移动设备的屏幕画面,并对其进行操作,具有极高的应用价值,本项目旨在实现两台Android手... 目录一、项目概述二、相关知识2.1 MediaProjection API2.2 Socket 网络

Android实现悬浮按钮功能

《Android实现悬浮按钮功能》在很多场景中,我们希望在应用或系统任意界面上都能看到一个小的“悬浮按钮”(FloatingButton),用来快速启动工具、展示未读信息或快捷操作,所以本文给大家介绍... 目录一、项目概述二、相关技术知识三、实现思路四、整合代码4.1 Java 代码(MainActivi

Android Mainline基础简介

《AndroidMainline基础简介》AndroidMainline是通过模块化更新Android核心组件的框架,可能提高安全性,本文给大家介绍AndroidMainline基础简介,感兴趣的朋... 目录关键要点什么是 android Mainline?Android Mainline 的工作原理关键

如何解决idea的Module:‘:app‘platform‘android-32‘not found.问题

《如何解决idea的Module:‘:app‘platform‘android-32‘notfound.问题》:本文主要介绍如何解决idea的Module:‘:app‘platform‘andr... 目录idea的Module:‘:app‘pwww.chinasem.cnlatform‘android-32

Android实现打开本地pdf文件的两种方式

《Android实现打开本地pdf文件的两种方式》在现代应用中,PDF格式因其跨平台、稳定性好、展示内容一致等特点,在Android平台上,如何高效地打开本地PDF文件,不仅关系到用户体验,也直接影响... 目录一、项目概述二、相关知识2.1 PDF文件基本概述2.2 android 文件访问与存储权限2.

Android Studio 配置国内镜像源的实现步骤

《AndroidStudio配置国内镜像源的实现步骤》本文主要介绍了AndroidStudio配置国内镜像源的实现步骤,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,... 目录一、修改 hosts,解决 SDK 下载失败的问题二、修改 gradle 地址,解决 gradle

在Android平台上实现消息推送功能

《在Android平台上实现消息推送功能》随着移动互联网应用的飞速发展,消息推送已成为移动应用中不可或缺的功能,在Android平台上,实现消息推送涉及到服务端的消息发送、客户端的消息接收、通知渠道(... 目录一、项目概述二、相关知识介绍2.1 消息推送的基本原理2.2 Firebase Cloud Me

Android中Dialog的使用详解

《Android中Dialog的使用详解》Dialog(对话框)是Android中常用的UI组件,用于临时显示重要信息或获取用户输入,本文给大家介绍Android中Dialog的使用,感兴趣的朋友一起... 目录android中Dialog的使用详解1. 基本Dialog类型1.1 AlertDialog(