App Installation Dumb Question - Android Q&A, Help & Troubleshooting

Okay, ridiculously stupid question, but I was never clear on this:
When I sideload apps, sometimes people say to copy the apk to /data/app (where all the non-system apps are, obviously). My question is, "What is the difference between copying (or using adb to push) the app to data/app (or /system/app for a system app) and simply clicking on the apk on my /sdcard and letting Android "install" it for me?
Is it okay just to let Android go through that installation window (much easier) instead of moving the apk myself (unless the app needs to go to /system/app)? I have always assumed all that installation process is doing is copying the apk to /data/app for me.
So, what's the difference? Thanks.

There aren't differences, same thing
As you say, pushing the apk you can send it to system/app, but in functional terms there aren't differences, the result will be the same

So, does the packageinstaller.apk solely serve to copy and paste the file to /data/app?
Out of curiosity, what would happen if I uninstalled packageinstaller.apk and clicked on an apk? Would a toast pop up and say unrecognized file type or something to that effect? I would try it out on Nook Color, but I'm using it for something else at the moment.

I dunno really, I think that nothing will happen (no warnings, no freezes, nothing).

Related

Exploring files

So I'm new to android and the tb but managed to root mine and have some fun, but how do I go about finding all files associated with a particular program? Specifically I uninstalled what I thought was Visual voice mail, but to my surprise it remains. Any help?
Thanks
Dave
You can try different file managers, astro pro or root explorer.
Use root explorer or astro, as stated above. Apps that came pre-installed on your phone are located in the /system/app folder, while apps that you installed yourself are in /data/app. If you are trying to uninstall something from the /system/app folder, I would recommend just renaming the apk from "appname.apk" to "appname.apk.bak" (This essentially uninstalls the app, while backing it up).
Some apps in the system folder can cause problems if they are renamed. If you do have any problems from a renamed app you can just use adb from recovery to remove the ".bak" extension and you are back to square one! If you are worried about space, you can go ahead and delete the file completely as long as you have successfully rebooted with no issues after renaming the file(s). Hope this helps!
Thanks a lot, I'm as far from a programmer/developer as you can get but I'm excited to learn now that I finally have a phone worth voiding the warranty on!

Save memory by deleting lib from apks?

