[Q] (Solved?) Change DEFAULT Homepage on Cooked Rom - Android Q&A, Help & Troubleshooting

Ok, got a bit of a problem here... I need to change the default homepage of the browser in a Rom I'm cooking... that means the homepage you get after a full factory reset, not that you set in the menu.... Please don't tell me how to set it in the browser menu....
A bit of background... I'm using a leaked Rom to build from. It was leaked from a Tracfone "LG-L95G" which is identical in every way to the LG-P999 aka T-Mobile G2X. Everything is working 100%. The only problem left from the "porting" is removing Tracfone as the default browser homepage.
This has turned out to be harder than I expected.
What I have done:
Browser.apk - the xml lists Google as the homepage. The word "tracfone" appears NOWHERE in the entire structure of the decompiled xml or values or even in the smali code.
SystemUI & framework-res - I've seen suggestions the homepage hides here. Can't find anything suggesting a setting to "tracfone"
flexdb - I really thought I had it kicked here. /system/etc/flex.db listed m.tracfone.com as the homepage for T-Mobile US. I changed all occurrences here to about:blank. I have also tried simply copying the flex.db from a P999 itself. Ie, removed ALL references to tracfone service and made it identical to a P999 in every way.
Ran grep -R tracfone * on the entire ROM.
Dug through tons of files by hand looking for any clue.
Unfortunately, even with all of that, do a wipe, open the browser, and you GET M.TRACFONE.COM again!
The word "tracfone" does not appear in build.prop, it does not appear in any init scripts, not even in the kernel scripts! Yet it comes back like Christine...
Does anyone have a clue where I could look next? Or failing that, even some way from an init.d script that I can overwrite the setting myself?
EDIT
Okay, I hate giving myself clues like this, but maybe this will help others (if I'm on the right track)...
Instead of doing a grep on the ROM from my PC, pre-install, I decided to actually hit up the RUNNING copy... so from adb into a Bash prompt on the phone itself, I ran a grep -r tracfone * and got the following result:
Code:
data/data/com.android.browser/databases/browser.db:Web page not availablehttp://m.tracfone.com/
data/data/com.android.browser/shared_prefs/com.android.browser_preferences.xml:<string name="homepage">http://m.tracfone.com</string>
data/data/com.lge.providers.flex/databases/flex.db:M77BRW_SETTINGDB_CURRENT_HOME_URL_Ihttp://m.tracfone.comhttp://m.tracfone.comI#
data/data/com.lge.providers.flex/databases/flex.db:=77BRW_SETTINGDB_HOME_URL_Ihttp://m.tracfone.comhttp://m.tracfone.como"
data/data/com.lge.providers.flex/databases/flex.db:=;;DATACOM_ACCOUNT_MMSC_0_Ihttp://mms.tracfone.comhttp://[email protected]
data/data/com.lge.providers.flex/databases/flex.db:;%%DATACOM_ACCOUNT_APN_0_Iwap.tracfonewap.tracfone:?
data/data/com.lge.providers.flex/databases/flex.db:M77BRW_SETTINGDB_CURRENT_HOME_URL_Ihttp://m.tracfone.comhttp://m.tracfone.comI
data/data/com.lge.providers.flex/databases/flex.db:=77BRW_SETTINGDB_HOME_URL_Ihttp://m.tracfone.comhttp://m.tracfone.como
data/data/com.lge.providers.flex/databases/flex.db:=;;DATACOM_ACCOUNT_MMSC_0_Ihttp://mms.tracfone.comhttp://mms.tracfone.com6%
data/data/com.lge.providers.flex/databases/flex.db:;%%DATACOM_ACCOUNT_APN_0_Iwap.tracfonewap.tracfone:$
Which is very odd.... considering that is NOT the content of the actual flex.db that was flashed to the phone. That leads to 1 question: Why isn't the phone respecting the flex.db? I've noticed other edits to the file (such as bookmarks) do not apply either. So it is being ignored at somepoint. FlexProvider.apk maybe? Or is something in the ROM still identifying the phone to T-Mobile as an MVNO device and they're pushing out an OTA flex update?
EDIT 2:
AHA! There's a flex.db *INSIDE* the FlexProvider.apk file! So it *IS* ignoring the one placed in /system/etc/flex/! Editing this should solve it - but I'm going to test test test to make sure.

lotherius said:
Ok, got a bit of a problem here... I need to change the default homepage of the browser in a Rom I'm cooking... that means the homepage you get after a full factory reset, not that you set in the menu.... Please don't tell me how to set it in the browser menu....
Click to expand...
Click to collapse
firstly to say interesting question!!
but I think it it not possible to change programmatically default homepage
this is a system app so will be signed by your provider let us suppose you find homepage location in code (could by result of a script parsing) by modifying source of that apk package how to solve signature problem ?!
if in .db file ...this file is created after flashing as a result of script parsing
not framework-res.apk better browser-res.apk if you have one

ruscan.calin said:
firstly to say interesting question!!
but I think it it not possible to change programmatically default homepage
this is a system app so will be signed by your provider let us suppose you find homepage location in code (could by result of a script parsing) by modifying source of that apk package how to solve signature problem ?!
if in .db file ...this file is created after flashing as a result of script parsing
not framework-res.apk better browser-res.apk if you have one
Click to expand...
Click to collapse
man use a ... editor...I can show you for fifty bucks
I was just curious about this tricky change (from your post) so thinking about Google motto don't be bad finally I have found but should recognize that I am bad at this time
here is solution

Actually, you can use an sqlite editor to change the values in the flex.db file... the problem I was having in the OP is that on an LG phone (maybe others?) the flex.db file is ignored and the one inside FlexProvider is used instead, so you have to edit both. You can add new locales the same way. No need to use a hex editor, as that would be much more difficult.

lotherius said:
Actually, you can use an sqlite editor to change the values in the flex.db file... the problem I was having in the OP is that on an LG phone (maybe others?) the flex.db file is ignored and the one inside FlexProvider is used instead, so you have to edit both. You can add new locales the same way. No need to use a hex editor, as that would be much more difficult.
Click to expand...
Click to collapse
maybe you are right regarding your phone... but also I prepare a custom rom for Alcatel ot-908 also to change default homepage was a problem for me but I did and simply works !

Related

How can I change the package name?

Hi everybody, I'm trying to make a soundboard to put on the android market. I downloaded a soundboard template from http://myandroidsoundboard.com/, and it works great except I don't know how to successfully change the package name from "com.soundboard" to something else without making the project go all "error" crazy.
I click the package name in the the package explorer and click refactor and I change the package name, but then everything becomes an error because the package name is now different. How can I change the package name successfully so I don't get errors everywhere?
Thank you.
You don't need to change package name of Java classes. You must change package name stored in AndroidManifest.xml and maybe some other files.
Brut.all said:
You don't need to change package name of Java classes. You must change package name stored in AndroidManifest.xml and maybe some other files.
Click to expand...
Click to collapse
I've gone through the android manifest file and I've changed everything there, but do you know what other files might need some changing? The only errors I see are coming from anything with the "R" next to it.
PrestoMovie said:
I've gone through the android manifest file and I've changed everything there, but do you know what other files might need some changing? The only errors I see are coming from anything with the "R" next to it.
Click to expand...
Click to collapse
I think it may be caused by the fact that after changing package name R.java file is generated in different Java package, but app code references original one. I see several ways, how to fix this: you could alter ant building process, use some refactoring tools to modify all references to R class or manually move generated R.java to proper place (and modify package declaration in it).
If you know, what I'm talking, then good. If you don't then it probably does not have sense to explain it further - it will take several pages of posting until you will get it.
Brut.all said:
I think it may be caused by the fact that after changing package name R.java file is generated in different Java package, but app code references original one. I see several ways, how to fix this: you could alter ant building process, use some refactoring tools to modify all references to R class or manually move generated R.java to proper place (and modify package declaration in it).
If you know, what I'm talking, then good. If you don't then it probably does not have sense to explain it further - it will take several pages of posting until you will get it.
Click to expand...
Click to collapse
which way would you say is this easiest? And would you be able to point me in the direction of a link that explains any of them well?
For what it's worth - archival value & others reading this thread now - a link to such info would be appreciated
PrestoMovie said:
which way would you say is this easiest? And would you be able to point me in the direction of a link that explains any of them well?
Click to expand...
Click to collapse
Ok, actually this can be done very simply ;-)
I think the best solution is to refactor code. Do you use some good IDE? Eclipse, Netbeans? If so you could use their refactoring tools, but it is also doable by simple find/replace. Just replace all occurrences of "import old.package.name.R;" in all *.java files by "import new.package.name.R;".
These are basics of Java/Android developing: if you know them, then you should have no problems
Brut.all said:
Ok, actually this can be done very simply ;-)
I think the best solution is to refactor code. Do you use some good IDE? Eclipse, Netbeans? If so you could use their refactoring tools, but it is also doable by simple find/replace. Just replace all occurrences of "import old.package.name.R;" in all *.java files by "import new.package.name.R;".
These are basics of Java/Android developing: if you know them, then you should have no problems
Click to expand...
Click to collapse
I'm using Eclipse. And thank you! Hopefully I can get it working now!
K, for some reason I'm only getting one error now in the androidmanifest.xml and it says "class com.soundboard.SoundBoard doesn't exist", but com.soundboard is no longer the package name.
bump bump bump.
bump.
I'm having the same problems. I've been able to create working .apk's but need to share it in the market and the market won't let me if the package name is the same thanks.
agentkalaw said:
bump.
I'm having the same problems. I've been able to create working .apk's but need to share it in the market and the market won't let me if the package name is the same thanks.
Click to expand...
Click to collapse
Advanced tasks require some knowledge. You must know, what is Android's package name and then changing it will be really easy thing to do.
Ahh and there is new "--rename-manifest-package" switch in newest aapt tool. I didn't test it, but it's official Android tool, so this should work.
PrestoMovie said:
K, for some reason I'm only getting one error now in the androidmanifest.xml and it says "class com.soundboard.SoundBoard doesn't exist", but com.soundboard is no longer the package name.
Click to expand...
Click to collapse
thanks for the help! I was actually able to change the package name and I'm having the exact same problem as the OP ^. I basically just need to edit the androidmanifest.xml file and i should be all set I tried searching on how to edit it after changing package names but no luck. any ideas? how do i edit androidmanifest.xml files to recognize the package name change? thanks again
Its been a long time since this post, but if it helps someone:
Issue: You have a source, you want to build 2 different apks from the same source, and be able to install both in the same device at the same time.
General Solution: Use a refactoring tool, like in eclipse, and rename all package names.
Better Solution: use aapt flag --rename-manifest-package. This does not require you change even a single line in the original source. Just this flag, and pass in a different package name, and whoa, you have a new apk with the different package name. I used it as follows, in the Android.mk:
LOCAL_AAPT_FLAGS := --rename-manifest-package new.package.name
Click to expand...
Click to collapse
Cheers

