[Q] Mod a mod to add custom apks preinstalled? - Desire Q&A, Help & Troubleshooting

Hi..
I've had problems with Gmail and Maps applications previously with Neophyte ROMs. In that case one of the solutions was removing the apks for these apps from with the /system/app folder of the ROM zip.
My question is:
Is it possible to add our own apks to the custom ROM so that these apks come preinstalled on the ROM when someone flashes it..in a manner, a kind of 2nd generation mod?
Is it possible to add our own system variables and settings files so that the ROM autoinstalls it on First Install? In particular, I'd like to preset my own APN file for the network.

The simple answer is yes.
The entire system folder in the zip file is written to your /system partition, with the full architecture of folders and so on, so any changes made in there will also be on the system, when it is flashed.
There is also a script file, in the META-INF folder, which you can use to run commands to delete or edit something along with the flash, whenever the zip file is flashed. This is a bit more advanced though.
edit: it is the same for the data folder of course, which folders is flashed and where to is also specified in the script file mentioned above.

Thank you!
In that case, for installation of a program like Gmail.apk or Maps.apk, would be as simple as adding the .apk to the /system/app, or would I have to include other files? Would there be dependancies in other folders?

Well the apps have their own data folder on the data partition, but this is for storing changes in settings and so on, and it should be created by the app itself on first boot just like right after you wipe the data partition/factory reset

Thanks..Got some mod modding to do!

So in case I'd want to manually uninstall/manually install an apk, what would be the steps I'd have to go through?
Would there be filesystem config files (like the older Windows versions), or a central database of entries of the likes of the Registry tables of newer Windows? How does Android go about installing a file? Like which folders and files would be modified other than /system/app and /data/app? Any common files with entries? And in case of the latter, whether it would be machine readable or plain text?

Related

[need dev help] how to make rom to work without sd-ext

how to make rom to work without sd-ext
i gonna make the rom smaller and might fit to the 1giga rom
thx
This is the wrong section probably, but ill answer just for the sake of me replying to tell you its the wrong section anyway.
Its not straight forward. You probably should let them do what they do, the builds work right? An sd ext is an inconvience 'if' you are a t-mo owner. Not that its the biggest deal, its really not, make the partition 1GB on your SD, and forget about it. You probably wont even notice it.
WARNING: Moving stuff around in these folders will most likely cause you a bootloop. You can adventure, but just be fore-warned! Deleting wrong files will cause it to not install.
Anyway, if it really bugs you, heres a rough breakdown:
1. Go here: http://developer.android.com/sdk/index.html (you may need java, make sure you have this as well)
2. Get the SDK
3. Extract to a folder that wont get lost, like C:\Android is usually good.
4. Now, open the .zip file of your rom you want to shrink, using winrar or winzip or 7zip
5. Extract the folders/files to your desktop.
6. Go into the sd-ext folder, and move the folders to their respective locations (so apps goes under /system, framework goes under /system, weather under /media, etc.). Once no more files/folders reside in the sd-ext folder, you can delete it.
7. Go into the 'app' folder [now under /system] and delete some of the APK's that you dont want. Be VERY careful though, deleting wrong files WILL cause it to bootloop.
8. You can also find other delete-able files in the media folder under system.
Delete files that you know what they are. Example: VoiceSearch.apk will obviously delete the voice search. FriendsStream.apk, will obviously delete the friends stream app. Just stick to common sense.
Now, last step, the trickiest. MAKE A BACKUP OF THIS FILE (probably the easiest way)
9. Go into META-INF\com\google\android\ and right click updater-script and choose open with notepad.
10. Go through, and delete all sd-ext related entries.
11. Double check all necessary 'unpacking' entries are there. So, typically these:
-package_extract_dir("system", "/system");
-package_extract_dir("boot","/boot");
-package_extract_dir("data", "/data");
12. Some mount stuff for the sd-ext. can be removed, same with mkdir sd-ext. as we dont need anything related to sd-ext. this is the point.
Once done with the files/folders, rezip the files/folders like how you see them in any other roms zip file.
Dont make it a zip like this:
Pyramid_HTC_Europe_v1.x_Tmous.zip>Pyramid_HTC_Europe_v1.x_Tmous/data, system, meta-inf, boot
Make like this:
Pyramid_HTC_Europe_v1.x_Tmous.zip>/data, system, meta-inf, boot
It wont read it unless those 3/4 folders are not in any other folder.
Now that you have the new rom file, LAST step, and I promise, its the last. You have to go to that C:\Android folder, and go to the autosign.bat file. Follow the instructions. For more info on this part, you can search this site. There are a few guides on re-signing files.
But, you are done
________
As long as you make sure you did all that, it 'should' work. But please, do the necessary reading! This is not a walk in the park. For the script, you should look at working ROM's file, compare. See how they work. Understand them.
As proof. I actually JUST converted dungs new mytouch 4g rom that required even t-mo us to have an ext, to NO ext. I dropped the whole package by 100MB, did what I just posted, re-worked the script, and resigned. Just flashed fine, its much quicker now .
Hope this wasnt confusing. Probably was, but thats why I tried to be as detailed as I could be without going overboard. Anyway, let me know if you have questions.
I am not understand the question. Which rom bigger than the 1Gb Hd2 t-mobile rom?
thx theslam08 that what i wanna do
make the mytouch 4g rom of dungs sd-ext lesss if u could upload it and link me i will very grateful
@ntluan
i just want that rom will use only the ROM space not sd-ext too
Sure, I got permission from dung, so I posted it in that thread. Compare my updater script with the one he has for his sd version. You will see what I changed, what you need to do.

