[Q] making system apks Into regular installable apks. - Android Software Development

I was wondering how to make a system apk such as idk the browser into a regular installable apk so that someone with no knowledge of pushing apks can install it along side their apk.

Generally system apps are just normal apps, only installed on a system partition. If you pull a system apk from a device, then you should be able to install it normally on any other device.
There are exceptions from this rule:
You can't install an app if you have it installed already. Many system apps are installed on most devices by default and this is the reason, why you can't install e.g. Browser.apk pulled from other device - most probably you have it installed already.
There are 2 solutions: you could remove system app before installation of new one or just replace it - but this isn't what you want. To create normal, installable apk you would have to modify its package name as I did with Google Maps.
Some system apps use system internals, private APIs or privileges, some additional libraries, etc. For example Settings.apk changes internal settings of OS - you can't do that in normal apk.
You can't easily move/install such apps, they're integrated with system.

thanks for this long great reply. So lets say I pulled my dialer apk changed the package name, could I install it on a friends phone NOT on the system partition ?
I'm trying to pull the dialer apk from gingerbread and port it into a normal apk using apk tool, but once and changed the package name and all that and compile it I go to install it on my phone but it says that it could not open it as an apk file. Any ideas?

Newklearx3 said:
thanks for this long great reply. So lets say I pulled my dialer apk changed the package name, could I install it on a friends phone NOT on the system partition ?
Click to expand...
Click to collapse
I think not. Note that Phone.apk is only one app that can dial, you can't add such feature to your own app, so most probably it uses private APIs to do that. It's integrated-with-system one. Same for Settings.apk and PackageManager.apk, but you should be able to pull Browser.apk, Launcher.apk, MMS.apk, Gmail.apk, Talk.apk, etc., change their package name and install on another device.
Ahh, there is one more group: SenseUI, Motoblur, etc. apps, which use additional framework resources: images, colors, texts. They won't work on a device lacking this framework, but it should be possible to make these apps framework-independent by copying all dependencies to app itself. Not that easy, but possible

Brut.all said:
I think not. Note that Phone.apk is only one app that can dial, you can't add such feature to your own app, so most probably it uses private APIs to do that. It's integrated-with-system one. Same for Settings.apk and PackageManager.apk, but you should be able to pull Browser.apk, Launcher.apk, MMS.apk, Gmail.apk, Talk.apk, etc., change their package name and install on another device.
Ahh, there is one more group: SenseUI, Motoblur, etc. apps, which use additional framework resources: images, colors, texts. They won't work on a device lacking this framework, but it should be possible to make these apps framework-independent by copying all dependents to app itself. Not that easy, but possible
Click to expand...
Click to collapse
Dude, you're amazing! So how would I go about porting the gingerbread dialer to workable installable apk?
I might be doing something wrong but I pulled the launcher and changed the package name and still the same error
Okay, i guess I'm not. I copied the apk ( unmodded ) from the rom zip and placed it on my SD card to install it and the same error, so there must be something wrong.
figured out it was the sdk version, got it to show up but wont install now.

im also interested in porting specific development apk, lets say.. CM Settings into a non Cyanogen. Tried that once by pulling CM*.apk and push it to other non Cyanogen but got cant be installed message.. any hints on this?

phoezies said:
im also interested in porting specific development apk, lets say.. CM Settings into a non Cyanogen. Tried that once by pulling CM*.apk and push it to other non Cyanogen but got cant be installed message.. any hints on this?
Click to expand...
Click to collapse
Use logcat as a start to see dependencies
XDA App

Related

Will Pay: AOSP Dialer - Installing Contacts.apk to work with Sense