[Q] Can someone please help me with two things?

Hey everyone, I have successfully made a few ROMS for myself (using the DSIXDA HTC Android ROM kitchen v 1.00). I am making a ROM for the HTC Evo.
I know how to do most of it, I have managed so far:
To add my own ringtones
To add my own notification sounds
To set the default ringtone, notification, and change the default wallpaper
Add a theme to my ROM
But there is a few questions I have. I have Googled, looked around on here, and done what I can to find the answers but I am so far unsuccessful.
My first question: Ok, I know that the default wallpapers reside in the system/customize/resource directory. I have attempted to replace the wallpaper (and small preview) wallpapers with my own custom ones. I tried using Paint.net for Windows to resize to the same dimensions as the default wallpaper. For example, to replace htc_wallpaper_01.jpg, I edited a 960x800 wallpaper to have the same size and name (everything the same) and changed htc_wallpaper_small_01 with a matching 80x60 smaller version of the new graphic. I have found sometimes it works, but if I do a few using the method mentioned above, the ROM fails to load up. Can someone help and explain why?
Question 2: I am trying to place the removed apps automatically on the SD Card. I made a "sdcard" folder in the root directory of my ROM. I tried editing the update.zip to include copy_dir PACKAGE:sdcard /sdcard and when I do a check for errors I get none, yet when I try and install the ROM it gives me the "E:syntax error in update script" meaning I am not doing it right. I tried doing it the same way Fresh did it and it also threw me the same error.
So can anyone please tell me how to do this? I know I am close with both and I have tried dissecting other ROMS to see how they did it but I cannot figure it out.
First question:
It could be many possibilities. Maybe not enough room on system, file names not matching, etc...
Try each png on seperate flashes to find the culprit.
*The best way to find out for sure is to use "adb logcat" on boot. This tells you all your errors the OS has.*
Second question:
Im not understanding what your trying to do?
Root of a rom is /
sdcard is mounted to a folder on /
If you want to store the apk on sdcard then,
the proper code to install in /sdcard from update.zip:
Code:
copy_dir PACKAGE:sdcard SDCARD:
If this is not what your asking please explain to me what your asking.
RichieDaze said:
First question:
It could be many possibilities. Maybe not enough room on system, file names not matching, etc...
Try each png on seperate flashes to find the culprit.
*The best way to find out for sure is to use "adb logcat" on boot. This tells you all your errors the OS has.*
Second question:
Im not understanding what your trying to do?
Root of a rom is /
sdcard is mounted to a folder on /
If you want to store the apk on sdcard then,
the proper code to install in /sdcard from update.zip:
Code:
copy_dir PACKAGE:sdcard SDCARD:
If this is not what your asking please explain to me what your asking.
Click to expand...
Click to collapse
Thank you RichieDaze for the response.
You mentioned png., but all the ROMS I have seen have the wallpaper in .jpg format. I was just wondering if there was a certain size they have to be (I mimic the exact size of the default ones).
I think I got this part worked out by doing exactly that, installing 1 at a time until I find the culprit.
For question 2: Thanks to using the DSIXDA kitchen, I cannot use updater.script, which seems to be the way ROM makers like Calkulin, Hero_over, and other have used to set their removed apps to automatically copy on to the SD card when you install the ROM.
I have to use update.script instead, and when I try and do it using that I run into an error.
What I am trying to is remove the usual bloat from the ROM, but copy the removed apps so that users can have the option of installing them if they use any of them.
You are answering my question and are on the right track to helping me. I will try to add that (the way you wrote it out) and see what happens to my update.script.
Thank you very much for your help, greatly appreciated and please let me know if there is some other way to do this if you are aware of any or if someone is using update.script instead of updater.script.

