[Q] Modding apk to change text size - Android Q&A, Help & Troubleshooting

Many new phones have very high resolution screen, and thus text size may appear tiny in some apps.
I prepare to solve the problem by modifying apks to suit my own need. Unfortunately I have little knowledge about android programming.
One apk I intend to modify is "B-Folders", which is a very useful personal information organiser and is one of my favorite apps. I emailed to the author more than a year ago without getting any improvement. I can only help myself by modding the apk.
I successfully decompiled the apk, searched everywhere for "textsize" or "setTextSize" or something similar, made changes, re-compiled and re-signed the apk. And now, the text size while viewing is now much bigger, but the text size during typing in text box, i.e. input mode, remains very small. I spent many hours struggling to find possible related lines in the decompiled codes and failed to locate it.
I wonder if any experts here may offer me some hints?

aeioo said:
Many new phones have very high resolution screen, and thus text size may appear tiny in some apps.
I prepare to solve the problem by modifying apks to suit my own need. Unfortunately I have little knowledge about android programming.
One apk I intend to modify is "B-Folders", which is a very useful personal information organiser and is one of my favorite apps. I emailed to the author more than a year ago without getting any improvement. I can only help myself by modding the apk.
I successfully decompiled the apk, searched everywhere for "textsize" or "setTextSize" or something similar, made changes, re-compiled and re-signed the apk. And now, the text size while viewing is now much bigger, but the text size during typing in text box, i.e. input mode, remains very small. I spent many hours struggling to find possible related lines in the decompiled codes and failed to locate it.
I wonder if any experts here may offer me some hints?
Click to expand...
Click to collapse
Have you looked at the dpi settings of your input method? Text size for input may be related to keypad you're using (especially third party apps) rather than the app you're currently typing in.

yeah is there any way to modify font size or dpi by editing the apk

Sent from my Blade using Tapatalk 2

Stryke_the_Orc said:
Have you looked at the dpi settings of your input method? Text size for input may be related to keypad you're using (especially third party apps) rather than the app you're currently typing in.
Click to expand...
Click to collapse
This question is difficult, I would also like to solve this problem, I hope people know I'm waiting

vNa5h said:
yeah is there any way to modify font size or dpi by editing the apk
Click to expand...
Click to collapse
There should be a font package, or layout in the apk your editing if it has its own fonts/dpi settings.
Sent from my SPH-D710 using xda premium

Related

How can we modify native samsung apps appearance?

I love LCD density changer and cannot live without it. Samsung apps do not scale well. Is there a way I can modify the files myself to make them scale instead of having fixed widths?
I'm moderately technical. If its as simple as modifying an xml file in the apk that would be easy.
sj_martin said:
I love LCD density changer and cannot live without it. Samsung apps do not scale well. Is there a way I can modify the files myself to make them scale instead of having fixed widths?
I'm moderately technical. If its as simple as modifying an xml file in the apk that would be easy.
Click to expand...
Click to collapse
It shouldn't rally need anything other then editing the pngs and editing the xml for font size
Well, there is the possibility it may require some Smali edits. If the Samsung apps were only ever intended to run on this [email protected] specific resolution/density, then the sizing of them could've been hardcoded in. Given how the Galaxy Tab Email app displays on our phone I wouldn't be surprised if this was the case. Lazy coding IMO...
Sent via XDA app on my Macnut Vibrant [R12]

Android font installation

Hi I'm sorry if this kind of question has been asked before.
All I wanted to know is what's the technical reason that:
We, users, cannot install font in android without root? Any technical reason or anything at all for this?
AFAIK, you can install font in samsung galaxy phones.(apk ).
Thanks,
Bayint
The technical reason is the simple fact that to change anything in the system folders you need read/write permissions. You get these permissions with root access.
There is no technical reason that applications cannot use different fonts and many do (ereaders, GoSMS, etc.) Google has not defined a font directory on the SD card to standardise user installed fonts to where more apps let you choose your own font.
Most commercial operating systems depend on font metrics to correctly display Widgets (like buttons and text boxes) at a specific size with all the text correctly visible. This is why you cannot change the system font.
Window managers on Linux do not have set metrics that text must fit inside. The text dictates the widget size. This is more flexible but even to the point of unwanted results, like window titles and buttons so large the content of a window is obscured.
Sent from my NookColor using xda premium
lowandbehold said:
Did you read the question at all? You can change the system font. The question was why do you need root access to change the system font. So you basically give this senseless long drawn out answer why?
Click to expand...
Click to collapse
Which part was senseless?
What was senseless was your response.
Q"Why can't I change fonts without root access?"
A"Well you can change fonts but you need root access."
I told him why root was required. You just rephrased his question as an answer.
Sent from my MB860 using xda premium
Okay Guys, keep it nice and friendly.

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.

[Q] layout XML, fill_parent, app-specific screen-size spoofing

