为什么 aapt dump badging 在 Linux 上不起作用

发布于 2024-09-14 04:03:35 字数 1368 浏览 6 评论 0原文

我正在使用 aapt 从 apk 中转储信息,它在 Mac 上运行良好,但在 Ubuntu 上失败。

以下是两台机器的日志:

Mac:

$ md5 test.apk 
MD5 (/Users/jlee/tmp/test.apk) = 022d63fa0e3e9f10f57550d8921088d9
$ aapt dump badging test.apk 
package: name='com.i9i8.nanopage' versionCode='46' versionName='1.2.18'
application: label='MoreGoodNews' icon='res/drawable/mushroom.png'
launchable activity name='com.i9i8.nanopage.StartupActivity'label='MoreGoodNews' icon=''
sdkVersion:'3'
targetSdkVersion:'7'
uses-permission:'android.permission.INTERNET'
uses-permission:'android.permission.ACCESS_NETWORK_STATE'
uses-permission:'android.permission.READ_PHONE_STATE'
uses-permission:'android.permission.WRITE_EXTERNAL_STORAGE'
main
other-activities
other-services
supports-screens: 'small' 'normal' 'large'
locales: '--_--' 'zh' 'en'
densities: '160' '240'

Ubuntu(10.04):

$ md5sum test.apk
022d63fa0e3e9f10f57550d8921088d9  /home/jlee/tmp/test.apk
$ aapt dump badging test.apk
ERROR getting 'android:versionName' attribute: attribute is not a string value
package: name='com.i9i8.nanopage' versionCode='46' 
$

两个 aapt 都来自最新的 android-1.6 平台,在 Linux 上是 android-1.6_r03。

我还在 Linux 上尝试了以下版本的 aapt:

android-1.5_r04-linux
android-2.0_r01-linux
android-2.1_r02-linux

它们都不起作用。

这是aapt的bug吗?还是我做错了什么?

I'm using aapt to dump info from apks, it works fine on Mac, but failed on Ubuntu.

Here is the log from the two machine:

Mac:

$ md5 test.apk 
MD5 (/Users/jlee/tmp/test.apk) = 022d63fa0e3e9f10f57550d8921088d9
$ aapt dump badging test.apk 
package: name='com.i9i8.nanopage' versionCode='46' versionName='1.2.18'
application: label='MoreGoodNews' icon='res/drawable/mushroom.png'
launchable activity name='com.i9i8.nanopage.StartupActivity'label='MoreGoodNews' icon=''
sdkVersion:'3'
targetSdkVersion:'7'
uses-permission:'android.permission.INTERNET'
uses-permission:'android.permission.ACCESS_NETWORK_STATE'
uses-permission:'android.permission.READ_PHONE_STATE'
uses-permission:'android.permission.WRITE_EXTERNAL_STORAGE'
main
other-activities
other-services
supports-screens: 'small' 'normal' 'large'
locales: '--_--' 'zh' 'en'
densities: '160' '240'

Ubuntu(10.04):

$ md5sum test.apk
022d63fa0e3e9f10f57550d8921088d9  /home/jlee/tmp/test.apk
$ aapt dump badging test.apk
ERROR getting 'android:versionName' attribute: attribute is not a string value
package: name='com.i9i8.nanopage' versionCode='46' 
$

Both aapt are from the lastest android-1.6 platform, which on Linux is android-1.6_r03.

I also tried the following version of aapt on Linux:

android-1.5_r04-linux
android-2.0_r01-linux
android-2.1_r02-linux

None of them works.

Is this a bug of aapt? Or something that I went wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

完美的未来在梦里 2024-09-21 04:03:35

好吧,我是 android 的初学者,但是,你设置了 .bashrc 文件吗?我的意思是,您是否正确设置了 android-sdk/tools 的路径,您还可以尝试使用 shell 并导航到 android-sdk/tools 文件夹,然后输入 aapt dump badging test.apk。我不认为这是你的问题,但我认为你的问题也像我的问题一样奇怪,我的问题是我安装了 android-sdk 两次,其中一个版本损坏了。因此,来自 shell 的命令工作起来很奇怪,因为路径指向旧的(损坏的)安装。
当您找到有关此问题的解决方案时,请在此处发布
谢谢

Well I am begginer at android but, did you set you .bashrc file ? I mean did you set correcly you path to android-sdk/tools , you can also try to lunch the shell and navigate to android-sdk/tools folder and after that type the aapt dump badging test.apk. I don't think that this is your problem but I think that yours problem is also strange like mine, I mine problem was that I had installed android-sdk twice and one of the versions was broken. So commands from shell worked strange because the path was pointing to the old (broken) installation.
When you find solution about this please post it here
Thanks

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文