[Q] Help Editing XML - Android Q&A, Help & Troubleshooting

I'm basically wanting to edit the background color and font color of a Notepad apk. I'm pretty adept at swapping out png's and re-signing and all that, but I know nothing about XML. There isn't a background image inside the apk, so I assume the color is dictated by one of the XML files inside. Anyone feel like helping me out? Or any skilled XML editors feel like taking a few minutes and just knocking it our for me? I can't imagine it's very hard if you actually know what you're doing. I just don't :/
http://www.4shared.com/android/wy7ErO3T/complattomnotepad-1.html

Related

Need Smali Help!!

I am inverting the stock 3.0 Mms app and I have it about 98% done. My problem is the Quick Text list is black text on black background. I am looking for someone that is good with smali to give me a hand finding this text color change.. If any of you smali experts can lend a hand, shoot me a pm and I will send you my app and you can open it up and take a look, THANKS!
Just use a grep program to search through it yourself such as fileseek on windows http://www.fileseek.ca/. They're probably in an xml file. It's most likely not going to be in the actual smali code.
I have already located the xml that controls the list. However any changes to the text style has no effect, this leads me to think it is a smali edit...
ecsnead69 said:
I have already located the xml that controls the list. However any changes to the text style has no effect, this leads me to think it is a smali edit...
Click to expand...
Click to collapse
Try using the grep program to look through them or convert the apk to a jar using apk2jar and read them in http://java.decompiler.free.fr/
Anyone that would do it for you would most likely be doing the same. The only file I could really see them being in is the Strings file (R). It would be really bad coding for htc to stick them hard coded in the code itself.

[Q] Re-themeing Spotify?

Is it possible to use an APK decompiler and edit the UI of Spotify? I don't have an experience coding, but I'm sure I could figure it out.
Can anyone help?
Yes, the only problem is anytime you update the app, you will have to re apply any of the changes you make. Your simplest changes would be like any other app using the .png files, xml edits are a lot more complicated and more difficult to figure out with no/limited xml experience. I don't have that particular APK on hand at the movement, but open it up and look for the drawable folders in the res folder. These are going to be the simplest changes to make, you can swap or edit these .png files.

[Theme req] Virus Eternity red

Just modded my soft keys to light up red, attempting to get the theme on Virus's Eternity ROM to match. Could anyone change all the green to red, or point me to some tools to help me edit the framework? I'm new to the theming, but I have a decent understanding of ADB and Android file structure.
Sent from my PG86100 using xda premium
spenceizzle said:
Just modded my soft keys to light up red, attempting to get the theme on Virus's Eternity ROM to match. Could anyone change all the green to red, or point me to some tools to help me edit the framework? I'm new to the theming, but I have a decent understanding of ADB and Android file structure.
Sent from my PG86100 using xda premium
Click to expand...
Click to collapse
M10 tools and eclipse for Modding .9 pngs. And gimp for adding colors and a ton of experimentation
Sent from my PG86100 using xda premium
That looks... daunting, so lets start small. Now lets say I just wanted to mod the notification bar icons for now, I think that would fall under the .9 png modding portion. What files exactly would I be modifying? Is it some sort of jar file I would be ripping the pngs out of, modifying, and replacing? I am quite new to this, so please don't flame me too much
spenceizzle said:
That looks... daunting, so lets start small. Now lets say I just wanted to mod the notification bar icons for now, I think that would fall under the .9 png modding portion. What files exactly would I be modifying? Is it some sort of jar file I would be ripping the pngs out of, modifying, and replacing? I am quite new to this, so please don't flame me too much
Click to expand...
Click to collapse
notification bar icons are mainly in systemui.apk and are standard .pngs.
Theirs alot of guys willing to help those who help them selves. from what your asking i'de suggest doing a ton of reading. their are a ton of theming modding how tos. but if you wanna jump in grab 7zip,gimp(or a similar graphics editor) and android signer, and start experimenting, If you wanna edit .9.pngs your gonna have to learn how to use apktool and a .9 compiler. But just do a search theirs alot of great how tos and tools all over the forum.
I found the systemUI.apk from reading the beats headphone icon thread. So I'm assuming that the .pngs found in the systemUI.apk are normal .pngs that don't need any kind of special encoding or transparency values. If I were going to change some sense 3.0 assets, I would need to use this guide posted here: http://forum.xda-developers.com/showthread.php?p=5206698, correct?
Edit: Also, is the SystemUI.odex file anything I have to worry about?
spenceizzle said:
I found the systemUI.apk from reading the beats headphone icon thread. So I'm assuming that the .pngs found in the systemUI.apk are normal .pngs that don't need any kind of special encoding or transparency values. If I were going to change some sense 3.0 assets, I would need to use this guide posted here: http://forum.xda-developers.com/showthread.php?p=5206698, correct?
Edit: Also, is the SystemUI.odex file anything I have to worry about?
Click to expand...
Click to collapse
if your just looking to change images the .odex isn't something you need to worry about, the link you posted refers to .9.pngs, when you say assets if your refering to the images that are in assets folders tose are .m10 files and for those you need the .m10 tools that can also be found here on xda.
Well, I got the drawable-hdpi finished, I may have to tweek the 4g icon, the signal bars look a little pink. Tomorrow I'll see if I can find the syncing icon, battery percentage, and other little odds and ends that I can easily edit. I'm attaching the SystemUI.apk for anyone who wants to try it.