UPDATE: I'll pay someone to create an update/patch that works with Fresh's newest rom.
I want to use the AOSP dialer as the default dialer in android. I already know that the HTC dialer cannot be uninstalled. Tried ADB push and file manager install. ADB push will push the file to the system/app folder but the file itself will not install. File manager will not let it install either.
I've attached the file below.
Any suggestions?
warmachine69 said:
I'm using Fresh's Rom. Tried ADB push and file manager install. ADB push will push the file to the system/app folder but the file itself will not install. File manager will not let it install either.
I've attached the file below.
Any suggestions?
Click to expand...
Click to collapse
with sense contacts and the dialer are one and the same. that apk won't do anything for you, wait for an aosp build
Don't want an AOSP build, I like sense, I just don't like the dialer. I believe you can run both dialers at the same time with Sense. Check this post:
http://forum.xda-developers.com/showthread.php?t=711639
warmachine69 said:
Don't want an AOSP build, I like sense, I just don't like the dialer. I believe you can run both dialers at the same time with Sense. Check this post:
http://forum.xda-developers.com/showthread.php?t=711639
Click to expand...
Click to collapse
There are so many changes made to that rom I don't think you can just install aosp contacts/dialer without a lot of work(i've tried :/)
Try this
http://forum.xda-developers.com/showthread.php?t=711639
If anyone wants some coin please read the first post.
I would like this as well but for the Warm 2.2 ROM. I'll make a payment too
How do you like the AOSP dialer more than the Sense one? Smart dial is awesome and you can't do that with AOSP. Plus, the AOSP dialer is just plain ugly, it looks like google made just to be able to say "hey, we tossed a dialer in there too". I know different strokes for different folks but this I just don't get.
warmachine69 said:
If anyone wants some coin please read the first post.
Click to expand...
Click to collapse
I was thinking gold bars, not coins.
_MetalHead_ said:
How do you like the AOSP dialer more than the Sense one? Smart dial is awesome and you can't do that with AOSP. Plus, the AOSP dialer is just plain ugly, it looks like google made just to be able to say "hey, we tossed a dialer in there too". I know different strokes for different folks but this I just don't get.
Click to expand...
Click to collapse
If you will swap AOSP/Sense and Google/HTC I will agree with you. ;-)
If I recall correctly, the default way in Sense to search for contacts names is using a numeric keyboard.
Install AOSP, Dialer, Browser, Contacts, and OR Calendar.
Try go Contacts, I love it but if you really want the AOSP read bellow:
Find the AOSP apps from a CM6 build by unzipping and pulling the .apk file like browser.apk. Install "File Expert" (Free and amazing file browser with full root access and alteration capabilities application)
Copy the .apk you wish to have on to your phones SD Card
Run File Expert,
hit menu/more/File Explorer settings. Then check "Root Explorer" on the bottom.
hit menu/more/mount/Mount As Read Write
Browse to /System/Apps Find the App you wish to replace with the AOSP version.
Hold Down on the App and when the options come up choose file operations and rename to something like application name.apk.bak
Browse to your SD Card find your app. hold down to choose file operation then choose copy.
Go back to /System/Apps then hit Menu button and choose paste.
Locate the app you just pasted and hold down on it and in file operations choose "permissions" Check Everything and exit out of File Expert
Note: You may need to redo the shortcuts for the app on your desktop and or launcher.
Note: Must have a rooted phone.
Note: 2.3.3 apps may or may not work on 2.2 Android Roms and vice versa.
Note: if this causes errors or failures delete the new apk and rename the old apk to its original name.
Good luck!!

[Q] Own ROM issues?

Right.
So, when I open up .ext3 files in 7zip I notice they have "users" and "modes".
Things I'm curious of:
1. How can I remove apps in my ROM via .ext3 editing?
2. How can I install apps in my ROM (via .ext3 editing)?
3. Just simply removing the .apk for, let's say, the Phone app (BlurPhone.apk) and putting a different apk named Phone.apk, but with the same function and simply being a port from a different phone, will it be a issue?
4. GO Launcher EX/Go Locker - can it be installed in a ROM?...
Also, I got some issues regarding the MD5 Sum ("mismatched " but it actually is a duplicate ). Was it because I had a vanilla copy of my backup in the backup folder?..
Bump?...
Firtst if all, learn to make an cwm zip , its much easier to make changes that way.
To remove an app, just remove the apk file. Do the opposite when adding apps.
Any launcher can be added to rom.
Sent from my MB525 using xda app-developers app
This excellent instruction might help you with building from source:
http://forum.xda-developers.com/showthread.php?t=1593117
thanks, but sadly I'm not going to develop 4.0/4.1 stuff, only 2.3 skins for the moment. Thanks for the help tho
Another (kinda random, but hey): how's the lockscreen app named?...Or is it a sub-part of a motoblur app?

Building first ROM for G900V

