Hello,
I am starting to get involved in some android internals and was curious as to how the application installation process works (the nitty gritty). I know you can use tools like /system/bin/pm to install an apk, but what exactly is that doing?
Can you 'mimic' pm's behavior to get an app installed. I assume you'd have to spoof some messages to installd?
I don't fully understand the chain of events that happen when an apk is installed via the command line. Any one out there able to shed some light?
Thanks!!
Related
Hi!
Could anyone help steer me towards a solution please?
Or tell me if its impossible (and why).
I am trying to put together a script of some kind which I can use to do a basic rebuild of my Archos 70 after I have done a Full Reinitialization. I like to mess around installing all sorts of stuff, but when done, it's nice to reset and go
back to a clean machine.
As it's not rooted (yet?) I generally rebuild manually which takes ages.
Although a relative newbie at Android/Linux, I have worked with scripting
on mainframes and in the Windoze arena for many years.
The scripting requirement is quite simple, namely to install packages one by one from the SD card. Also to copy back Bookmarks, launcher setting etc
I am happy to work in any language which will work, but to date have just been trying with .SL (Bash?) scripts which run quite happily from within the SL4A environment or according to my theory, should work also from Android natively.
I envisage the script residing on the SD card and when invoked installing my launcher, Dolphin Browser, various other apps and games, then copying back the settings which I have saved (also by script) before the Initialisation.
Trouble is, I can find no simple samples which help. When I try, I can 'cp' stuff about and echo messages etc, but when I try to install, I don't really know where to start. I have tried just the name of the app package
'/sdcard/sdcard/packagename.apk', it replies 'permission denied' and if I try 'sudo package.apk', it says 'not found'.
I am assuming that the 'permission denied' is a good sign because it understands what I'm trying to do at least. But if I am allowed to do it myself, then surely my script should be allowed to do it?
I am quite happy messing around myself. But if anyone has any pointers
(sample scripts, which language/environment to use, etc.) I would be most grateful.
Sorry if this is covered elsewhere. I have searched but was unable to find much which helped. I am continuing the search!
Thanks in anticipation!
1. All normal installed Apps are installed in /data/app as the apk
2. Local/private data comes into /data/data/name.of.the.package
Both directories are ony accessible with root.
Hell again,
Thanks for your reply fzelle, but I'm not sure as to whether I may have explained it properly.
I am running 'Quick System Info' which is great, and it has a function to backup all the installed apps to a directory you can get at without root access. From there I have copied them onto the SD card.
I am not just trying to copy them into the working directory.
If I click on an app, it lets me install it without any problem.
I am trying to automate that part of the process, and I need the name of the software which does the installation, and how to actually give it the parameters for it to do the install. Although a Linux newbie, I don't really understand why, if I am allowed to install apps myself,
a script that I run should not be allowed to install them also?
Anyone got any ideas please?
Oops! - Sorry for that unfortunate typo at the beginning of my last post. Please read as 'Hello'!
No, i didn't understand you wrong.
You want to automate the installation of your std programs, and that normaly doesn't only include the apk but also the private Data.
And if you manually want to install this, you need root to be able to write in /data/data
If you just want to Backup/Install the apps, use appSaver from the market.
That has allready everything you need, and doesn't need root.
fzelle said:
1. All normal installed Apps are installed in /data/app as the apk
2. Local/private data comes into /data/data/name.of.the.package
Both directories are ony accessible with root.
Click to expand...
Click to collapse
Not entirely true.
I have some SSH tunnels set up on my rooted phone that use keys and a shell script to launch them, all set up with Better Terminal Emulator. The key and script files are located under /data/data/com.magicandroidapps.bettertempro/home. I wanted to use the same keys and script on my A70, so I copied the files from my phone to the same directory on my A70 using the terminal command line. Although you can't browse to the app folders under /data/data/, there is some ability to copy stuff into them. I guess the trick is knowing what and to where.
I've not used appsaver, but Astro will also let you back up and reinstall your apps all at once.
Hey everyone,
I'm a newb to android hacking (but fairly tech-savvy) but I was hoping someone could help me out with this. I'm running Bean's Revision 4 that I flashed with TWRP and everything is going swell except 1 small issue: I can't save any attachments that are sent to me via text message. I'm trying to save the photos of my niece and every time I do I get an error that says:
"/storage/sdcard0/DownloadIMG951035.jpg: open failed: EACCES (Permission Denied)"
I've searched quite a bit and found quite a few threads about permission issues and code that the people involved in the discussion claim can remedy the situation, but I don't know the first thing about how to run code on my Note 2. I've heard people mention running code in Terminal and I think I saw something about that in TWRP recovery, but can someone please help me out here. How do you run code on the Note 2? Does anyone happen to know what code I'd need to run to edit the permissions so I can save attachments from my text messaging app?
Thanks for any info!
P.S. Just realized I forgot a title for the thread... While we're in the helping spirit, anyone know how to edit a thread title AFTER posting?
You need to use a terminal emulator app, unless you have a recovery script. I prefer ConnectBot, but everyone has their own preference, I'm sure.
Make backups before you start running random code! What works for one person/phone/rom may not work for you.
Link. said:
You need to use a terminal emulator app, unless you have a recovery script. I prefer ConnectBot, but everyone has their own preference, I'm sure.
Make backups before you start running random code! What works for one person/phone/rom may not work for you.
Click to expand...
Click to collapse
OK, I actually found a terminal emulator app embedded in Bean's Revision 4 rom, but I don't suppose you (or anyone else for that matter) know what code I'd need to run in order to make this happen? I'd really like to have the ability to save attachments from text messages.
I have customer, who has crashing app on his phone.
Previously we use to use aLogcat application on the phone. So user was just instructed to extract log from this application and send logfile to us. But unfortunately aLogcat is not working since Jelly Bean update.
How can I get logcat info from his device without asking him to install entire Android SDK? Any simple software on the phone or on the Windows computer can do this trick?
R: [Q] How get log from device? aLogcat not working on JB.
You can get logcat with ADB.
xpirt
It's difficult if your customer's phone is rooted.. You are supporting your own application or you want to analyze the log of 3rd party apps?? There are some changes done for reading logs from 4.1 onwards.. now applications can read there own logs without any permissions.. but you need the root if you want to do the same for 3rd party app.. Read more here
amith007 said:
It's difficult if your customer's phone is rooted.. You are supporting your own application or you want to analyze the log of 3rd party apps?? There are some changes done for reading logs from 4.1 onwards.. now applications can read there own logs without any permissions.. but you need the root if you want to do the same for 3rd party app.. Read more here
Click to expand...
Click to collapse
Actually it is problem in my own application, but system shuts down it by some reason. I would like to see "full picture", not only log from my app.
Right now I am sending to user the adb.exe and couple of related dlls. The user instructed to connect cable, open cmd line, type "adb logcat" and... pray that USB driver is correctly found by system and log is printed into the cmd window. After that he have to select, copy paste and send file to me. To many manual steps and risk when driver for adb is not found makes support process very unfriendly.
xpirt said:
You can get logcat with ADB.
Click to expand...
Click to collapse
that's what I do, but it is very complicated for my regular users. To many steps to get log out of the phone in to text file, sometimes problems with finding adb usb drivers. Thanks anyway
Hello!
I am a complete newbie into Android scripting; I'll need help all the experts here.
I am asked to make a script that will run in the background and send any particular file over the email to me. Is it possible to do it with batch scripting or I'll have to code an app in java for that purpose?
If it can be done, can you experts help me out with it?
Thanks!
You cannot run batch scripts on android phones.You could inky run shell scripts.But you cannot use it to send emails automatically because it is run only once at the time of boot though you could loop the scrilr back after a pause making it never ending,its not adviced.Also you cannot attach a attachment to a email client with shell.
I would recommend writing an app.But that too has restrictions like not able to add atachment from locked partition like data without root.And finally code and use it responsibly.Donot code it to steal user data like apps,contact info etc...
Sent from my GT-N7000 using xda app-developers app
Im writing a Network Scanner currently in Python/Kivy for Android. I could do everything i wanted if i could execute a Python module called Scapy from the shell(Obviously this is a rooted app), but unfortunately its not possible. Atleast not with alot of work and when the App is finished i dont want my users to have to go through installing countless dependencies to get it working!
I've stumbled along a little unix program called Arp-Scan but i cant find a port for Android. I'm not sure how to port this to Android so i can execute it from a shell.
I have no experience with compiling and needless to say this is frustrating the hell out of me! . This one little stumbling block has been plaguing me for 2 weeks. The rest i will be able to do in pure Python, namely PortScanning and such.
The way the Android OS works is that an APK is unable to use raw sockets. But you are allowed to run a shell as root.
I have the option to use Nmap but if there was ever to be a paid version of my app i would have to buy a license and i simply cant afford it.
All i need is to execute a program from shell: like Arp-Scan to obtain an IP and MAC from the LAN.
Any help will be greatly appreciated.
Thanks in advance.