[Dev]Files of interest in the system

Alright, just got my hands on a system dump courtesy of loglud so I will be posting files (text files will include content that peaked my interest) here so me and other devs can see what we are able to toy with.
systemdump download link: http://dl.dropbox.com/u/15069134/SystemDump.zip
Current list:
/system/media/bnapps_icons\ <-- we can mod the app icons that come with the device so we can make it less-sucky.
/system/etc/bluetooth/blacklist.conf <-- referencing the bluetooth chip meaning we just have to find a way to activate it
/system/app/settings.apk <-- anyone think they can actually replace this with another gingerbread apk or decompile and discover if there is a custom intent? Warning: It does NOT work at all. I suggest against swapping the apk's out as it causes a force close.
/system/bin/bootanimation *Was told where it searches for bootanimations first so goto this thread for a new bootanimation: http://forum.xda-developers.com/showthread.php?t=1361735
Indirect said:
Alright, just got my hands on a system dump courtesy of loglud so I will be posting files (text files will include content that peaked my interest) here so me and other devs can see what we are able to toy with.
Current list:
/system/media/bnapps_icons\ <-- we can mod the app icons that come with the device so we can make it less-sucky.
/system/etc/bluetooth/blacklist.conf <-- referencing the bluetooth chip meaning we just have to find a way to activate it
/system/app/settings.apk <-- anyone think they can actually replace this with another gingerbread apk or decompile and discover if there is a custom intent?
Click to expand...
Click to collapse
Nice finds. Bluetooth will be intesting to test (about to do it right now).
As you know the Nook has a heavily modified framework, so I don't know if the stock settings app will work (but I'm about to find out and probably fark up my tablet).
Let me know how it goes anlog.
Indirect said:
/system/app/settings.apk <-- anyone think they can actually replace this with another gingerbread apk or decompile and discover if there is a custom intent?
Click to expand...
Click to collapse
Hmm . . . let me get a hold of it and I'll look at it tomorrow, I've already taken the rest of the week off (Diablo III beta key came in tonight).
You may not need to change out the settings.apk but just add another one to it.
I decided to hold off on swapping the settings.apk. Losing access to the real settings app with all of the Nook options might not be a good idea.
The main reason I wanted a full settings menu was to be able to get into the accounts sync settings, but I found an app to launch it.
Warning: It does NOT work at all. I suggest against swapping the apk's out as it causes a force close.
Indirect said:
A
/system/bin/bootanimation <-- It's not a .zip or anything, just a file...anyone know how we can edit this?
Click to expand...
Click to collapse
It's a binary file. This app executes bootanimation resources.
Example: on T-Mobile MyTouch 4G resources are in /system/customize//resource/htc_bootanimation.zip
You should search for bootanimation.zip and you can edit this archive
Indirect said:
Warning: It does NOT work at all. I suggest against swapping the apk's out as it causes a force close.
Click to expand...
Click to collapse
I read note, if you want edit system apps like Settings.apk you should sign them by personal keys only...
I was looking through and couldnt find a bootanimation.zip in the system so I'm checking the data folders now.
edit: What the hell, still can't find it.
Indirect said:
I was looking through and couldnt find a bootanimation.zip in the system so I'm checking the data folders now.
edit: What the hell, still can't find it.
Click to expand...
Click to collapse
I was using Absolite system to see if I could replace the bootanimation because I couldn't find it either. I did manage to make it go away and just had the splash screen. I'll look into this further today as well. I'm starting to get ideas as to which files you can and can't replace right now. Some will force an immediate reboot and get stuck in a boot loop. I also am trying to find what triggers and handles the home button menu, I am sure it is in the framework. I have framework.jar and services.jar decompiled and going through those as well. Reviewing logcats to see what I can track down. I have some other interesting stuff going as well
romified said:
I was using Absolite system to see if I could replace the bootanimation because I couldn't find it either.
Click to expand...
Click to collapse
Hmmm... Usually bootanimation is in /data/local/ or /system/media. May be it has different name?
/system/bin/bootanimation is the program that actually displays the bootanimation.
Normally it plays the contents of /system/media/bootanimation.zip, but it can also be hardcoded to play a fixed animation or designed to play a completely different format. (Such as on Samsung devices, where it only plays Samsung's QMG format until you replace the program.)
conundrum768 said:
I've already taken the rest of the week off (Diablo III beta key came in tonight).
Click to expand...
Click to collapse
conundrum768
Don't take this the wrong way, but I really hate you right now!
I tried getting in on the Diablo III beta, no luck!
Here is a file of some interest, it it looks to be encrypted because it would be of interest.
/system/recovery-from-boot.p
.p files are encrypted .m files. Not sure if anything exists out there to crack into that one, but I am sure it would tell some very interesting information and possibly allow hi-jacking the factory restore process?
Anyone familiar with .p files (pcode files) ?
---------- Post added at 12:20 PM ---------- Previous post was at 12:08 PM ----------
Also of interest are some .xem3 files under /system/lib/ducati
base_image_app_m3.xem3 --- 57 mb
base_image_sys_m3.xem3 --- 1.5 mb
I think could be system image files possibly from the little bit of research I have done. Due to the size of one of these (57 mb) and the name of the file, I was thinking maybe this is where the restore was getting it's base image from, but until I dig further I am not sure of that. The size of the file is what got my attention, much larger than other files in lib. That's half the size of CM7 in just one file.
Edit: These now look to be possibly drivers/firmware/images for Ducati and/or Pandaboard ? That's a large driver file....
The .p file is very much of interest I would think.
conundrum768 said:
Hmm . . . let me get a hold of it and I'll look at it tomorrow, I've already taken the rest of the week off (Diablo III beta key came in tonight).
Click to expand...
Click to collapse
It looks like the normal XML files are not controlling the layout and it is done through the smali files to get the custom actions and layout. A separate app to access development may be best for now, as we have been doing.
Unless someone edits the smali files of course, that's possible but will prove tedious and time consuming unless you have a lot of experience with these.
If you review the logcats from going into settings, you will see which smali files are involved.
I have almost a full system dump on an ftp so ill see about letting it be accessed.
Sent by breaking the sound barrier
Please upload full system dump from Nook Tablet
Please upload full system dump from Nook Tablet
How-to
1. Get root
2. Run terminal (enter su if symbol $ -> it will be changed to #)
3. Execute command mount
4. From list of partitions search for /system
Code:
Example: /dev/block/mmcblk0p27 /system ext4 ro,relatime
5. Dump it to sdcard with command dd
Code:
Example: dd if=/dev/block/mmcblk0p27 of=/sdcard/system.img
It dumps only system image not personal data...
I'll just upload a .zip to dropbox.
Is there a sanim.zip anywhere? If so, that's the bootani. If not, ill sink back to silence lol
Sent from my Samsung Legendary 4G, a Universe UTES phone, running "two.three.five"
I looked through and there are only a few .zip files but none of them actually contained a bootanimation. It really is annoying lol. This device is such a bastardized version of android, I can't wait to get past the bootloader. lol.

Can't get rom to read custom apns-conf.xml [Solved]

Hi I'm running a Roggers rom for the LG P925 and I'm trying to use a custom apns-conf.xml file but I can't seem to get the rom to read these values.
By default the APNs that are displayed are the Roggers APN.
These APN values are not in the default apns-conf.xml but seem to be set via a apk called Flexprovider.apk. If I replace the default apns-conf.xml with a custom apns-conf.xml and select “reset to default” it always reloads the Roggers APN list.
If I remove the Flexprovider.apk and reset to default then the APN list is blank. Putting the apk back gives the APN list again.
I have also replaced the Flexprovider and apns-conf.xml with ones from a similar rom that gives me the APNs I’m after but still the APN stay blank.
I don’t know much about this (only want I have research on the web) but it look almost to me that there is a switch that is telling this rom not to read the apns-conf.xml file and use the Flexprovider files instead.
Has anyone else seen this before?
After a bit more digging and playing I found the answer, I needed to copy another directory over.
so to get this to work I needed to
Replace the flexprovider in \system\apps
Replace Flex folder in \system\etc
Replace apns-conf.xml in \system\etc
attached in the replacement app, folder and config if anyone else needs it
johnw230873 said:
After a bit more digging and playing I found the answer, I needed to copy another directory over.
so to get this to work I needed to
Replace the flexprovider in \system\apps
Replace Flex folder in \system\etc
Replace apns-conf.xml in \system\etc
attached in the replacement app, folder and config if anyone else needs it
Click to expand...
Click to collapse
A little bit late here....
how did you find out that the apns were set from the flexprovider.apk?
xiltepin said:
A little bit late here....
how did you find out that the apns were set from the flexprovider.apk?
Click to expand...
Click to collapse
he is wrong
u do not need any apk's and ****
just copy/replace the apns-conf.xml and then go to APN and from menu choose : "restore to default"
it will force load your new xml.reboot the phone

[Q] Changing Settings menu options

I'm running a Galaxy Nexus, and the ROM I'm currently on has a Perfomance option in the Settings Menu, which gives control of the kernel and stuff. However, I'd rather use TricksterMod, and I would like to be able to launch TricksterMod from Settings instead of the Performance app.
So far, I've decompiled my Settings.apk, and looked through the files, and I'm not sure what to change.
I have to change \settings\res\xml\settings_headers.xml, correct? Specifically,
Code:
header android:icon="@drawable/ic_settings_performance" android:id="@id/performance_settings" android:title="@string/performance_settings_title" android:fragment="com.android.settings.performance.PerformanceSettings" />
I would also have to change \settings\res\values\strings.xml, specifically, the string referenced by "@string/performance_settings_title" so that I can have the correct name, correct?
And similarly, settings\res\drawable, for the icon.
The big question is, what do I replace with for "com.android.settings.performance.PerformanceSettings"? Do I need to move TricksterMod somewhere specific, or what would I reference? \data\app\com.bigeyes0x0.trickstermod-1.apk?
After making all these changes, I'd simply recompile and push the Settings.apk back without signing, correct? Have I missed any steps?
Firnagzen said:
The big question is, what do I replace with for "com.android.settings.performance.PerformanceSettings"? Do I need to move TricksterMod somewhere specific, or what would I reference? \data\app\com.bigeyes0x0.trickstermod-1.apk?
Click to expand...
Click to collapse
That's what I would try BUT would just be that, to try, seems like you have everything else covered.
Hm. Well, that didn't work.
I successfully made the edits, recompiled, and pushed the file in place of the old Settings.apk.
The Settings app immediately disappeared, and trying to install it (selecting the .apk with a file manager) didn't work; it simply gave me an 'App failed to install'.
Any suggestions as to what I might have done wrongly?
Anyone?

Categories

Resources