This is a work-in-progress report. I found a cool way to save internal memory: one can delete native libraries from apks after the apks have been installed. When an apk is installed, the native libraries are put in /data/data/*/lib, and if you delete the lib from the apk file in /data/app, everything works fine. Signatures don't seem to matter here.
This is particularly useful for apps most of whose memory usage is the native libraries.
OK, I've only tried it with one app.
Ooops: Normally, the /data/data/app.name/lib directory gets deleted on reboot to match the shorn apk file.
But this can be prevented by setting /data/data/app.name/lib and /data/data/app.name/lib/* to read only (chmod 555).
In case anybody wants to try with this, here's how you can do it. Of course, you need root.
Download my Android commandline build of zip. Install it in /bin and make it executable (chmod 755 /bin/zip). If you don't want to or can't make /bin writeable, install it in /data/local, and then call it explicitly as /data/local/zip
In the shell, do:
Code:
su
cd /data/data/app.name
(Where of course "app.name" is the name of the app.) Make sure there is something in the lib/ folder, or you won't save any space. Make the libraries read-only:
Code:
chmod 555 lib lib/*
Then delete the libraries from the apk:
Code:
cd /data/app
zip -d app.name*.apk lib lib/*
(You can replace the first * with a -1 or -2 or the like suffix, which gets added by the installer.)
And you're done. The apk is now thinner, and the libraries are still usable as they've already been extracted to /data/data/app.name/lib
If your app was moved to SD using Froyo (or higher?), you will need to do something a little more complicated. After you've made the libraries read-only, you'll need to remount the app directory read-write, and then zip:
Code:
mount -o rw,remount /mnt/asec/app.name*
cd /mnt/asec/app.name*
zip -d pkg.apk lib lib/*
Run the app, then reboot to see if it still works. If not, uninstall and reinstall the app.
You can save pretty serious amounts of memory this way. The libs in some graphics-intensive apps, like games, are most of the apk. I've seen apks that shrink from about 2mb to about 200k or from about 7mb to about 2mb after this procedure. Particularly bloated are apps that include two different versions of the libraries, for different CPUs.
A happy thing is that you can still move the shorn app to SD (at least with my Force2SD--I haven't tried with the OS's own function).
Interestingly, the uninstaller can still delete the app, despite the procedure, which is nice. I don't yet know what happens when you try to upgrade after this.
It would be easy to write an app that does this, or to integrate it into Force2SD. I am not sure I am going to bother.
For further savings, you can remount your sdcard as exec (I have a utility that does that if anybody is interested), move the library from /data/data/app.name/lib to your sdcard and then link to that. I have a script that automates that procedure. I've done it for a few apps that have large libraries (Angry Birds is a nice example).
Another update: This actually works very reliably. I've deleted the libraries from a bunch of apks using the above method, and things continue to work just fine.
is there an app or a script that can do this?
it is really painfull to do this with +100 apps :silly:
What happens when I update the app using play store. Is it works ?
And if it is working, does it download more data than usual to get an upgrade?
Sent from my HTC Desire X using XDA Free mobile app
ashifashraf5 said:
What happens when I update the app using play store. Is it works ?
And if it is working, does it download more data than usual to get an upgrade?
Sent from my HTC Desire X using XDA Free mobile app
Click to expand...
Click to collapse
When you update, this would need to be done again.
I have no idea if this still works on current Android versions anyway.
@arpruss
I'm doing this to my system apps currently. I use an zip explorer and just move the lib files needed to system/lib and deletes the lib folders from Apk. There is no problem of clearing of lib files at start up for this thogh. I Set the permissions to read write.
Sent from my HTC Desire X using XDA Free mobile app
---------- Post added at 05:21 PM ---------- Previous post was at 05:18 PM ----------
I like to know if the updates download more data than the normal case. What I mean is , when we updates app by play store it only download a portion of files. I like to know if this is affected by removing lib files
Sent from my HTC Desire X using XDA Free mobile app
ashifashraf5 said:
@arpruss
I'm doing this to my system apps currently. I use an zip explorer and just move the lib files needed to system/lib and deletes the lib folders from Apk. There is no problem of clearing of lib files at start up for this thogh. I Set the permissions to read write.
Click to expand...
Click to collapse
If you move the lib files to system/lib, the apps won't upgrade properly.
I have some more observations:
- On 2.3, the /data/data/*/lib directory gets cleared on reboot if the apk has had its libraries deleted. It doesn't matter what the permissions on the libraries are.
- On 4.3 and 4.4, things work great, and you don't need to change permissions at all. (I don't have rooted 4.0-4.2 devices for testing.)
- Many apps from the Amazon Appstore have a security check that makes them fail if the apk is modified.
- Moving the library-shorn apk to SD causes the libraries to disappear. I don't think the permissions matter here (but haven't tested).
It would be nice to have data from rooted 4.0, 4.1 and 4.2 devices. I guess I could play around with an emulator.
I am thinking of integrating this functionality into my Force2SD app. I would probably make this functionality available in the free version.
Anyone has tried this with 4.0 ?
benibela said:
Anyone has tried this with 4.0 ?
Click to expand...
Click to collapse
I think I tried something like this with 4.3 or 4.4 and it worked.
Yes, you said that already.
But I need to know it for 4.0.4. My stupid bank has a must-use-app for online banking with 20 MB libs that are only there to prevent it from running on a rooted device. And if it detects a modification, it self-destructs.
Nevermind. I tried it with my own app and it worked. With permission change, did not try without
I have Android 8.1.0, Xiaomi Redmi 5 Plus.
I am modifying the files in "lib" directories (such as /data/data/com.application.name/lib/) of few specified applications.
Rarely the files from the "lib" directory get overwritten with the content from APK archive of these applications. The "lib" gets restored from APK archive sometimes (maybe after 2 weeks or so).
It's important for my project to learn about the problem of Android restoring the "lib" directory.
I would like see what part of Android is responsible for this. I want to know which script or executable file in Android is responsible for restoration of "lib" directory.
Hopefully someone out there knows something about it.
i found a better way to remove lib folder from apk to get more free space https://forum.xda-developers.com/android/general/guide-t4080131

[Q] how to pull an .apk and install in another ROM

I have installed a ROM that removed a lot of bloat including the DockMode.apk which I use daily when at my desk.
I have pulled the DockMode.apk from a stock rom, and from a modified rom and I cannot get either to install using Root Explorer, APK Installer or ES File Explorer.
I was unsure if this was as easy as it seemed.
I simply extracted the ROM files, pulled the .apk from system/app and copied it to my phones SD and attempted to install it.
The file transfers to the phone fine, and the DockMode icon is there with the 331 kb file. But I get the message (install failed) when using all three of the install applications.
Any suggestions, I really do need to find a way to make this work.
Put it in system/app
Sent from my PG86100 using XDA Premium App
sandiegopaneraiguy said:
I have installed a ROM that removed a lot of bloat including the DockMode.apk which I use daily when at my desk.
I have pulled the DockMode.apk from a stock rom, and from a modified rom and I cannot get either to install using Root Explorer, APK Installer or ES File Explorer.
I was unsure if this was as easy as it seemed.
I simply extracted the ROM files, pulled the .apk from system/app and copied it to my phones SD and attempted to install it.
The file transfers to the phone fine, and the DockMode icon is there with the 331 kb file. But I get the message (install failed) when using all three of the install applications.
Any suggestions, I really do need to find a way to make this work.
Click to expand...
Click to collapse
It's most likely failing because it's a system app, and needs to be pushed to the /system/app folder. You can do that with adb, or you can just use root explorer. To use adb, do this:
adb remount system
adb push HtcDockMode.apk /system/app (or whatever the .apk is called)
adb reboot
Or using root explorer, take the .apk and paste it into the /system/app folder. (You must make sure to set it as r/w using root explorer). Then long press on any apk in your /system/app folder, and press permissions. Notice what they are set to, and then make sure the permissions on your dockmode.apk are set the same as all the other apps in your /system/app folder. Then reboot when you're done. That should work. If it doesn't work, then it most likely means that the htc dock mode app is dependent on something else that's been removed.
I tried both the adb push method and the root explorer method, checked the permissions and attempted to install.
Still get the "installation failed" message. So there must be something else that has been changed.
Thank you kindly for the efforts. I will try to find another ROM that is similar and still has this feature.
if you really want to get technical, monitor logcat and it should split out the real reason why it is throwing the installation error.
adb logcat, adb shell logcat or ddms are three ways to access it.
if you want to pastebin your logcat, careful as there is private/sensitive data in there sometimes, we can take a lot and try and figure out the exact error.
as mentioned above, it probably has a dependence. logcat *should* tell us which dependency it is missing when it throws the install error.
figured i would present the option, even if its not the easiest. logcat is the easiest developer route to determine the issue, in my opinion. hope that helps!
sandiegopaneraiguy said:
I tried both the adb push method and the root explorer method, checked the permissions and attempted to install.
Still get the "installation failed" message. So there must be something else that has been changed.
Thank you kindly for the efforts. I will try to find another ROM that is similar and still has this feature.
Click to expand...
Click to collapse
Once you put it in /system/app you don't click install. Just reboot.
Sent from my PG86100 using Tapatalk
k2buckley said:
Once you put it in /system/app you don't click install. Just reboot.
Sent from my PG86100 using Tapatalk
Click to expand...
Click to collapse
WOOHOO... that was it! I kept thinking I need to "install it".
I went back in, set all the permissions and rebooted and it works like a charm!
Thank you very much!

