apktool 簡單使用記錄

来源:https://www.cnblogs.com/guobaoxu/archive/2019/04/22/10750977.html
-Advertisement-
Play Games

修改APP:車來了 修改內容:首次啟動引導頁,中間的點素材修改、樣式修改 修改前:未選中為白色,選中為藍色,間距為5dip 修改後:未選中為紅色,選中為黑色,間距為0 前後截圖如下: 修改過程: 一、使用apktool反編譯apk apktool安裝根據官網進行:https://ibotpeache ...


修改APP:車來了

修改內容:首次啟動引導頁,中間的點素材修改、樣式修改

修改前:未選中為白色,選中為藍色,間距為5dip

修改後:未選中為紅色,選中為黑色,間距為0

前後截圖如下:

 

修改過程:

一、使用apktool反編譯apk

apktool安裝根據官網進行:https://ibotpeaches.github.io/Apktool/install/

具體操作:

0.首先確保使用java 1.8或以上

1.下載運行腳本並重命名為apktool.bat,下載地址(官網):https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/windows/apktool.bat

2.下載最新的apktool並重命名為apktool.jar,下載地址:https://bitbucket.org/iBotPeaches/apktool/downloads/

3.放在一個文件夾,雙擊運行apktool.bat,會輸出用法

4.反編譯apk,命令格式:apktool d [ apk文件名 ]

Apktool v2.4.0 - a tool for reengineering Android apk fileswith smali v2.2.6 and baksmali v2.2.6
Copyright 2014 Ryszard WiÅ›niewski <[email protected]>
Updated by Connor Tumbleson <[email protected]>

usage: apktool
 -advance,--advanced   prints advance information.
 -version,--version    prints the version then exits
usage: apktool if|install-framework [options] <framework.apk>
 -p,--frame-path <dir>   Stores framework files into <dir>.
 -t,--tag <tag>          Tag frameworks using <tag>.
usage: apktool d[ecode] [options] <file_apk>
 -f,--force              Force delete destination directory.
 -o,--output <dir>       The name of folder that gets written. Default is apk.ou
t
 -p,--frame-path <dir>   Uses framework files located in <dir>.
 -r,--no-res             Do not decode resources.
 -s,--no-src             Do not decode sources.
 -t,--frame-tag <tag>    Uses framework files tagged by <tag>.
usage: apktool b[uild] [options] <app_path>
 -f,--force-all          Skip changes detection and build all files.
 -o,--output <dir>       The name of apk that gets written. Default is dist/name
.apk
 -p,--frame-path <dir>   Uses framework files located in <dir>.

For additional info, see: http://ibotpeaches.github.io/Apktool/
For smali/baksmali info, see: https://github.com/JesusFreke/smali

C:\Users\Administrator>cd C:\Users\apk所在文件夾

C:\Users\apk所在文件夾>apktool d chelaile.apk
I: Using Apktool 2.4.0 on chelaile.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
S: WARNING: Could not write to (C:\Users\Administrator\AppData\Local\apktool\framework), using C:\Users\Administrator\AppData\Local\Temp\ instead...
S: Please be aware this is a volatile directory and frameworks could go missing, please utilize --frame-path if the default storage directory is unavailable
I: Loading resource table from file: C:\Users\Administrator\AppData\Local\Temp\1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Baksmaling classes2.dex...
I: Baksmaling classes3.dex...
I: Baksmaling classes4.dex...
I: Baksmaling assets/AdDex.3.1.0.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...

得到了文件夾chelaile,裡面有如下文件:

二、尋找和修改

這裡是純粹的憑感覺在搞了

AndroidManifesr.xml  找到<category android:name="android.intent.category.LAUNCHER"/>

猜測啟動頁面應該是SplashActivity,將其作為本次修改的對象

=> SplashActivity.smali 找到sget p1, Ldev/xesam/chelaile/core/R$layout;->cll_act_splash:I

猜測對應佈局文件為cll_act_splash

=> cll_act_splash.xml 發現用了自定義組件GuideView,而且預設設置為gone,在smali文件中有invoke-virtual {v0, v1}, Ldev/xesam/chelaile/app/module/func/GuideView;->setVisibility(I)V,進一步猜測是首次啟動才會出現

