当前位置: 首页 > news >正文

高德解包和打包报错

解包和打包报错

解包报错

PS D:\code\amapauto-editor\resources> java -jar apktool.jar d gaode.apk -f
I: Using Apktool 2.12.1 on gaode.apk with 8 threads
I: Baksmaling classes.dex...
I: Loading resource table...
I: Decoding file-resources...
I: Loading resource table from file: C:\Users\Administrator\AppData\Local\apktool\framework\1.apk
S: Could not decode file, replacing by FALSE value: anim/abc_slide_in_bottom.xml
S: Could not decode file, replacing by FALSE value: anim/abc_fade_in.xml
S: Could not decode file, replacing by FALSE value: anim/abc_slide_in_top.xml
S: Could not decode file, replacing by FALSE value: anim/activity_enter.xml
S: Could not decode file, replacing by FALSE value: anim/activity_exit.xml
S: Could not decode file, replacing by FALSE value: anim/abc_slide_out_top.xml
S: Could not decode file, replacing by FALSE value: anim/abc_fade_out.xml
S: Could not decode file, replacing by FALSE value: anim/abc_slide_out_bottom.xml
I: Decoding values */* XMLs...
I: Decoding AndroidManifest.xml with resources...
I: Copying original files...

打包报错

PS D:\code\amapauto-editor\resources> java -jar apktool.jar b gaode
I: Using Apktool 2.12.1 on gaode.apk with 8 threads
I: Checking whether sources have changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources have changed...
I: Building resources with aapt2...
W: D:\code\amapauto-editor\resources\gaode\res\values\anims.xml:3: error: invalid value for type 'anim'. Expected a reference.
W: D:\code\amapauto-editor\resources\gaode\res\values\anims.xml:4: error: invalid value for type 'anim'. Expected a reference.
W: D:\code\amapauto-editor\resources\gaode\res\values\anims.xml:5: error: invalid value for type 'anim'. Expected a reference.
W: D:\code\amapauto-editor\resources\gaode\res\values\anims.xml:6: error: invalid value for type 'anim'. Expected a reference.
W: D:\code\amapauto-editor\resources\gaode\res\values\anims.xml:7: error: invalid value for type 'anim'. Expected a reference.
W: D:\code\amapauto-editor\resources\gaode\res\values\anims.xml:8: error: invalid value for type 'anim'. Expected a reference.
W: D:\code\amapauto-editor\resources\gaode\res\values\anims.xml:9: error: invalid value for type 'anim'. Expected a reference.
W: D:\code\amapauto-editor\resources\gaode\res\values\anims.xml:10: error: invalid value for type 'anim'. Expected a reference.
W: D:\code\amapauto-editor\resources\gaode\res\values\anims.xml: error: file failed to compile.
Exception in thread "main" brut.androlib.exceptions.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\ADMINI~1\AppData\Local\Temp\brut_util_Jar_49951423408581740395031504976716335730.tmp, compile, --dir, D:\code\amapauto-editor\resources\gaode\res, --legacy, -o, D:\code\amapauto-editor\resources\gaode\build\resources.zip]at brut.androlib.AaptInvoker.invoke(SourceFile:105)at brut.androlib.ApkBuilder.buildResources(SourceFile:328)at brut.apktool.Main.main(SourceFile:96)
Caused by: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\ADMINI~1\AppData\Local\Temp\brut_util_Jar_49951423408581740395031504976716335730.tmp, compile, --dir, D:\code\amapauto-editor\resources\gaode\res, --legacy, -o, D:\code\amapauto-editor\resources\gaode\build\resources.zip]at brut.util.OS.exec(SourceFile:148)at brut.androlib.AaptInvoker.invoke(SourceFile:101)... 2 more

最终结论梳理

所以最后的出的结论是,apk解包的时候,apktool就会把apk打包所需的framework安装到本机上,比如windows在C:\Users\Administrator\AppData\Local\apktool\framework\1.apk。
所以不会存在版本不匹配问题!

编译出错,缺少资源是因为个别apk做了混淆或主动优化等导致,大部分的解包打包工具,都会内置对这些部分apk打包前的资源处理

Framework管理

  • 自动安装:Apktool在解包时自动安装所需framework到 C:\Users\Administrator\AppData\Local\apktool\framework\1.apk
  • 版本匹配:不会出现framework版本不匹配问题
  • 缓存重用:同版本APK共用已安装的framework

资源问题的本质

  • 不是Apktool的bug:而是APK自身的构建特性
  • 商业APK的常见策略
    • 资源混淆和优化
    • 动态资源加载
    • 多设备适配残留
    • 构建工具链差异

专业解包和打包工具的应对方案

// 商业化工具的内置修复逻辑
const builtInFixes = {'高德地图': () => fixAmapSpecificIssues(),'腾讯系APK': () => fixTencentResourceRefs(), '阿里系APK': () => fixAliResourcePatterns(),'通用修复': () => fixCommonXmlErrors()
};

用户体验目标

  • 零配置:用户不需要懂framework、资源修复
  • 自动处理:工具内置各种常见APK的修复规则
  • 透明操作:在后台静默处理,只给用户成功/失败的结果

这就是为什么像APK Easy Tool、MT Manager这类工具能够"一键解包打包"的原因,它们都在底层内置了这些修复逻辑!

现在你可以 confidently 告诉用户:"这是正常现象,我们的工具会自动处理"。

http://www.hskmm.com/?act=detail&tid=21402

相关文章:

  • Python 中的上下文管理器与 `with` 语句全解析
  • 用友U8Api 接口对接
  • 填坑:VC++ 采用OpenSSL 3.0接口方式生成RSA密钥 - 教程
  • JUC:AQS
  • CF1980F2 Field Division (hard version) 题解
  • JUC:ThreadLocal
  • 广义串并联图とP6790 [SNOI2020] 生成树
  • JUC: Java对象内存布局和对象头
  • Manim实现波浪形文字特效
  • JUC: synchronized与锁升级
  • lang / philipino / feilvbin / taglog / tajialu
  • Windows上安装2个不同版本的MySQL5.7和8.4
  • cron表达式,每月1号凌晨3点执行和每周4凌晨3点半执行
  • 2025.9.30
  • C#/.NET/.NET Core技术前沿周刊 | 第 56 期(2025年9.22-9.28)
  • 反转链表
  • 天津港口海鲜之旅全攻略(2025最新版)
  • tomcat创建bat启动,结合任务计划实现自动重启tomcat服务 - 详解
  • 实用指南:【论文精读】Few-Shot Object Detection with Attention-RPN and Multi-Relation Detector
  • Chromium V8类型混淆漏洞CVE-2025-10585安全分析
  • Claude 4.5 刚刚发布,能连肝 30 多个小时,史上最卷 AI 诞生
  • 香橙派5pro驱动开发(一)
  • Python 脚本遇到 SSL 证书问题
  • sa-token开发时遇到的问题
  • HR如何摆脱入离职事务性内耗?组织管理系统助力聚焦人才价值挖掘
  • 基于SpringAI构建大模型应用
  • C# TCP - 串口转发 - 实践
  • 【研发规范】Git 提交(commit)、CodeReview规范
  • PCIE 各个管脚的作用是什么?
  • Windows 11 局域网打印机共享设置