Install apps from recovery!!

guys how can i put a bunch of applications in a zip folder a flash it by recovery.Ive tried putting 3 apps in a zip folder and flshing it via recovery but it says failed..
I tried that a while ago on the g1 with mixed results.
You have to put them in the data/app/ folder the same way they appear on your phone. If you are feeling ambitious, you can also grab the corresponding folder in data/data. You'll have to look for the java package name, not the app name. Lastly, you have to adjust the updater-script in META-INF/com/google/android/ to mount and flash the data folder, not system and then clean out the extra cruft.
You might have to resign the zip or just toggle sig checks.
Other options include using recovery to restore the data partition, but this will be everything, not just your 3 favorite apps. Alternatively, you could write a script that runs from your PC while your phone is in recovery and use the "adb install" command. I think there are also apps that do that for you, such as Titanium backup.
Gee one thanks for the reply but can you plz reexplain "If you are feeling ambitious, you can also grab the corresponding folder in data/data. You'll have to look for the java package name, not the app name. Lastly, you have to adjust the updater-script in META-INF/com/google/android/ to mount and flash the data folder, not system and then clean out the extra cruft.
You might have to resign the zip or just toggle sig checks."
Your phone stores the app in data/app/some.java.name.here so if you use flash those files, your apps will be installed. The app itself stores settings, history, etc in data/data/some.java.name.here If you flash the corresponding folder in data/data, you'll also get all your settings and won't have to bother setting it all up from scratch.
If you use adb or a file explorer to poke around in your data/data and data/app folders, you'll see what I mean.
In order to get the zip to flash, you have to include "instructions" that tell the recovery what to do with the zip. Unzip one of the flashable roms and look in the META-INF/com/google/android folder. There should be two files there. You want to edit the updater-script so that it flashes your data. Most likely, it is set up to flash a custom rom to your system folder. You'll have to do some editing and some trial and error to figure it out, but if you are just flashing the data partition, most of the commands in updater-script will be superfluous.
Lastly, and this the part that everyone hates (second only to adding adb to your path), you either have to sign the zip with jarsigner, signapk, or something similar, or turn off signature checking in your recovery. Signing the zip is essentially adding a digital signature so that your phone knows that the zip is intact. Clockworkmod recovery will let you toggle the signature checks in one of the options- poke around and get familiar with your recovery. It's probably in there somewhere.
I think Titanium backup will let you freeze/unfreeze apps- you might want to consider it.
Thanks
Sent from my HTC Vision using xda premium
Did this work? Like to buy a beer for someone who wants to upload a zip with a file explorer all for a project I have that has no play store or file explorer on it. Thank you

How to locate required items to make .apk work (lib, framework, etc)

I've been looking into manually installing some .apk apps on a nosense custom rom.
Mainly system linked .apk files.
Next to having the apk file for installing an app how do i find the rest of the files required for the app to work?
Normally the system apps have many more files spread over the libs, framework, addon, etc folders.
Trying to findout how to locate those extra items.
Thanks for the help.
You mean like the Sense Camera? No one has ported sense stuff to non-sense ROMs before, most likely before HTC Sense is closed source.
OutlawEmblem said:
I've been looking into manually installing some .apk apps on a nosense custom rom.
Mainly system linked .apk files.
Next to having the apk file for installing an app how do i find the rest of the files required for the app to work?
Normally the system apps have many more files spread over the libs, framework, addon, etc folders.
Trying to findout how to locate those extra items.
Thanks for the help.
Click to expand...
Click to collapse
that's kinda tricky to explain here, you should look for some guides out there... it isn't very easy believe me
was hoping there was a way i can use a program or so to check the apk data itself for the files it requires.
Use to mod some games and inside one of the data files you'd always find the dir and link to the files it's attached to.
Looking for something like that basicly.
If i were to findout for example which lib files the polaris office.apk uses i can push those to system (together with every other file it needs to work) and it should endup working just fine.
with nosense i actually mean what RENOVATE and Revolution HD call it when they actually use sense+ but then remove most of the sense junk and run a launcher over that. So any htc files will work just fine, they only need to be installed with every background files too.