Good day, all!
I've been working on [my first] ROM for Verizon S5 and everything seems to be going great! I've cleaned out as much Samsung/Verizon/Google trash as I can, applied some tweaks to build.prop, changed some default apps to (IMHO) better replacements, and anything that is left (functions correctly) has been moved to /data/app so they can be Uninstalled fully (not just Turned Off). Just a few quick questions:
1) How can I "bake-in" app data? I have replaced the normal, crap launcher with Holo Launcher and cannot seem to get correct permissions when the ROM is installed thru SS. I believe the issue is permissions for /data/data/ get screwed up or not set correctly. I have looked and looked and tried to determine the correct permissions, but still no joy. I've tried to fix /data/data permissions in the updater-script, but it seems like each subfolder/file has different permissions making me think I'll have to go thru them one-by-one.
I have a work-around in place using a OneTimeInit script that does work, but it seems like that's not really the best approach?
2) Kind of ties into question number 1, I patched the framework-res.apk in to allow WiFiHotspot, but without being able to install the system settings data properly, there is not a "Quick Shortcut". Again, I've resolved the problem using the OneTimeInit to update Sqlite DBs after the system is up.
3) How do I de-odex the stock ROM? Using Android Kitchen doesn't seem to do it right. It works mostly but I still seem to get various FCs. I tend to believe that some things just cannot (should not) be De-Odex'd?
I've also discontinued Zip-Aligning because it sometimes produces errors on my ROM. Is it not advised to use Android Kitchen to do these tasks or is there some trick to getting it to work just right?
Bonus Question) I was going to share my ROM on XDA but it says I'm not allowed to post in Development. I assume because of my low post count. Any way I can get an over-ride or should I just make a few more posts and then do it?
Thanks again guys!
I appreciate all the help as always!
Jake
jake5253 said:
Good day, all!
I've been working on [my first] ROM for Verizon S5 and everything seems to be going great! I've cleaned out as much Samsung/Verizon/Google trash as I can, applied some tweaks to build.prop, changed some default apps to (IMHO) better replacements, and anything that is left (functions correctly) has been moved to /data/app so they can be Uninstalled fully (not just Turned Off). Just a few quick questions:
1) How can I "bake-in" app data? I have replaced the normal, crap launcher with Holo Launcher and cannot seem to get correct permissions when the ROM is installed thru SS. I believe the issue is permissions for /data/data/ get screwed up or not set correctly. I have looked and looked and tried to determine the correct permissions, but still no joy. I've tried to fix /data/data permissions in the updater-script, but it seems like each subfolder/file has different permissions making me think I'll have to go thru them one-by-one.
I have a work-around in place using a OneTimeInit script that does work, but it seems like that's not really the best approach?
2) Kind of ties into question number 1, I patched the framework-res.apk in to allow WiFiHotspot, but without being able to install the system settings data properly, there is not a "Quick Shortcut". Again, I've resolved the problem using the OneTimeInit to update Sqlite DBs after the system is up.
3) How do I de-odex the stock ROM? Using Android Kitchen doesn't seem to do it right. It works mostly but I still seem to get various FCs. I tend to believe that some things just cannot (should not) be De-Odex'd?
I've also discontinued Zip-Aligning because it sometimes produces errors on my ROM. Is it not advised to use Android Kitchen to do these tasks or is there some trick to getting it to work just right?
Bonus Question) I was going to share my ROM on XDA but it says I'm not allowed to post in Development. I assume because of my low post count. Any way I can get an over-ride or should I just make a few more posts and then do it?
Thanks again guys!
I appreciate all the help as always!
Jake
Click to expand...
Click to collapse
1: All I had to do was place apk in /system/app or /system/priv-app and thats it. Make sure when you add your apks you dont unzip the archive. basically use kitchen and build your base rom then simply open the archive and make your edits. I also used the updater script from beans base build and only edited the ui print.. Messing with the updater script i wouldnt recommend as it could be causing some of your issues.
2: If using beans base theres no reason for you to edit anything as the hotspot is already baked in.. you must have borked it.. If you are not using beans base then maybe you should copy his files for the native hotspot as its already done properly. I wouldnt mess with framework or settings apks unless you know what your doing. Id work on gettin the fcs n other issues sorted first as you might b doin too much too fast.. work on learning how to make your apks work first before making edits to framework n settings apks.
3: The kitchen is best to deodex and zipalign.. also these two things should not cause fcs or errors if done properly. zipalign should help more than anything.. i just like workin with deodex bcuz its easier and only one set of files instead of .apk and .odex for just bout everything..
Again, if you are not using beans bases id recommend to do so.. his bases are already deodexed have hotspot zipaligned read/write to ext sd etc.. so you wouldnt have to do all from scratch and have so many issues..
Sent from my SM-G900V using XDA Premium HD app
elliwigy said:
1: All I had to do was place apk in /system/app or /system/priv-app and thats it. Make sure when you add your apks you dont unzip the archive. basically use kitchen and build your base rom then simply open the archive and make your edits. I also used the updater script from beans base build and only edited the ui print.. Messing with the updater script i wouldnt recommend as it could be causing some of your issues.
2: If using beans base theres no reason for you to edit anything as the hotspot is already baked in.. you must have borked it.. If you are not using beans base then maybe you should copy his files for the native hotspot as its already done properly. I wouldnt mess with framework or settings apks unless you know what your doing. Id work on gettin the fcs n other issues sorted first as you might b doin too much too fast.. work on learning how to make your apks work first before making edits to framework n settings apks.
3: The kitchen is best to deodex and zipalign.. also these two things should not cause fcs or errors if done properly. zipalign should help more than anything.. i just like workin with deodex bcuz its easier and only one set of files instead of .apk and .odex for just bout everything..
Again, if you are not using beans bases id recommend to do so.. his bases are already deodexed have hotspot zipaligned read/write to ext sd etc.. so you wouldnt have to do all from scratch and have so many issues..
Sent from my SM-G900V using XDA Premium HD app
Click to expand...
Click to collapse
Thank you for the response!
It seems perhaps I didn't quite make clear what I've done versus what I'm trying to accomplish.
Firstly, I wouldn't go so far as to say I'm "having so many issues". Everything in my ROM is in perfectly fine working order. I just have these few quirks that I would like to address both so I can learn, and to make this and future projects better.
While I appreciate the recommendation to use bean's base, I have taken a look at his and there seems to be nothing in his which copies data into /data/data/com.whatever.package (or at least there's nothing in his zip in the /data/data folder -- not sure if his ROM has the toggle activated?)
I have the Apps working correctly in my ROM -- they just go in /data/apps, /system/app or /system/priv-app, respectively.
What I need, is to get /data/data/com.whatever.package/ copied With Correct Permissions when the ROM is installed; I do not want a second zip to update things after install, especially for a toggle and a couple shortcuts, seems silly.
For instance, when you boot your phone up with the default [stock] samsung launcher, it has a list of default apps and widgets on the first screen you see such as phone, messages, a clock widget, etc, etc. Since I've replaced the stock launcher with Holo Launcher HD and some other default apps have also been replaced, there's very few shortcuts on the main launcher screen.
** Holo Launcher does have a list of default apps it adds to your main page, but many of those have been removed in my rom.
The solution I've come up with basically waits for the system to boot up to the point that Holo Launcher actually creates the default (mostly blank) /data/data/com.mobint.hololauncher.hd/databases/launcher.db and then my script uses sqlite3 to update the DBs with a list of different shortcuts -- ones to apps that actually exist.
The Hotspot Toggle is the same way as above.. Hotspot works fine in my rom if you go through settings!
I just cannot add the notification panel pull-down toggle to /data/data/com.android.providers.settings/database/settings.db until after the system boots up at least ONE time, and then update the DB to include WiFiHotspot in notification_panel_active_app_list and notification_panel_active_app_list_for_reset
As for the zipalign and deodexing, I will have to try those again now that I have a fairly stable rom.
****EDIT****
I think I figured it out. I can just use busybox to kill the systemui after I update the databases during the first boot. I also figured out how I can add the SetupWizard without it locking up on activation.
Thanks anyways, guys.
Look for my rom, coming soon!
=P
Please add support for more languages
I found a mod for Motorola latest 4.4 please port it
Sent from my SM-G900T using XDA Free mobile app