[Tutorial] Install Alt. Keyboards [Rooted NT 16gb][Works]

I started this thread to place a known working solution to installing Alternative keyboards in an OP as the OP to the original thread has chosen not to mod their OP to document the solution there. (A choice I completely accept as it is their OP.)
If a moderator finds this excessive do what you need to!
Hopefully this will alleviate some of the noob's initial confusion with keyboards.
What is this for:
Rooted Nook Tablets 16gb in size is proven to work.
Thanks to:
yaggermr - found the keyboard debug screen
robertely for getting this started.
CelticWebSolutions for the steps that work.
The steps:
Enable keyboard Debug mode.
Install an Alternate launcher and Root explorer
Install anycut: http://goo.gl/isvc1
Open Anycut, Create a New Shortcut.
Pick "Activity"
Pick "Android Keyboard Debug" (PROTIP: the list is larger than it looks, Scroll down!)
While you are there, create another shortcut for "Accessibility", and "Debug settings."
Return to your alternate launchers home screen and open "Android Keyboard Debug"
Enable Debug mode, and click Back. (Side note, you can stop here if you only want to change themes.)
From OP of the original thread.
This is where my method differed to op.
Install swype from market or use a downloaded apk.
It won't work yet.
In ES File Explorer navigate to /data/app
Copy the keyboard apk (swype one)
Navigate to a safe place such as your sdcard
Paste the apk
Navigate to /data/app
Copy the keyboard apk (swype one) again
Navigate to /system/app
Paste the apk
Change properties of system copy to all ticks
Reboot
Once rebooted select the keyboard with any cut shortcut to accessibility settings
(it may say something about you having no accessibility installed, you can install something form market here if you wish but you don't actually need to)[*]Keyboard will keep crashing which is OK it's nothing to worry about, it's just a bit annoying for a moment
In Es File Explorer navigate to the safe place you stored a copy of the swype apk
(not the original one in /data/app or the duplicated one in /system/app)
Click install to install it from the apk
It will inform you that it's going to overwrite existing copy
Click OK
Crashes will stop
Finally delete the copy from system/app
I (SCClockDr) believe this step prevents issues on subsequent re-boots.
All should work now.
I've (CelticWebSolutions) got Go keyboard, swype and a couple of others installed this way and all work
I've (SCClockDr) got Swype, Hacker, Swiftkey and a couple of others installed this way and all work
Good luck!
Note for noobs like me, restarting after adding and deleting files from SYSTEM/APP takes a few minutes, be patient
Edit: I deleted the copy from system/apps and started getting force closes again, going to do it again and leave the copy their.
Edit: Leaving the copy stopped the force closing.
Thanks for this - Using Thumb keyboard 4
Edit - GRRRRR restarted and force close started again!

[Q] Where does launcher looks to find user's apps?

Hi all. I was removing stock apps from my /system/app folder, and deleted Launcher2.apk by mistake. The phone couldn't boot properly, so I managed to get the apk from the emulator and install it using adb booting the phone on recovery mode.
Now, my problem is, that Launcher only shows shorcuts to the apps from my /system/app folder. Every apk I put or install on /data/app doesn't apear on the apps view. So there is no way to launch any app unles I manualy move it to system.
I think launcher must read a config file to get the installed apps, and it's failing for some reason. What do you think?
thanks in advance
d
Well just in case someone is interested in this. I'm creating symlinks from my /data/app and sdcard mounts to /system/app to workaround my problem.

Categories

Resources