=> GuideView.smali 找到sget p2, Ldev/xesam/chelaile/core/R$layout;->cll_act_guide:I,猜測對應佈局文件為cll_act_guide.xml

=> cll_act_guide.xml裡面三個ImageView,應該就是三個點,

根據android:src="@drawable/indicate_dot" 得到對應素材,直接做修改保存;

刪除android:padding="5.0dip"(由於這裡的修改引起了頁面中其他元素在顯示上也有變化)

三、重新打包

命令格式:apktool b [ 剛纔得到的文件夾 ] -o [ 輸出文件名 ]

C:\Users\apk所在文件夾>apktool b chelaile -o newcll.apk
I: Using Apktool 2.4.0
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether sources has changed...
I: Smaling smali_assets folder into assets.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes2 folder into classes2.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes3 folder into classes3.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes4 folder into classes4.dex...
I: Checking whether resources has changed...
I: Building resources...
S: WARNING: Could not write to (C:\Users\Administrator\AppData\Local\apktool\framework), using C:\Users\Administrator\AppData\Local\Temp\ instead...
S: Please be aware this is a volatile directory and frameworks could go missing, please utilize --frame-path if the default storage directory is unavailable
W: warning: string 'cll_aboard_user_contribution_empty_desc' has no default translation.
W: warning: string 'rc_voice_dialog_cancel_send' has no default translation.
W: warning: string 'rc_voice_dialog_swipe' has no default translation.
W: warning: string 'rc_voice_dialog_time_short' has no default translation.
I: Copying libs... (/lib)
I: Building apk file...
I: Copying unknown files/dir...
I: Built apk...

出現了一些warning,但是問題不大,第一次使用,就不怎麼糾結他了

到這裡得到了一個apk,但是不能用,需要簽名才能正常安裝

四、重新簽名

用Auto-sign重新簽名,這裡參考了一個博客,原文鏈接:https://blog.csdn.net/sxk874890728/article/details/80486223

下載解壓Auto-sign,得到的auto-sign文件夾下有以下文件

將上一步得到的newcll.apk拷貝到解壓好的auto-sign文件夾下,執行命令:

java -jar signapk.jar testkey.x509.pem testkey.pk8 newcll.apk cll_signed.apk

就得到了最終可安裝使用的apk


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 更改表結構: alter TABLE 表1 ALTER COLUMN 列名1 NCHAR(40) ...
  • 一、常用sql 1.1幫助命令 1.2SQL語言分類 1.3普通常用命令 1.4TRUNCATE與DELTE區別 二、備份與恢復 2.1mysqldump進行資料庫備份 2.2備份表 2.3備份資料庫表結構(不包含數據) 2.4備份資料庫表數據(不包含表結構) 2.5同時將數據和表結構分離導出 2. ...
  • 1. 背景 SQL Server 搭建AlwaysOn後,我們就希望程式連接時使用虛擬的偵聽IP(Listener IP),而不再是主Server 的IP。如果我們有採用中間件,則可以在配置中,直接用Listener IP 替換掉 Server IP,可有時候,我們不太確定,是否有些舊程式、不太常用 ...
  • this for oracle18c ,other version c##hr transform hr. is end. ...
  • 問題描述: 在IDEA+MySQL+Tomcat 實現登錄註冊JSP的註冊信息INSERT驗證時出現 Cannot resolve query parameter '2' 貼上創建鏈接的代碼: 運行起來顯示 資料庫連接異常 查看異常顯示 The origin server did not find ...
  • Redis 是一個開源的,使用 ANSI C (C語言)編寫,高性能的 Key-Value(鍵值對) 的 NoSQL 資料庫 NoSQL = Not Only SQL,意即“不僅僅是SQL”,是一項全新的資料庫革命性運動,早期就有人提出,發展至2009年趨勢越發高漲。NoSQL 的擁護者們提倡運用非 ...
  • 我們在進行安卓開發的時候,首頁開有兩種方式,一種是利用handler將一個活動進行延時,時間到達之後軟體則會跳轉到第二個活動當中。而另一種方法則是更加常用的方法,利用splash實現首頁的快速開屏,這種開屏方式比handler的方式傳入圖片的速度更快,出現白屏的時間更少,也是谷歌在2018開發者大會 ...
  • 版權聲明:本文為HaiyuKing原創文章,轉載請註明出處! 前言 記錄自定義EditText控制項實現監聽軟鍵盤隱藏事件的功能。基本上和參考資料相同。 效果圖 代碼分析 自定義EditText子類,然後重寫onKeyPreIme方法 使用步驟 一、項目組織結構圖 註意事項: 1、 導入類文件後需要c ...