mms cyanogen 12 apk touchwiz

Anyone can help me to install Cyanogen MMS apk on touchwiz lollipop , on I9505 ?
Btw, I managed to install Trebuchet on touchwizz and is fully working, but I need that MMS apk too.
Even a backup made with titanium backup would help me.
Thanks !
And please don't reply if you are a noob.
Are you trying to install them like regular apps, or are you copying them to /system/app or /system/priv-app as appropriate?
Strephon Alkhalikoi said:
Are you trying to install them like regular apps, or are you copying them to /system/app or /system/priv-app as appropriate?
Click to expand...
Click to collapse
I copied it to both locations, I restarted my phone and now what?
Maybe I must copy it in a specific folder, but I don't know exactly where.
If you copied them to the proper locations Android should have updated on a reboot. Make sure the permissions are properly set. Other than that, if it's not working, e.g. force closing, then the app likely needs a supporting library not found in the Touchwiz ROM.
Strephon Alkhalikoi said:
If you copied them to the proper locations Android should have updated on a reboot. Make sure the permissions are properly set. Other than that, if it's not working, e.g. force closing, then the app likely needs a supporting library not found in the Touchwiz ROM.
Click to expand...
Click to collapse
Ok. What is the proper folder? If you know it.
I did not find anything with sms
I mentioned the proper locations in post 2. MMS goes into /system/priv-app. The MMS directory, as all apps are now stored in their own directories, should have permissions rwxr-xr-x and the app itself should have permissions rw-r--r--.

