vendredi 24 juillet 2015

[Q] How to override an XML resource in an app?



I am attempting to replace the data an app* stores in an XML resource, and I can't figure out how to make it work. I followed the tutorial, but it only covers things like "drawable" (and the simple types like string and integer)

I have tried various combinations of compiled or textual XML, with the file in res/xml or res/raw, and so far have not found anything that had any effect on the app, while my module never reports any errors! (at least not in any log I've found)


*The app is Swype, I'm attempting to replace one of the English keyboard layouts (qwerty, azerty, or qwertz) with a completely new one I saw that's actually good for the sliding entry method instead of a slide left on the top row being at least 14 different possible words (Seriously, I made a list) including some very commonly needed ones like it, or, out, and our. The layouts are** stored in xml files such as res/xml/kbd_azerty_panlatin.xml but even attempting a single letter swap hasn't done anything yet.

So, what do I need to do to make a line like

Code:


resParam.res.setReplacement(resParam.packageName, "xml", "kbd_azerty_panlatin", xrf);

actually work? (xrf is from

Code:


XResForwarder xrf = modRes.fwd(R.raw.kbd_azerty_panlatin);

as of my last attempt) and that file is in the last attempt compiled by creating a new Swype apk with the modification via apktool then just grabbing it from there.)

**Note that actually attempting to run recompiled Swype APKs -- modded or not -- fails with a crash when the keyboard would appear, so I can't actually confirm that I'm right about the location of the layouts I need to change, but it seems to be reasonable that they are where I think. I also have No idea how to link them to the language options, so I can't see a way to create a new one instead of replacing an existing.



Aucun commentaire:

Enregistrer un commentaire