一周排行
    -Advertisement-
    Play Games
  • 示例項目結構 在 Visual Studio 中創建一個 WinForms 應用程式後,項目結構如下所示: MyWinFormsApp/ │ ├───Properties/ │ └───Settings.settings │ ├───bin/ │ ├───Debug/ │ └───Release/ ...
  • [STAThread] 特性用於需要與 COM 組件交互的應用程式,尤其是依賴單線程模型(如 Windows Forms 應用程式)的組件。在 STA 模式下,線程擁有自己的消息迴圈,這對於處理用戶界面和某些 COM 組件是必要的。 [STAThread] static void Main(stri ...
  • 在WinForm中使用全局異常捕獲處理 在WinForm應用程式中,全局異常捕獲是確保程式穩定性的關鍵。通過在Program類的Main方法中設置全局異常處理,可以有效地捕獲並處理未預見的異常,從而避免程式崩潰。 註冊全局異常事件 [STAThread] static void Main() { / ...
  • 前言 給大家推薦一款開源的 Winform 控制項庫,可以幫助我們開發更加美觀、漂亮的 WinForm 界面。 項目介紹 SunnyUI.NET 是一個基於 .NET Framework 4.0+、.NET 6、.NET 7 和 .NET 8 的 WinForm 開源控制項庫,同時也提供了工具類庫、擴展 ...
  • 說明 該文章是屬於OverallAuth2.0系列文章,每周更新一篇該系列文章(從0到1完成系統開發)。 該系統文章,我會儘量說的非常詳細,做到不管新手、老手都能看懂。 說明:OverallAuth2.0 是一個簡單、易懂、功能強大的許可權+可視化流程管理系統。 有興趣的朋友,請關註我吧(*^▽^*) ...
  • 一、下載安裝 1.下載git 必須先下載並安裝git,再TortoiseGit下載安裝 git安裝參考教程:https://blog.csdn.net/mukes/article/details/115693833 2.TortoiseGit下載與安裝 TortoiseGit,Git客戶端,32/6 ...
  • 前言 在項目開發過程中,理解數據結構和演算法如同掌握蓋房子的秘訣。演算法不僅能幫助我們編寫高效、優質的代碼,還能解決項目中遇到的各種難題。 給大家推薦一個支持C#的開源免費、新手友好的數據結構與演算法入門教程:Hello演算法。 項目介紹 《Hello Algo》是一本開源免費、新手友好的數據結構與演算法入門 ...
  • 1.生成單個Proto.bat內容 @rem Copyright 2016, Google Inc. @rem All rights reserved. @rem @rem Redistribution and use in source and binary forms, with or with ...
  • 一:背景 1. 講故事 前段時間有位朋友找到我,說他的窗體程式在客戶這邊出現了卡死,讓我幫忙看下怎麼回事?dump也生成了,既然有dump了那就上 windbg 分析吧。 二:WinDbg 分析 1. 為什麼會卡死 窗體程式的卡死,入口門檻很低,後續往下分析就不一定了,不管怎麼說先用 !clrsta ...
  • 前言 人工智慧時代,人臉識別技術已成為安全驗證、身份識別和用戶交互的關鍵工具。 給大家推薦一款.NET 開源提供了強大的人臉識別 API,工具不僅易於集成,還具備高效處理能力。 本文將介紹一款如何利用這些API,為我們的項目添加智能識別的亮點。 項目介紹 GitHub 上擁有 1.2k 星標的 C# ...