Development Discussion: Modification of PDF Viewer

Taking notes over PDF slides with the scribe pen has really saved me a lot of hassle. I love this function of the flyer. There's really only one way it could be better: Fullscreen support, or at least "more screen" support.
Not only does the HC bar take up space, but the menu/title bar on top is even bigger. The pdf viewer has the screen real estate of a 5inch phone.
PDF editing seems like only a moderately used feature, so I don't see this getting done on it's own. I'm offering a very modest reward for a fix.
I would be willing to donate for the removal of the huge uppermost Title/menu bar in PDF viewer, so that a double-tapped fitted pdf page will fill the new space. See the attached image. You can leave the small menu button in the corner if possible, or just get rid of it if it's too difficult.
I'm hoping this is as simple as modifying a few variables in the apk. I could be very wrong.
I can live with just the HC bar at the bottom.
Note: I have tried apps like repligo and ezpdf which do offer fullscreen support. However, annotating and changing annotation options takes many more steps than the HTC pdf viewer.
Secondary goal:
Apps like honeybar and honey hide widget cause all pen written annotations to be shifted up.
I believe the solution to the first problem would also allow an easy fix of the shifting pen annotations. I would like the PDF viewer to accept pen strokes properly with a hidden HC bar.
No one's willing to give it a shot? Ah well.
This will be my only bump.
I've attached the (unmodified, I think) HTCPDFViewer.apk from /system/app from LeeDroid's 4.1.0 rom.
I was the guy who removed the obnoxiously large language bar from Sony Ericsson's keyboard back when I was still using my u20i phone... unless HTC is particularly irritating about how it structures its resources, you're right that it is a matter of decompiling the APK, adjusting numbers, and recompiling it. Merely hiding is not difficult (making the Menu button semi-transparent is probably too difficult, though, but you can pick a ROM with the hardware buttons enabled).
Unfortunately it is also incredibly tedious to decompile and recompile everything right, from my experience of the keyboard hack. I'm not really up to it at the moment. Hope you can do it.
I've poked around in the archive. I wonder if I could just delete the ti.tle bar png or layout file. There doesn't seem to be a definitive title bar png
I'm also experimenting with apk multitool.
Since it's a stock rom app, is this venture going to be a lot more complicated than editing an xml line and then recompiling?
Here's where I'm at. Everything I know about android programming I've learned tonight, so this may be confusing and stupid sounding:
The decompiled apk has several things which could refer to the title bar.
dimens.xml has lines like
<dimen name="global_title_height">35.0dip</dimen>
<dimen name="editing_panel_header_height">56.0px</dimen>
<dimen name="editing_panel_header_margin">47.0px</dimen>
<dimen name="editing_panel_no_footer_header_margin">35.0px</dimen>
However there are also thousands of header and title lines from other xmls.
Can I just use a theme line in the manifest?
It uses the ActPDFReaderTheme whose parent is the HtcActionBar.FullScreen from the com.htc.resources.apk
These link to the common_mainnav xmls and pngs in the resources.
Do I need to find an HTC theme from the com.htc.resources.apk that doesn't have a title bar? Could I edit the com.htc.resources.apk and edit the pngs or delete the referencing lines in the styles.xml?
Thanks. I'll keep digging.
And btw, the bounty's still out if anyone can do it faster. I don't have much free time.
I think I've got this. I'm real close
I figured out how to decompile, edit xmls, recompile, copy original meta-infs and androidmanifest, and adb push.
The dimens.xml in the viewer apk has no effect on the bar. It's a standard template htcactionbar.fullscreen
I could direct the apk to a new theme, but I've decided just to try deleting or shrinking the bar from the com resources apk.
Good luck! Remember the apk you push back must be a signed one, probably via hacking the modified xml files back into the original signed apk.
Now I've run into a snag.
No matter how many margin and layout dimension variables in the com resource I set to 1.0px, I still have a black bar above the pdf.
Then I tried changing the theme reference in the pdfviewer.apk. It loads the file picker without an action bar, but as soon as I click a file it crashes. It seems (I think) that the program has too many calls for the action bar. I'm not a programmer. Do you know how I can get the program to simply ignore any lines referencing the "actionbar"?
Lines such as: "invoke-virtual {v3}, Lcom/htc/pdfviewer/ActPDFReader;->getActionBarHeight()I"
I also tried <item name="android:windowNoTitle">true</item> after the theme and I have the same effect of no title bar but a forceclose after selecting a file
Could you post the entirety of the relevant xml layout file?
porcupineadvocate said:
Could you post the entirety of the relevant xml layout file?
Click to expand...
Click to collapse
Unfortunately there is no simple relevant layout file. I can't go any further with this project because I don't know programming. Here's my progress if anyone would like to give it a shot:
In the decompiled HTCPDFViewer is a \res\values\styles.xml
There is the line:
<style name="ActPDFReaderTheme" parent="@com.htc:style/HtcActionBar.FullScreen">
This tells the program to use the HTCactionbar.fullscreen template style in com.htc.resources.apk
Now there are two paths to take from here:
1) Changing the style template to @android:style/Theme.NoTitleBar.Fullscreen
or adding the requestWindowFeature(Window.FEATURE_NO_TITLE) line
Issue: This causes the file picker to load without a title fine, but as soon as a pdf loads, the program crashes.
How far I got: I simply deleted 2 lines referring to the actionbar in the PdfLoadingPage$LOADING_PAGE_Handler.smali and the pdf loads. However there is a now a black empty bar on the bottom, and any pen writing is being moved upwards.
I suspect this is because of the ActionBarMenuAdapter.smali that controls how the pen annotations are moved in relation to the actionbar. There are also 100 more lines referring the actionbar in the other smalis. You can find them all by searching the apk for "actionbar". A proper programmer could remove these lines, or more easily make every m_iActionBarHeight:I line refer to zero.
If someone can fix the programming, I suspect that this would also solve the hidden HC bar issue, allowing true fullscreen support!
2) Editing the com.htc.resources.apk
The styles.xml in this file has a NoTitleBar.Fullscreen theme that redirects to other xmls redirecting to different layout files and pngs.
I've looked through every dimens.xml and other xmls that may be even loosely linked to the actionbar. I even tried haphazardly changing every possibly connected dimension to 1.0px.
I then tried shrinking all of the related PNGs to 1x1 pixel.
The end result was just a funking looking grey and black bar at the top.
I have no idea where to find the dimensions controlling the size of the actionbar.
Thanks for any help! Warning: Recovery backup before pushing a new com.htc apk, if you don't do it correctly, things can get messy with the OS.
porcupineadvocate said:
Could you post the entirety of the relevant xml layout file?
Click to expand...
Click to collapse
Ok I may have lied. There are one or two files I wasn't sure about.
These are from the xmls in layout folders of com.htc apk.
Can you take a look and see if there are simple line(s) to change here? notepad++ is great.
I already attempted to edit all of the dimens.xml dimensions. I can't remember if I got all of the dimensions in these files too.
The bar seems to be about 56 pixels. I gathered that from reduced editing view dimensions but I could be wrong.
Not that it is a big deal for a minor issue like this in a low traffic forum like EVO View but "bounty threads" are strictly prohibited by xda.
I doubt the mods will hassle you since this isn't a heavily travelled thread but they might shut you down at any second. Good idea to get some PM's going with anyone who is helping you.
Good luck.
Sent from my PG41200 using Tapatalk
Post the decompiled HTPDFViewer, please. I particularly want to see the contents of res/layout/*.xml files.
As a tip, don't delete any elements; just resize them to zero height/width if possible. Deleting will cause crashes when the program tries to reference them.
porcupineadvocate said:
Post the decompiled HTPDFViewer, please. I particularly want to see the contents of res/layout/*.xml files.
As a tip, don't delete any elements; just resize them to zero height/width if possible. Deleting will cause crashes when the program tries to reference them.
Click to expand...
Click to collapse
Here it is.
Woops I didn't realize bounties were prohibited, especially with so many developers asking for "donations"
Delete this if you'd like. I didn't mean to break the rules.
Donations and bounties are different. Donations are thanks for work done, bounties are offer of compensation to do work. If they allowed bounty threads xda would be overrun with them.
No big deal. I doubt the mods even visit this thread. Just wanted to give you heads up to establish pm conversations in case they did
Sent from my PG41200 using Tapatalk
No progress since my last update on the programming front. However I have been playing with the lcd density changer.
Setting it to 170 from 160 and enabling the GB like bar on top has interesting results. The pdfviewer only edits properly when I use Honeyhide or Honeybar. So we know that disabling the notification bar and having a working pdfviewer is possible.
However, I found I have the best pdf editing real estate when I set the lcd density to very low, like 120. In fact, not only are the title and HC bars smaller, but the pen seems to be more accurate too!
Maybe this information will help with our goal.
EDIT: at 120 and below, the scribe color wheel pops up on the wrong side. Still works though. Other tablet functions are much slower and there's some screen corruption too. It's not a permanent solution, but works for annotating pdfs.

Help changing colors for themes

I have created some colored themes for Empty Galaxy ROM. You can see them here.
The main problem I have is when I try to change the color of the pop-up/toast notifications. Although I am only changing the colors of the png files, the end result is completely wrong. See here.
This page explains how to do what I want by editing/creating a xml file...but I just don't understand it, or where to even find and place the xml file. I know just enough to be dangerous
If anyone can help explain this to me, it'd be much appreciated.
Thanks,

Categories

Resources