Tweak theme without computer

I don't spend lots of time at the computer, so I like to find ways to do as much as possible on the phone. One thing I've found is that every theme I try has at least one element I wish I could change, as much as I like it overall. I don't know enough to make my own theme, but I found a way to change elements of the theme without using a computer. I'm sure this is not news to many of you, but I figured there might be other non-experts like me out there who might appreciate it.
1. Download Apktool apk file below, install it, open it, {it will automatically update on the first use for some reason}, go to settings and check 'device has root', {leave other settings alone}, then close the app, reopen and grant su access.
2. Make a directory in storage somewhere called 'apktool', {or something}, and copy the following to it: /system/framework/framework-res.apk, /system/framework/SemcGenericUxpRes/SemcGenericUxpRes.apk, and whatever themes you want to mix and match.
3. Open apktool app, navigate to apktool directory, and import the framework files by tapping on each one and selecting 'import as framework'. When done, you can then tap on the theme apk files and select 'decompile all', and they will be decompiled into folders called {appname}-src. Go into the folders with a root explorer and change what you want, then go back to apktool, and tap on the folder you want and choose 'recompile'. When recompile is done you end up with an apk called '{appname}-src.apk'. Tap on that and choose 'sign'. When done you will get an apk called '{appname}-src-sign.apk, which you can install normally.
-Notes, questions-
- I'm currently using Z1c stock .236 deodexed rom. This app should work on other phones, roms, versions, etc, but I can't say for sure. What I know is that there are at least 5 versions of the app out there, {Google search for 'apktool 4.4' or '5.2', etc}, and it seems like each one works better on certain versions of Android. There are also configurable settings. If you have a different phone or rom, etc, you just have to mess around with it.
- This app should work as normal apktool for modding systemUI and framework, but I can't get it to recompile on LP, but only on Kk. Decompile works fine, but on recompile it complains about lacking resources. I don't know what file it wants. If someone can figure it out that would be great.
-If you don't know what files to change, all I can say is that I didn't either. Start with the obvious stuff, like navbar keys, and see how brave you get. Just make sure your file names are changed, since every app doesn't use the same names for the same files. As long as you work with copied files you have nothing to lose. If something is wrong with your modifications, then it won't recompile correctly, and you'll just get an error message, so you can't really install something that's going to mess up your phone.
- This also works for changing appearance of other apps, not just themes. See my recent posts in the Naked Browser thread for examples. However, sometimes it won't be able to decompile an app, and there's probably nothing you can do. I think the way apktool works is based on how the app was created. If something is not compatible, it just won't work.
- You don't have to decompile just to pull files out of an apk, but you do need an app that can do it. I use Rom Toolbox Pro. There may be free ones, {maybe Mixplorer}. I think you can just change the extension to zip and extract normally. However, some files and folders are not the same zipped in the apk as they are when decompiled.
File link - https://drive.google.com/file/d/0B5E7sFT1phjoS003R0tkM21qUlk/view?usp=docslist_api
Nice tutorial bro :good:
Thank you very much!
Sent from my D5503 using XDA Free mobile app
Since sharing themes with others' work is not kosher, (http://forum.xda-developers.com/crossdevice-dev/sony/share-frankentheme-t3282360), I figured I'd add a little more here for anyone's personal use. In general, here's what I've found with these themes:
- Within each apk there is an 'assets' folder, which contains zip files. Each zip file mods a certain aspect of the ui. For example, there will be one for settings, which contains the little pictures next to each settings option, (personalization, with the little rainbow, etc). You can experiment with simply swapping these around with different themes. However, if you want to add a settings zip, for example, to a theme base that does not already have a settings zip in it, you have to mod the main android manifest file in the top level of the apk. If you want to see how it needs to be modded, look at one that has it already. It's pretty obvious, since it's the same entry for each zip, but with the corresponding zip name. You can also extract these zips and replace files in them and rezip. Keep in mind, though, that there are some things that aren't that simple and just won't work.
- There are some things that are coded in, and can't be changed, (as far as I can figure out), like accent color. It seems like accent color just comes with the 'android' zip, and there's nothing you can do about it. As a workaround, you can find an 'android' zip with a color you like, and change out the other files from the zip you wish you could change the accent on. Again, sometimes it just won't work and you won't know why.
- Some themes don't follow this pattern at all. I haven't learned much about them yet.
Screenshots show examples I've used...

Categories

Resources