[Q] what is the process for upgrade pre-installed app? - Android Software/Hacking General [Developers Only]

Hi,
In my understand, the pre-installed apps are placed on path /system/app, and the /system partition should be read-only partition without rooted, right?
So how the pre-installed apps can be upgraded?
For example, the pre-installed Google Maps app can be updated from Android Market. How it can replace the old Google Maps app with a new one on /system/app? What is the process?
Can someone help me to understand it?

They're installed normally to /data/app, then system uses them instead of files from /system/app. You could have checked this out by yourself.

what is the details about Google maps upgrade?
Hi, Brut
Thank you.
But could you please explain more details? I'm using Motorola ME600, no built-in Google Maps and Android Market. I can't check it by myself.
If the updated apps are installed in /data/app, how can they do that? I mean they should not be installed successfully if the updated apps used the same package name as the olds. It should fail due to the old one still exist. And how about the signature of updated app? Should it same as the old one?
Even the update apps can be installed, how does the system use them to replace the built-ins? I think we should find 2 icons in the Lanucher if they have same main entry. But in fact, there is only one icon. Why?
PS: Sorry, I have no way to find the details by myself. Please give me a hand. Thanks in advance.

I think Android OS treats system apps differently. It knows these apps can't be overwritten directly, so it uses above technique for updating them. It permits to have these apps installed twice and then it ignores system ones. Of course both files have to be signed by the same key.
If you have root, then you could check this by yourself without Market or Maps.
Remount /system .
If you have 0 free space on this partition, then remove something to have at least 100KB.
Create empty app, build it and sign.
"adb push YourApp.apk /system/app/" - Android OS should detect this and install your app. You could see this in the logcat.
"adb install -r YourApp.apk" - Android will install it to /data and use it instead of version installed to /system .
Maybe Android not always prefers /data app, but one with greater versionCode. I don't know, didn't test this.

Thanks, Brut
I followed your suggestion and tried. Yes, system replace the /system one with /data one.
Thank you help me to know this behavior of Android system.

Related

[Q] Update system APK without ADB Push?

We have an app built into the system of a custom rom/hardware that allows the end-user to update various programs on the Android device. However, we have no way of updating the update program. If we do it normally by installing it like any other app, it gets reverted when the system is rebooted.
Is there a way to update a system APK without having to use adb push or have the end-user do anything special? I'd rather not have to send out a bunch of SD cards with firmware images and instruct each of them on how to update it. Is there some way we can sign the application so the Android OS knows it's a valid system app and not overwrite it?

[Q] Installing and re-installing android applications

When we download an application from Google Play Store, it downloads and then magically installs on the Android device.
But supposing we do a Factory Reset, or that we upload a new firmware or simply suppose we have another Android device at home and we would like the same application to be installed there too.
Is it possible to somehow maintain the installation files and be able to copy these files off the Android device and then use them on another device?
Yes. An app comes as an 'apk' installer file that can be transferred to another device and installed or re-installed on the same device. But to get the apks of apps installed via Playstore, you will need an app like "App Backup and Restore".
P.S. Sharing apks of paid apps is illegal and not recommended. :good:
immortalneo said:
Yes. An app comes as an 'apk' installer file that can be transferred to another device and installed or re-installed on the same device. But to get the apks of apps installed via Playstore, you will need an app like "App Backup and Restore".
P.S. Sharing apks of paid apps is illegal and not recommended. :good:
Click to expand...
Click to collapse
I have this "App Backup" but I am trying to understand the mechanism a bit more.
The apk file is not the end of the story. Try the game "Yesterday". It is a 1GB download, however the .apk is only a few MBs and the rest is the actual game. However this 1GB file comes straight from the app store, so there is a mechanism that App Backup does not cover.
I managed to restore this game by saving the data myself, but every application is different.

[App][4.0+] CM App Installer