Hi all,
I have a Galaxy Tab 2 10.1 with a 1280x800 display and recently enabled floating multi-window capabilities using this mod: http://forum.xda-developers.com/showthread.php?t=2449094
Now that I can have floating windows, I wanted to try and edit some games I play to not take up the whole screen and make them think I'm running on a phone with a small screen size (which I know they can, since I've played the same exact APK on a smaller screen size).
So what do I do? I download apktool, decompile the APK, and check the res/layout XML files. In this particular app's case, there are 3 XML files, and all the views are defined at layout_width and layout_height of fill_parent. I change them to something silly like 400px and 640px (to, say, run 4 of these in landscape mode on my screen).
Of course this doesn't work. Some parts are actually 400/640, but some draw at full screen size. My guess is that there are some parts that are drawn pragmatically that bypass the layout settings set in the XMLs and use calls like GetDeviceScreenSize() for dimensions or whatever. I can't find any other layout rules in the XML so I assume this is embedded in the smali files somewhere (pardon my android development nubbery here).
Now that you know the background, my question is: is there a way I can fool a particular app into thinking that my screen is smaller? I know I can change the entire devices DPI but that won't help me. I want to do this on an app-specific basis, sandbox style. Have I missed something simple other than red/layout that I can change to get this app to behave like I want it to?
If the answer to these questions is no, will I be able to achieve my goal by digging into the smali files? If so, would anyone care to share some advice?
Thanks in advance!

[Q] Everything is TINY on Galaxy S4 with Themer

Hi folks,
I'm a Themer noob, but a even with searching around I haven't found the solution. Basically, I installed Themer on my Slimkat ROMed T-Mo Samsung Galaxy S4 (M919 model), and went theme shopping. Found lots of nice ones but they all look tiny on my screen. Fonts and icons are much smaller than shown while browsing themes. For example, here's a theme I thought looked pretty. I'm attaching two pictures, one as shown in the theme browser and the other (with the tiny text and a tiny angry birds icon) the way it actually displays.
How do I change the sizes of the things, basically zooming the elements by a factor of 2-3X?
I have tried the icon size dp setting, but changing it doesn't seem to do much of anything at all.
Thanks in advance for help in adjusting the scaling!
Marc
Frankenscript said:
Hi folks,
I'm a Themer noob, but a even with searching around I haven't found the solution. Basically, I installed Themer on my Slimkat ROMed T-Mo Samsung Galaxy S4 (M919 model), and went theme shopping. Found lots of nice ones but they all look tiny on my screen. Fonts and icons are much smaller than shown while browsing themes. For example, here's a theme I thought looked pretty. I'm attaching two pictures, one as shown in the theme browser and the other (with the tiny text and a tiny angry birds icon) the way it actually displays.
How do I change the sizes of the things, basically zooming the elements by a factor of 2-3X?
I have tried the icon size dp setting, but changing it doesn't seem to do much of anything at all.
Thanks in advance for help in adjusting the scaling!
Marc
Click to expand...
Click to collapse
Hi Marc,
We apologize about this, but you say you're running Slimkat. For some reason Slimkat has also been giving other users in this section similar issues. However one possible cause for this could be your display/DPI/resolution settings. Make sure that all your settings are set to your device's default setup, as Slimkat may have changed a few of them.
If this isn't the case please let us know, thanks!
- Marco
ThemerSupport said:
Hi Marc,
We apologize about this, but you say you're running Slimkat. For some reason Slimkat has also been giving other users in this section similar issues. However one possible cause for this could be your display/DPI/resolution settings. Make sure that all your settings are set to your device's default setup, as Slimkat may have changed a few of them.
If this isn't the case please let us know, thanks!
- Marco
Click to expand...
Click to collapse
Thanks Marco. I'll poke around today and see if I can figure out how to change the DPI stuff. I've never needed to in my past Android experience and will need to figure out how to do it. I haven't yet seen an obvious setting for it, so maybe it's a build.prop mod?
I will report back after investigating!
Marc
I researched and found the actual pixel density of the S4 screen is 441. Using Device Control's build-prop settings, I found mine with SlimKat was set to 370. I adjusted it to 441 and a lot of things look more normal now in the regular launcher. The status bar at the top is now normal size and fonts are generally more legible.
However, in Themer, things still seem a bit small. I re-applied the theme, and things got a bit bigger, but still smaller than I'd like. I'll continue to poke around...
Frankenscript said:
I researched and found the actual pixel density of the S4 screen is 441. Using Device Control's build-prop settings, I found mine with SlimKat was set to 370. I adjusted it to 441 and a lot of things look more normal now in the regular launcher. The status bar at the top is now normal size and fonts are generally more legible.
However, in Themer, things still seem a bit small. I re-applied the theme, and things got a bit bigger, but still smaller than I'd like. I'll continue to poke around...
Click to expand...
Click to collapse
Whenever you have an issue with Themer, try this:
1. Uninstall Themer.
2. Delete the /sdcard/MyColorScreen/ folder (remove the Exported folder if you saved any themes).
3. Reinstall Themer.
Let me know how it goes!

Categories

Resources