Comments (8)
Fixed the formatted false.
/home/peaches/build/rom_wip/apks/framework-res/res/values-zh-rCN/plurals.xml:79: error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?
/home/peaches/build/rom_wip/apks/framework-res/res/values-zh-rCN/plurals.xml:79: error: Found tag where is expected
Its because the
<plurals name="matches_found">
<item quantity="other" formatted="false">第 %d 项,共 %d 项</item>
<item quantity="one">1 个匹配项</item>
</plurals>
should be
<plurals name="matches_found">
<item quantity="other" formatted="false">第 %1$d 项,共 %2$d 项</item>
<item quantity="one">1 个匹配项</item>
</plurals>
If the attribute comes back true, when inserting text into XML. Check for the value. If so, replace all % with incremental x$ so
% becomes %1$ next,
% becomes %2$
from apktool.
<anim name="android_slide_in_right">@android:anim/shrink_fade_out_from_bottom</anim>
<anim name="android_slide_out_left">@android:anim/slide_in_up</anim>
Need to look at references. Adding to remember.
from apktool.
<item type="array" name="android_config_virtualKeyVibePattern">@android:array/config_virtualKeyVibePattern</item>
<item type="array" name="android_config_mobile_hotspot_provision_app">@android:array/config_mobile_hotspot_provision_app</item>
Fixed. Testing time.
from apktool.
For some reason, @null isn't passing this.
<string name="config_wifi_p2p_device_type">10-0050F204-5</string>
<item type="string" name="default_wallpaper_component">@null</item>
<string name="config_networkLocationProvider">com.google.android.location.NetworkLocationProvider</string>
<item type="string" name="config_geocodeProvider">@null</item>
from apktool.
Maybe you can use the below code to format % to %n$
(not sure if encodeAsResXmlValueExt work well for all other types as encodeAsResXmlValue)
brut.androlib.res.data.value.ResScalarValue
public String encodeAsResXmlValueExt() throws AndrolibException {
String rawValue = mRawValue;
if (rawValue != null) {
if (ResXmlEncoders.hasMultipleNonPositionalSubstitutions(rawValue)) {
int count = 1;
StringBuffer result = new StringBuffer();
String tmp1[] = rawValue.split("%%", -1);//skip "%%"
int tmp1_sz = tmp1.length;
for(int i=0;i<tmp1_sz;i++) {
String cur1 = tmp1[i];
String tmp2[] = cur1.split("%", -1);
int tmp2_sz = tmp2.length;
for(int j=0;j<tmp2_sz;j++) {
String cur2 = tmp2[j];
result.append(cur2);
if(j != (tmp2_sz-1)) {
result.append('%').append(count).append('$');
count++;
}
}
if(i != (tmp1_sz-1)) {
result.append("%%");
}
}
rawValue = result.toString();
}
return rawValue;
}
return encodeAsResXml();
}
from apktool.
Thanks. I will test with it.
from apktool.
Sorry, I miss a function, there is already a function to do that
(can be found called by ResStringValue.encodeAsResXmlItemValue())
import brut.androlib.res.xml.ResXmlEncoders;
public String encodeAsResXmlValue() throws AndrolibException {
String rawValue = mRawValue;
if (rawValue != null) {
rawValue = ResXmlEncoders.enumerateNonPositionalSubstitutions(rawValue);
return rawValue;
}
return encodeAsResXml();
}
from apktool.
Merged your fix in, still some issues with with positional formatting. Will investigate more.
from apktool.
Related Issues (20)
- [BUG] Unable to parse '&' in AndroidManifest.xml HOT 2
- [BUG] brut.directory.PathNotExist: apktool.yml HOT 1
- [BUG]removing/moding line in smali HOT 4
- [BUG] Cannot recompile firefox HOT 2
- [BUG] Dex 040 unsupported? HOT 2
- [BUG] Error while building APK HOT 1
- thank u for looking at this this is a new thing that started happening when 6.0 came out HOT 1
- [BUG]When the assets directory contains the Assets folder, the generated apk cannot run HOT 3
- [BUG]Using aapt2 to export packages, extra spaces appear in the meta-data value in AndroidManifest HOT 1
- NEED HELP ANALYZE MY GAME APK FILE, IT'S REPORTED AS VIRUS BY GOOGLE PLAY PROTECT
- [BUG] Resources$NotFoundException for drawable when decompile and build apk HOT 1
- "error: expected enum but got (raw string) 1" HOT 1
- [BUG] Add all classes*.dex to doNotCompress HOT 4
- [BUG] Incorrect default setting of minSdkVersion HOT 2
- [BUG]Hello, I am suffering from the problem of not being able to integrate Payload with the Android application. I searched on several sites and did not find the solution, Knowing that I installed the version and it did not work every time I was asked to install 2.9.2 HOT 2
- Error while unpacking an .apk HOT 6
- [BUG] Error parsing styled strings HOT 1
- Reproducible Builds - Part 2 HOT 1
- [BUG] apktool d xx.apk generate minSdkVersion and targetSdkVersion as empty '', but aapt not HOT 7
- [BUG]apktool d xx.apk generate packageInfo.renameManifestPackage as empty '' HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apktool.