Hi XDA
CM App Installer
NEW UPDATE! Added 6.0 downloads and migrated all source to Github
Download Here
New features include:
Ability to download different versions of the apk for different versions of android you run
Better server management
More compact install process
This application was on the play store originally, but at the end of 2014, it got banned due to a overlap in the developer policy
Just thought i'd share it here in case anyone was looking to still use it! The server is still available, I just released a material design update as well and considering I have brought the server space for 3 months it seems like a waste to let this one go
For those interested, CM App Installer will pull the latest versions of the apps available that CyanogenMod exclusively develop, and give you the option to install them to your system either rooted or non-rooted. I cannot guarantee success with this, I don't develop the application, my job is simply to make it easier for you guys to get your favourite CyanogenMod apps on your own ROMs!
Use carefully! As ever, I do not take responsibilty for any damage done to your device as a result of this! The root features use the code specified in "code" in the options menu, or it's listed below. If you're paranoid, please give it a read
I have to emphasise, please try the non-root method first!. The root method is designed as a last ditch attempt to get it working, it does backup and restore your old versions but errors do happen, expect this as a possibility if you're rooted!
The list of apps available in the application are:
Apollo
Calculator
CM File Manager
Torch
Messaging
DSP Manager
Voice+
News and Weather Widget
Trebuchet Launcher
cLock Widget
Movie Studio
CM Wallpapers
Let me know if you have any more suggestions to add!
The source is hosted on Github
Source code on Github
Code
This information is also available from within the application.
There are a number of commands that this application uses, it executes certain processes through the code to copy apps to the system directory.
These commands are ran as if they were ran inside the terminal emulator, and always consist of
process, remount to read-write, transfer/copy/rename, remount to read-only, close. (In this order).
I use a Process to get a SU Runtime instance
Code:
Process p = Runtime.getRuntime().exec("su");
And then I use a PrintStream to issue the commands listed below to it.
Remount the system partition as read-write
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
Rename an app (use move command to move with a different extension - Creating backups)
Code:
mv /system/app/AppOfChoice.apk /system/app/AppOfChoice.bak
Copy an app from SD card to System directory
Code:
cat /sdcard/CMApps/AppOfChoice.apk > /system/app/AppOfChoice.apk
Remove an app from system partition
Code:
rm -r /system/app/AppOfChoice.apk
For permissions, I use chmod
Code:
chmod 644 /system/app/AppOfChoice.apk
Remount the system partition as read-only
Code:
mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system
And that is it. The process commands get pushed over the course of about two seconds, and should work. Again, I can't promise everything
Credit also goes to the Reddit member /u/wchill, his code helped with the system code (shown in the Code section above)
Similarly, I do not take any responsibility if this app causes your phone to be bricked, corrupted, broken, or to encounter an unfortunate case of spontaneous combustion. Use at your own risk.
In the mean time, enjoy!
If you fancy buying me a drink, see here!
Previous post
Small update to fix one bug reported by a few users, and added adverts. Lost the keystore again (apologies), so it's made with a new one which has been backed up everywhere
which CM apps are available?
6th_Hokage said:
which CM apps are available?
Click to expand...
Click to collapse
I have updated the main description with this, apologies
However, the list of apps available at the moment are:
Apollo
Calculator
CM File Manager
Torch
Messaging
DSP Manager
Voice+
News and Weather Widget
Trebuchet Launcher
cLock Widget
Movie Studio
CM Wallpapers
And are subject to change; if you have any apps i've missed or would like, let me know!
TheMentalGoose said:
I have updated the main description with this, apologies
However, the list of apps available at the moment are:
Apollo
Calculator
CM File Manager
Torch
Messaging
DSP Manager
Voice+
News and Weather Widget
Trebuchet Launcher
cLock Widget
Movie Studio
CM Wallpapers
And are subject to change; if you have any apps i've missed or would like, let me know!
Click to expand...
Click to collapse
No Gallery? CM gallery is good cuz it does not generate DCIM thumbnail
also, anything to do with theme chooser stuff?
6th_Hokage said:
which CM apps are available?
Click to expand...
Click to collapse
Are you Kakashi?
TheMentalGoose said:
And are subject to change; if you have any apps i've missed or would like, let me know!
Click to expand...
Click to collapse
What about Email app?
Any chance you can get the dialer on this app?
Do the CM apps not get built with CM, and therefore if your ROM is latest CM you already have latest CM apps?
Does this work on CM11 and CM12?
These apps are quite outdated.
There is Apollo 1.3.4 though and its updated somewhere on XDA
No CameraNext! The only I'm interested in. Any plans to add it? Tried to download it directly from play store, obviously it is not possible.
I got this only for Voice+, I installed it using both methods on my Rooted Nexus 5 Lollipop rom, but I don't see it anywhere. I would love to have the new messaging app support Google Voice texts.
Is it supposed to just work with no configuration?
ThaDSman said:
I got this only for Voice+, I installed it using both methods on my Rooted Nexus 5 Lollipop rom, but I don't see it anywhere. I would love to have the new messaging app support Google Voice texts.
Is it supposed to just work with no configuration?
Click to expand...
Click to collapse
A question: why not just use Hangouts for GV/messaging using your GV number? I've always worried about how well Voice+ or XVoice+ work, had a few times they didn't use my GV # as I was expecting.
buinghia98 said:
No Gallery? CM gallery is good cuz it does not generate DCIM thumbnail
also, anything to do with theme chooser stuff?
Are you Kakashi?
Click to expand...
Click to collapse
I didn't realise CM Gallery was unique? I thought it was just part of AOSP, but yeah i'll pull it in a second and add it to the download list
Dark_Avenger said:
What about Email app?
Click to expand...
Click to collapse
Pretty sure this is part of AOSP isn't it? I thought it came standard on every single ROM ever?
abuttino said:
Any chance you can get the dialer on this app?
Click to expand...
Click to collapse
Dialer is very system-integrated, so I don't think so.. I will test it for you though, and add it if it's faesable, but it's incredibly likely that it won't work in any sense of the word
RowanDDR said:
Do the CM apps not get built with CM, and therefore if your ROM is latest CM you already have latest CM apps?
Does this work on CM11 and CM12?
Click to expand...
Click to collapse
It should do. The apps are pulled from CM builds about once every month or so, or whenever significant updates are made to the apps that i'm aware of. There's no reason why it shouldn't work on any build of CyanogenMod
giaur said:
No CameraNext! The only I'm interested in. Any plans to add it? Tried to download it directly from play store, obviously it is not possible.
Click to expand...
Click to collapse
CameraNext I thought got discontinued? Again i'll have a look at it for you, but the app in my experience never really worked anyway?
Gallery added
Hit the refresh button in the app, and the gallery will appear at the bottom of the list! I'm not sure it's different, but it's there, have fun!
buinghia98 said:
Are you Kakashi?
Click to expand...
Click to collapse
yes sir
and i would love for these to be updated to the latest 5.0 ones since i tend to delete them on the 5.0 alpha build cause they don't work for now but would love the latest ones once available so i can see if they work better then what i already have :/
Hey there! Shame to see it got taken down, I actually used this since its earlier days on non-CM roms to get the file manager (back before I knew how to build roms). Glad to see the server is still up and now a thread is here. Keep up the excellent work and thanks a bunch!
TheMentalGoose said:
CameraNext I thought got discontinued? Again i'll have a look at it for you, but the app in my experience never really worked anyway?
Click to expand...
Click to collapse
Why do you think it's discontinued? Look into playstore and date of latest version.
https://play.google.com/store/apps/...le+play&pcampaignid=APPU_GFuCVOyPHJflauangugB
It works very well but not on all roms.
Thans and a Request
TheMentalGoose said:
Hi XDA
CM App Installer
This application was on the play store originally, but about 3 days ago it got suspended for a breach in the play developer distribution agreement, and I can't get it back on there
Just thought i'd share it here in case anyone was looking to still use it! The server is still available, I just released a material design update as well and considering I have brought the server space for 3 months it seems like a waste to let this one go
For those interested, CM App Installer will pull the latest versions of the apps available that CyanogenMod exclusively develop, and give you the option to install them to your system either rooted or non-rooted. I cannot guarantee success with this, I don't develop the application, my job is simply to make it easier for you guys to get your favourite CyanogenMod apps on your own ROMs!
Use carefully! As ever, I do not take responsibilty for any damage done to your device as a result of this! The root features use the code specified in "code" in the options menu, or it's listed below. If you're paranoid, please give it a read
I have to emphasise, please try the non-root method first!. The root method is designed as a last ditch attempt to get it working, it does backup and restore your old versions but errors do happen, expect this as a possibility if you're rooted!
The list of apps available in the application are:
Apollo
Calculator
CM File Manager
Torch
Messaging
DSP Manager
Voice+
News and Weather Widget
Trebuchet Launcher
cLock Widget
Movie Studio
CM Wallpapers
Let me know if you have any more suggestions to add!
Code
This information is also available from within the application.
There are a number of commands that this application uses, it executes certain processes through the code to copy apps to the system directory.
These commands are ran as if they were ran inside the terminal emulator, and always consist of
process, remount to read-write, transfer/copy/rename, remount to read-only, close. (In this order).
I use a Process to get a SU Runtime instance
Code:
Process p = Runtime.getRuntime().exec("su");
And then I use a PrintStream to issue the commands listed below to it.
Remount the system partition as read-write
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
Rename an app (use move command to move with a different extension - Creating backups)
Code:
mv /system/app/AppOfChoice.apk /system/app/AppOfChoice.bak
Copy an app from SD card to System directory
Code:
cat /sdcard/CMApps/AppOfChoice.apk > /system/app/AppOfChoice.apk
Remove an app from system partition
Code:
rm -r /system/app/AppOfChoice.apk
For permissions, I use chmod
Code:
chmod 644 /system/app/AppOfChoice.apk
Remount the system partition as read-only
Code:
mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system
And that is it. The process commands get pushed over the course of about two seconds, and should work. Again, I can't promise everything
Credit also goes to the Reddit member /u/wchill, his code helped with the system code (shown in the Code section above)
Similarly, I do not take any responsibility if this app causes your phone to be bricked, corrupted, broken, or to encounter an unfortunate case of spontaneous combustion. Use at your own risk.
In the mean time, enjoy!
If you fancy buying me a beer, see here!
Previous post
Click to expand...
Click to collapse
i,m a big fan of CM apps but i cant root my device(as many other guys) so can you guys please make your apps available like other normal apps for all 4.0+ device with guaranteed success.
Thanks
hjmodi said:
i,m a big fan of CM apps but i cant root my device(as many other guys) so can you guys please make your apps available like other normal apps for all 4.0+ device with guaranteed success.
Thanks
Click to expand...
Click to collapse
Well this is to install on other ROMs....and its basically guaranteed to work if your rooted and not on Lollipop.....what device do you have?
Joshmccullough said:
A question: why not just use Hangouts for GV/messaging using your GV number? I've always worried about how well Voice+ or XVoice+ work, had a few times they didn't use my GV # as I was expecting.
Click to expand...
Click to collapse
That is what I currently do, but it is severely lacking.
I find myself switching back to the old Google Voice because it had far more features but lacks mms support.
For one it had a text message search,
2. Composing messages to new people was far easier and didn't search for my contacts in ALL of G+ (wtf is that about google?)
3. I like messaging programs that follow Material design guidelines.
4. Hangouts sometimes randomly crashes when replying to a message, until I go back through the whole process of finding the contact and messaging them.
5. Hangouts sometimes just straight up doesn't feel like using GV (...its like nah, were gonna SMS this with your real number)
/end of Hangouts hate rant
Thanks

