kuter007 / android-apktool

Automatically exported from code.google.com/p/android-apktool
Other
0 stars 0 forks source link

Missing attribute in string-array Tag #677

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello,
Can any one please confirm if this is a issue on the latest apk tool

What steps will reproduce the problem?
1. ./apktool d ApkTool_Testapp.apk
2. ./apktool b ApkTool_Testapp -o test.apk
3.  ApkTool_Testapp\res\values\arrays.xml does not have translatable="false" 
attribute

What is the expected output? What do you see instead?
expected arrays.xml -> <string-array name="problem" translatable="false">
Output arrays.xml ->  <string-array name="problem"> 

What version of the product are you using? On what operating system?
Os: Linux
Installed: https://code.google.com/p/android-apktool/downloads/list
used: apktool_2.0.0rc1.jar

Thank you :)

Original issue reported on code.google.com by rohitrao...@gmail.com on 15 Sep 2014 at 5:58

Attachments:

GoogleCodeExporter commented 9 years ago
I was under the impression that translatable="false" was stripped by AAPT 
during compile, so it wouldn't even be available to find during decode.

I believe this still stands. I will double check.

Original comment by connor.tumbleson on 18 Sep 2014 at 4:53

GoogleCodeExporter commented 9 years ago
Thanks for the information,

The content of the apk is something like this

<string-array name="problem" translatable="false">
<item>category=temp%temp%arbit</item>
</string-array>

if i try to rebuild the apk after decoding this error comes up:

ApkTool_Testapp/res/values/arrays.xml:4: 
error: Multiple substitutions specified in non-positional format; did you mean 
to add the formatted="false" attribute?

after manually adding translatable="false" attribute in xml file,  i am able to 
rebuild the apk from the decoded apk. 

http://stackoverflow.com/questions/4414389/android-xml-percent-symbol

Original comment by rohitrao...@gmail.com on 19 Sep 2014 at 4:07

Attachments:

GoogleCodeExporter commented 9 years ago
That error has nothing to do with translatable. Its because the % sign isn't 
escaped which means it thinks its a variable substitution instead of a literal 
% sign.

formatted="false" would fix this as well. Or double %%.  

Original comment by connor.tumbleson on 19 Sep 2014 at 11:56

GoogleCodeExporter commented 9 years ago
I understand,

such apks cannot be recompiled without manually modifying the xml files,
problem is, i cannot modify the xmls manually.

would you recommend that i modify my local apktool to add % in this usecase.

Thanks for your help :)  

Original comment by rohitrao...@gmail.com on 20 Sep 2014 at 1:39

GoogleCodeExporter commented 9 years ago
https://github.com/iBotPeaches/Apktool/pull/91

I believe that fixes it. Passed it off to someone to double check. Will merge 
into mainline tomorrow if all checks out.

Original comment by connor.tumbleson on 22 Sep 2014 at 11:29

GoogleCodeExporter commented 9 years ago
https://github.com/iBotPeaches/Apktool/commit/cf443b10972ca82e00abd15477e8961e6a
d62739

Original comment by connor.tumbleson on 23 Sep 2014 at 12:50