[GUIDE]How to make your own rom

This is a simple guide to make your own custom rom……..(the other parts will be written…as soon as I become bothered to type for hours again)
PART 1:setup the kitchen and rom
1.Download java(java.com) and install the java JDK(www.oracle.com/technetwork/java/javase/downloads/index.html)
2.Download the kitchen(http://forum.xda-developers.com/showthread.php?t=633246) (thankyou DSIXDA for your amazing kitchen)
3.Download Cygwin(Cygwin.com)
3.extract the cygwin file(using winzip or winrar) in C drive only….dont put it into any folders
a.Enter a file called Cygwin(setup file)
b.click next>install from local directory
c.now it will ask you where to put the program….leave everything as default
d.now It will ask you where the location of the packages are so>click browse>click my computer >go to drive C>and you will fin the folder Cygwin-packages>so select that folder and click ok>next.
e.now it will extract the folders>a promt is going to pop up..>click ok
f.now you will see a list>go to the first line and you will see next to the word ALL ,two arrows>click on them so all files can be installed.
g.now it will install the program whick take from 5-10min.
h.when its done …select finish.
i.you can now delete the setup file and Cygwin-packages folder.
j.now enter the Cygwin program and it will create some files..>when its done exit the program….
Now Cygwin program is done installing .
3.To use the kitchen:
a.Enter Cygwin folder>home>your user name>so you will find 3 files
b.in the same folder>extract the kitchen zip file(Android-Kitchen-master.zip)
c.now enter the kitchen folder>you will find a folder called>put rom here.
d.so in that folder>either put a rom.zip file or put a system.img file if you want complete stock…..(which you get from the ruu of your phone)
e.now enter tools folder>edifly_......(something like that) and see if you mount points are in it…
f.to know go to your build.prop file>check ro.product.device>and if you see a txt file under the name of your device …..your device is supported…
g.if NOT,go to the original thread …where the dev has stated a way on how to add your device…..
Now we are done from the setup of the kitchen…..
To use the kitchen:
1.Enter Cygwin
2.type
a.cd kitchen>press enter
b. ./menu>press enter
Now a list of options will come infront of you ……
3.go to the option>setup working folder>enter its number and press enter…
4.now if you go to Cygwin folder >enter home>user name>kitchen.
5.you will find a folder called(working folder_8254897)
NOW YOU ARE DONE WITH SETTING UP THE KITCHEN……AND YOU CAN START PLAYING WITH THE ROM
PART 2:Clearing up the options
Explanation for each option:
1.creates you a working folder,which extracts the rom for you.
2. It gives you super user access aka SU, Some apps require root to work properly….so if your rom isn’t rooted … it’ll be useless.
3. Busy Box is something that you install on your phone to give you some additional handy LINUX / UNIX based commands. You need Busy Box installed because some commands are not available to you and you made need them for some root level tasks.
4.To disable sounds while phone is booting
5.To add you a tethering app…..and allow you do wireless tethering
6. Zipalign is an archive alignment tool. It optimizes the way an app is packaged. Doing so enables the operating system to interact with the application more efficiently, and has the potential to make the application and overall the whole system much faster. Execution time is minimized for zipaligned applications, resulting in a lower amount of RAM consumption when running the app.
7.If you want the rom to do a FULL WIPE while installing the rom
8.To change the name of the rom
9.Checks if the update script contains any errors….because if it did the rom wont be installed correctly,which may lead to a brick
10.To see all information about your rom..ex: if you have root access/if you aren’t using stock kernel/if you have app2sd support etc..
11. Apk files have respective odexes that devs use to supposedly save space. Deodexing means you convert it back to a .dex file and put it back inside the apk. This allows you to easily replace files (not having to worry about odexes), but the main point was to deodex services.jar so that you can change all text to different colors (such as the clock color to white) and to deodex services.jar, you need to deodex everything.
12.To add a task killer….which closes applications to free RAM
13.To add a /data/app folder so applications could be installed their rather than getting installed in system/app
14.To add text editor…for ex.if you want to edit build.prop or any txt file which is in system.
15.To add a command shell which allows you to use in in the terminal
16.To give the option of moving applications to sd card
17. To add /etc/init.d scripts support ….which allow you to add tweaks and stuff for the phone
18.To allow user to put the boot-animation that he desires.
19.To be able to extract the boot.img(kernel)
20.To extract data.img (which I don’t know what it is )
21.check this (http://developer.android.com/tools/publishing/app-signing.html)
22.To covert update script to updater script which is a must before you build the rom.
99.To build the rom when you finish editing and modding.
PART 3:How to mod apks
OK SO NOW SINCE YOU KNOW WHAT EACH OPTION DOES…..LETS START MODDING,and to start customizing,you have to use an apk extractor and zipper because the apks contain all the treasure …..for example:SystemUI.apk(contains battery icons ,signal icons, the location of the clock and many many more things)
So what were gonna use is apk manager,which is an very easy program to use,and helps a lot in apk extracting and zipping and signing.
Here are the steps to use it:
1.Extract the zip file(apk manager)
2.youll find a file called setup>enter it and select option 3 and press enter.
3.folders will be created
4.so to extract an apk>select an apk file and drop it into the folder (put apk here)
5.go into script file>press enter file>and after you’ve put the apk file in the specified folder>select option 2 >so the apk will be extracted
6.after you extract it you will find the extracted files it in the same folder(put apk here) in a new folder under the name of the apk file.
7.edit whatever you want
8.When you finish >select option 3>press enter.
9.then select option 5 and 6 to sign and zipalign the apk…..
And your done ,but to find the modded apk…..go into place apk here for signing and you will find it there.
.........................
RESERVVED
Reserved45
RESE8VED
Hayde reserved yaben 3amme
W hayde kamen yaben 5alte....................reserved
Sorry need help....
donhashem.dh said:
.........................
Click to expand...
Click to collapse
Hey dude/*****.....
Me again and loving yr tutorial. But do have a couple of questions that I hope you can help with.
Firstly the update version of Cygwin menu is not exactly as yours in the tutorial. Why is the allow Tethering function not there and could this be a problem.
Secondly i am nooooooB and are unsure on how to add remove system apk's from rom. Do I just dig in and delete them from windows. And can I pull apk's from another rom to put into the data app folder which was created using Cygwin.
I was wanting to add aroma installer as well but another story....
Really appreciate if you can advise. If I sound to noooobish then understrand that I am to much work.
veroby said:
Hey dude/*****.....
Me again and loving yr tutorial. But do have a couple of questions that I hope you can help with.
Firstly the update version of Cygwin menu is not exactly as yours in the tutorial. Why is the allow Tethering function not there and could this be a problem.
Secondly i am nooooooB and are unsure on how to add remove system apk's from rom. Do I just dig in and delete them from windows. And can I pull apk's from another rom to put into the data app folder which was created using Cygwin.
I was wanting to add aroma installer as well but another story....
Really appreciate if you can advise. If I sound to noooobish then understrand that I am to much work.
Click to expand...
Click to collapse
Ayyy take it easy cun*
I'll update the tutorial because I made it from a long time and posted it now
For the apks you just enter the rom.zip system>app and you'll find all the apks there..
The data folder cygwin creates is that when you use the Rom ..the apps won't be installed in system>app anymore,they will be installed the folder the kitchen created data
And for the aroma installer,leave it for later ...your still not ready for it ...
no signature....problem ?!?!?!
donhashem.dh said:
Ayyy take it easy cun*
I'll update the tutorial because I made it from a long time and posted it now
For the apks you just enter the rom.zip system>app and you'll find all the apks there..
The data folder cygwin creates is that when you use the Rom ..the apps won't be installed in system>app anymore,they will be installed the folder the kitchen created data
And for the aroma installer,leave it for later ...your still not ready for it ...
no signature....problem ?!?!?!
Click to expand...
Click to collapse
I was going to ask you about signature but didnt want to over do it. I am guessing you need to sign it after the 99 - Build ROM from working folder?
I have proceed with the Build rom and are at the recomend to sign rom stage. Its some thing I dont understand. Is it ok to proceed without?
Cool I have noticed the roms produced by dev's here xda are not signed so doesnt seem to matter for this purpose. I have hit thx ***** 5 or 6 times.
I will hit 500 s****y if you give share some knowledge in installing arroma installer. or do you recomend just trying things....cheers anyway its been awsome.....:good:

create apk to edit system files

hi,
i want to know how do devs create an apk file that can edit files in system folder. for example sound files etc. generally a flashable zip is created which will replace the stock file with a modified one. The same thing, this time without going into recovery but being able to do it with an app itself.
Yes, ready to learn.

Categories

Resources