Include updated play store

Hi
I use an C200 android 4.4.2 headunit:
http://forum.xda-developers.com/and...nlink-ownice-android-head-unit-4-4-2-t2899282
I have some issues with the original rom. I want to include root and change some apps.
I also want to change device identification.
I have an mountable image of the system partition. I was able to use the supersu update.zip and integrate it by hand.
Root is working fine
Now I wanted to integrate google play updates:
com.android.vending.apk
com.google.android.gms.apk
Therefore I placed a copy in system/app/
The problem is the updates are ignored. In the same folder is an app GmsCore.apk
Do they interfear? How do I have the apps to include the updates?
How can I proceed? I'm beginner and don't know where to continue.
The next issue I have is I can't install navigon app because it's not compatible with my device.
I can use "market helper" and set it to Tablet, Nexus 7, Asus, Germany, Vodafone. With this settings I can install the navigon app.
Now my idea was to change build.prop and change:
ro.product.model
ro.product.manufacturer
ro.product.local.region
Unfortunatly this doesn't help. The app is still market as not compatible.
How can I find the reason?
Thank you very much.

How could I update system apps ?

Hello, I am currently making a few software modifications on my rooted Galaxy S9 on which I installed Noble ROM from AlexisXDA to be able to use one ui 4.1 with android 12. Now I’m trying to install One UI 5 apps on it, so I already installed Samsung Messages, Contacts, Phone dialer and Gallery as system apps using Lucky Patcher and everything worked as expected, and these apps simply replaced the old ones. Though, now I am struggling to install One UI 5 files app (aka Samsung My Files 14.x). This app is only supposed to be compatible with android 12L and more recent, but I managed to change the min SDK requirement to make it run on android 12. After I changed the min SDK I installed it as system app using Lucky Patcher and now everything is working until I long press a file which makes the app crash. Digging into android files, I noticed in the system/priv-app folder that the original version of MyFiles was still installed and I can’t delete it. Second thing I noticed, in the original MyFiles folder (in private app) there’s a file with the same name as the apk but the extension .prof is added next to it. I don’t know what this file is but I’m pretty sure this is what makes the original version work fine. So, can anyone tell me what this prof file is, and how I could make one for my custom My Files App please ?
Only for clarity:
Apps stored in /system/app are APKs what are indispensable part of Android OS - user apps has nothing to do there
whereas
apps stored in /system/priv-apps are APKs to be granted system permissions, regardless of the app signature: they at any time can get removed - mostly without any harm but requires Android is got rooted
jwoegerbauer said:
Only for clarity:
Apps stored in /system/app are APKs what are indispensable part of Android OS - user apps has nothing to do there
whereas
apps stored in /system/priv-apps are APKs to be granted system permissions, regardless of the app signature: they at any time can get removed - mostly without any harm but requires Android is got rooted
Click to expand...
Click to collapse
So, if I understand it correctly it means my version of the app gets rejected every time by the priv-app folder right ? Unlike the preinstalled My Files app which is granted system permissions ?

Categories

Resources