{"action":"created","issue":{"url":"https://api.github.com/repos/rover12421/ShakaApktool/issues/34","labels_url":"https://api.github.com/repos/rover12421/ShakaApktool/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/rover12421/ShakaApktool/issues/34/comments","events_url":"https://api.github.com/repos/rover12421/ShakaApktool/issues/34/events","html_url":"https://github.com/rover12421/ShakaApktool/issues/34","id":117959510,"number":34,"title":"resource spec ID","user":{"login":"pwelyn","id":916680,"avatar_url":"https://avatars.githubusercontent.com/u/916680?v=3","gravatar_id":"","url":"https://api.github.com/users/pwelyn","html_url":"https://github.com/pwelyn","followers_url":"https://api.github.com/users/pwelyn/followers","following_url":"https://api.github.com/users/pwelyn/following{/other_user}","gists_url":"https://api.github.com/users/pwelyn/gists{/gist_id}","starred_url":"https://api.github.com/users/pwelyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pwelyn/subscriptions","organizations_url":"https://api.github.com/users/pwelyn/orgs","repos_url":"https://api.github.com/users/pwelyn/repos","events_url":"https://api.github.com/users/pwelyn/events{/privacy}","received_events_url":"https://api.github.com/users/pwelyn/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-20T03:43:40Z","updated_at":"2015-11-20T10:22:15Z","closed_at":"2015-11-20T10:22:15Z","body":"经过测试使用HEX打开resources.arsc,查找对drawable或string对应值t=0x03修改为0x01或0x02都可以导致反编译失败出现以下错误日志:\r\n```javascript\r\nception in thread \"main\" brut.androlib.err.UndefinedResObject: resource spec: 0x7f000005\r\n  at brut.androlib.res.data.ResPackage.getResSpec_aroundBody0(ResPackage.java:59)\r\n  at brut.androlib.res.data.ResPackage$AjcClosure1.run(ResPackage.java:1)\r\n  at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:221)\r\n  at com.rover12421.shaka.apktool.lib.ResPackageAj.getResSpec(ResPackageAj.java:41)\r\n  at brut.androlib.res.data.ResPackage.getResSpec(ResPackage.java:56)\r\n  at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:65)\r\n  at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:61)\r\n  at brut.androlib.res.data.value.ResReferenceValue.getReferent(ResReferenceValue.java:57)\r\n  at brut.androlib.res.data.value.ResReferenceValue.encodeAsResXml(ResReferenceValue.java:47)\r\n  at brut.androlib.res.data.value.ResScalarValue.encodeAsResXmlValue(ResScalarValue.java:58)\r\n  at brut.androlib.res.data.value.ResScalarValue.serializeToResValuesXml(ResScalarValue.java:75)\r\n  at brut.androlib.res.AndrolibResources.generateValuesFile(AndrolibResources.java:502)\r\n  at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:252)\r\n  at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:136)\r\n  at brut.androlib.ApkDecoder.decode(ApkDecoder.java:102)\r\n  at brut.apktool.Main.cmdDecode(Main.java:165)\r\n  at brut.apktool.Main.main(Main.java:81)\r\n  at com.rover12421.shaka.cli.Main.main(Main.java:95)\r\n```\r\n```\r\naapt d resources test.apk\r\nPackage Groups (1)\r\nPackage Group 0 id=0x7f packageCount=1 name=com.example.myapp\r\n  Package 0 id=0x7f name=com.example.myapp\r\n    type 1 configCount=4 entryCount=1\r\n      spec resource 0x7f020000 com.example.myapp:drawable/ic_launcher: flags=0x00000100\r\n      config ldpi-v4:\r\n        resource 0x7f020000 com.example.myapp:drawable/ic_launcher: t=0x03 d=0x00000001 (s=0x0008 r=0x00)\r\n      config mdpi-v4:\r\n        resource 0x7f020000 com.example.myapp:drawable/ic_launcher: t=0x03 d=0x00000002 (s=0x0008 r=0x00)\r\n      config hdpi-v4:\r\n        resource 0x7f020000 com.example.myapp:drawable/ic_launcher: t=0x03 d=0x00000003 (s=0x0008 r=0x00)\r\n      config xhdpi-v4:\r\n        resource 0x7f020000 com.example.myapp:drawable/ic_launcher: t=0x03 d=0x00000004 (s=0x0008 r=0x00)\r\n    type 2 configCount=1 entryCount=1\r\n      spec resource 0x7f030000 com.example.myapp:layout/main: flags=0x00000000\r\n      config (default):\r\n        resource 0x7f030000 com.example.myapp:layout/main: t=0x03 d=0x00000000 (s=0x0008 r=0x00)\r\n    type 3 configCount=1 entryCount=1\r\n      spec resource 0x7f040000 com.example.myapp:string/app_name: flags=0x00000000\r\n      config (default):\r\n        resource 0x7f040000 com.example.myapp:string/app_name: t=0x02 d=0x00000005 (s=0x0008 r=0x00)\r\n```\r\n**t=0x02**或**t=0x01**都会出现上面错误，**t=0x00**或**t=0x03**不会其他值没有测试\r\n\r\n测试app地址：http://pan.baidu.com/s/1c0nx0Tq\r\n"},"comment":{"url":"https://api.github.com/repos/rover12421/ShakaApktool/issues/comments/158349539","html_url":"https://github.com/rover12421/ShakaApktool/issues/34#issuecomment-158349539","issue_url":"https://api.github.com/repos/rover12421/ShakaApktool/issues/34","id":158349539,"user":{"login":"rover12421","id":2737135,"avatar_url":"https://avatars.githubusercontent.com/u/2737135?v=3","gravatar_id":"","url":"https://api.github.com/users/rover12421","html_url":"https://github.com/rover12421","followers_url":"https://api.github.com/users/rover12421/followers","following_url":"https://api.github.com/users/rover12421/following{/other_user}","gists_url":"https://api.github.com/users/rover12421/gists{/gist_id}","starred_url":"https://api.github.com/users/rover12421/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rover12421/subscriptions","organizations_url":"https://api.github.com/users/rover12421/orgs","repos_url":"https://api.github.com/users/rover12421/repos","events_url":"https://api.github.com/users/rover12421/events{/privacy}","received_events_url":"https://api.github.com/users/rover12421/received_events","type":"User","site_admin":false},"created_at":"2015-11-20T10:22:15Z","updated_at":"2015-11-20T10:22:15Z","body":"遇到这样的包,只能执行判断.\r\n针对你的这个样本,添加了简单的字符串资源较真来解决. 可以查看: f235496c950897369f1e3fb58d8be875e525224d\r\n\r\n也可以使用 `-ir` 参数来忽略错误.新增加了encodeAsResXml 错误的忽略. e30c8e8d6e10cc76e15edf493f2e1cffb847b20c\r\n\r\n也可以使用 `-fui` 来正常反编译,然后手动判断是否纠正或是删除带`FuckUnkownId`的资源,然后回编译"}}