Whitespace collapsing, Backslash escaping, Quoted escaping not implemented
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Start by reading the Android string-resource escaping guidance linked in the issue, then reproduce the examples by decompiling and rebuilding the attached APK with the documented APKEditor commands. Trace the string handling in both the decompile and build paths; the issue does not name source files or tests. Done means the examples preserve or interpret whitespace, backslashes, quotes, and escape sequences compatibly with Android resource strings.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
Whitespace collapsing, Backslash escaping, Quoted escaping not implemented in APKEditor
See this link for how it should behave: https://developer.android.com/guide/topics/resources/string-resource#escaping_quotes
Build examples:
| Input string given to APKEditor to build | Expected text displayed in app | Current text displayed in app |
|---|---|---|
Whitespace collapsed |
Whitespace collapsed | Whitespace collapsed |
Unicode: \u00A9 |
Unicode: © | Unicode: \u00A9 |
"That's cool!" |
That's cool! | "That's cool!" |
That's cool! |
Compile Error |
That's cool! |
Backslash (\\) (\) |
Backslash (\) () | Backslash (\\) (\) |
Decompile example: (❌ incorrect, ✅ correct)
| String in android studio | Expected string extracted from apk (mutiple correct examples) | String extracted from apk by APKEditor | String Extracted from apk by apktool |
|---|---|---|---|
"Tab ulated" |
Tab\u0009ulated Tab\tulated "Tab ulated" |
❌ Tab ulated |
✅ Tab\u0009ulated |
\'single\' |
\'single\' "'single'" "\'single\'" |
❌ 'single' |
✅ "'single'" |
"\"double\"" |
"\"double\"" \"double\" |
❌ "double" |
✅ \"double\" |
(\\) (\) |
(\\) () |
❌ (\) () |
✅ (\\) () |
\u00A9 |
\u00A9 © © |
✅ © |
✅ © |
To Reproduce
Steps to reproduce the behavior:
- Used version '1.2.6'
- Operating system 'Linux 5.15.90.1-microsoft-standard-WSL2 x86_64 GNU/Linux'
- Commands
java -jar APKEditor-1.2.6.jar d -dex -i app-debug.apkandjava -jar APKEditor-1.2.6.jar b -i app-debug_decompile_xml -o packed.apk
See the original strings used to build the apk at strings (original)
See the expected output in image strings (original) built with android studio
I also attached the output produced by apktool for reference strings (apktool decompilation output). The decompiled strings created by apktool are different than strings (original) but that is not a problem, as both XML files produce the same apk as seen on images strings (original) built with android studio and strings (apktool decompilation output) built with android studio
Problem 1: The output produced by unpacking with APKEditor is not compatible with the format that other tools such as android studio expect.
To reproduce unpack the attached apk. The unpacked strings.xml is not compatible with the format that Android Studio accepts. When trying to build my example apk I get an error due to the unescaped single quotes '. After escaping the single quotes with a backslash \ and building the app I get the output seen in the attached image strings (APKEditor decompilation output manually edited to escape single quotes) built with android studio.
Problem 2: The APKEditor packer doesn't recognise backslash \ escape codes and double quoted escapes as its input.
To reproduce unpack the attached apk. Edit the strings.xml to the attached strings (original) then pack/build with APKEditor. The built apk will produce the output shown in the image strings (original) packed with APKEditor with is not correct.
Used apk file
app-debug.apk.zip
Attached XML
strings (original)
<string name="test_string">Android escape and quotation test
\n"Tab\tulated 1"
\n"Tab ulated 2"
\nTab\tulated 3
\nTab ulated 4
\nBackslash (\\) (\)
\nQuestion\?
\n"\"Double\"" \"quotes\"
\n\'Single\' "'quote'" "\'test\'"
\nmail\@example.com
\nUnicode: \u00A9
\n"Whitespace Preserved"
\nWhitespace collapsed
\n"Newlines
preserved"
\nNewlines\n\nPreserved
\nNewlines
collapsed
</string>
strings (APKEditor decompilation output)
<string name="test_string">Android escape and quotation test
Tab ulated 1
Tab ulated 2
Tab ulated 3
Tab ulated 4
Backslash (\) ()
Question?
"Double" "quotes"
'Single' 'quote' 'test'
[email protected]
Unicode: ©
Whitespace Preserved
Whitespace collapsed
Newlines
preserved
Newlines
Preserved
Newlines collapsed </string>
</resources>
strings (APKEditor decompilation output manually edited to escape single quotes)
<string name="test_string">Android escape and quotation test
Tab ulated 1
Tab ulated 2
Tab ulated 3
Tab ulated 4
Backslash (\) ()
Question?
"Double" "quotes"
\'Single\' \'quote\' \'test\'
[email protected]
Unicode: ©
Whitespace Preserved
Whitespace collapsed
Newlines
preserved
Newlines
Preserved
Newlines collapsed </string>
</resources>
strings (apktool decompilation output)
<string name="test_string">"Android escape and quotation test
Tab\u0009ulated 1
Tab\u0009ulated 2
Tab\u0009ulated 3
Tab ulated 4
Backslash (\\) ()
Question?
\"Double\" \"quotes\"
'Single' 'quote' 'test'
[email protected]
Unicode: ©
Whitespace Preserved
Whitespace collapsed
Newlines
preserved
Newlines
Preserved
Newlines collapsed "</string>
Attached images
strings (original) built with android studio
strings (original) built with APKEditor
strings (apktool decompilation output) built with android studio
strings (APKEditor decompilation output manually edited to escape single quotes) built with android studio
- Ngôn ngữ chính
- Java
- Star
- 2.3k
- Fork
- 417
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của REAndroid/APKEditor
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
enhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
Tất cả issue của REAndroid/APKEditor
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
jenkins-infra/plugin-modernizer-tool#2070 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Event search answers 500 when calendars, attendees or organizers holds a null elementCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởai-driven-qa bug Minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
linagora/twake-calendar-side-service#1615 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
eclipse-tradista/tradista#371 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Failed to start Rescue missionĐang mởcritical
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
mars-sim/mars-sim#2199 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày