We want to install our application on to (thousands of)phones and these phones will be later delivered to clients. Do we have to do this manually? Is there a faster way to do this?
For example, in Windows Mobile, if you put your installation files in a certain folder on SD card and when you insert that SD card to the phone the app is installed automatically to the device. Any similar mechanism on Android?
Thanks in advance.
You can create an update.zip file on an sdcard that will install an application, but you have to boot the phone into recovery mode to run it. I haven't used update.zip this way, but I saw it here: http://www.londatiga.net/it/how-to-create-android-update-zip-package/
Unfortunately it's much more complicated and slow than the old 2577\Autorun.exe method from WindowsMobile.
Other ideas...
ADB + USB hubs: Hook up a bunch of the phones at the same time using USB hubs, run a script to find the device ids with adb devices and execute adb install your_app.apk for each one.
(Requires taking the time to enable USB debugging on each device)
Install from the web: Host the .apk publicly or locally. Now you have to pull up the URL on the phone.
(Requires taking the time to checking that checkbox for installing from unknown sources on each device)
TinyUrl: host the .apk anywhere, shrink the URL, type it into the browser.
QR Code: If the devices happen to have a QR Code Reader like Google Goggles pre-installed, you could save yourself the typing of the URL.
SMS: If all of these phones have service and you have the numbers handy, you could broadcast an SMS to all of them.
Best of luck!
Basically, yeah. See this question for details. You essentially need an army of button-pressers.
I found this:
http://www.harmonyhollow.net/android_injector.shtml
So far it is the best solution I found. I guess it uses adb behind scenes.
Related
I have a secure, slimmed down and "Managed" Android I am trying to run a Metasploit payload on. It is Android 8.1
I cannot install apps on the Android target. The custom OS is built to not allow that.
However, I can access the large SD card partition of the device. This partition contains help pdf's that can be opened on the target device. So, I can create a pdf payload and open on the target.
The problem is, the target doesn't have Adobe reader. It is a generic PDF reader that seems to come with the Android distro. It seems pretty old, so perhaps there's hope there.
I was thinking of using the cmd/unix/generic payload simply to run a command. However, it doesn't seem to run the commands.
For instance, I tried running a simple reboot command, and the device did not reboot after opening the pdf.
I also tried payload/android/meterpreter/reverse_tcp to open a meterpreter. Still nothing. The host made no connection after opening the pdf.
So, my question is, are there any specific payloads that may work better to simply execute a shell command on Android? Or is there a specific payload that is more likely to work for the reverse shell?
I am new to metasploit; this is my first time trying it.
So as the titles suggests, I have a device whos bootloader is unlocked and adb has root access. Running android 7.0.
Custom recovery isnt an option as there is no TWRP for this android device so I am looking to both root the OS as well as flashing gapps and cant figure it out.
Does anyone have any suggestons on how I can install and update su and install gapps over adb shell?
Any help would be greatly appreciated.
You did not say what device you're using, but the following approach should be universal to all devices. Note that i do not take responsibility of what you do with your phone. Flashing wrong images can result in soft- or hard-bricks, so take care. But on the other hand, this method is rather popular and works for a lot of people, so i would suggest to try it out.
First of all, there were files which were called cf-auto-root files. With them you can easily root your phone.
Since the cf-auto-root provider has beeen superseded by firmware.mobi this method has become even easier. So if you visit https://desktop.firmware.mobi/, you can select your device, select the proper firmware and then configure a package which contains the firmware and the auto-root file. Now just donwload this file.
I could explain how you have to go on from this point, but the .zip archive contains literally everything you need. Just follow the steps inside the README.txt.
Once you got your phone rooted, there are several approaches to flash things like gapps without the need of a custom recovery. Just google for apps with such options, e.g. "Flashify" or "FlashFire". Just take the app which fits your needs best.
If you actually don't know where you can get flashable gapps archives, visit http://opengapps.org/.
Last tip: If you got your phone bricked, just try to flash your firmware agian via ODIN (without auto-root i would suggest), to restore everything to "default".
I am trying my hands on the android app development and need your suggestions to mitigate my current situation.
My organization has disabled USB for the desktop and I wouldn't be able to connect my phone through USB to test my application as I code.
I have installed genymotion but since it is behind proxy, in all the ways I could configure it, it gives proxy authentication error.
The avd is comparitively slower and the app which am trying needs internet connectivity at every step. I have tried these too and my impression is that we can make
the avd work for connecting to internet through its webbrowser but it cannot connect to internet within the apps. I might be wrong here. Please let me know if it is not the case.
Is there any other way where we can install the app in the phone as and when we code to test it..?
One option can be to export an apk file everytime and install them on the phone by sending this apk through a mail. But this will be a cumbersome activity if we have to test as and when we code.
Any suggestions on this..?
PS: I do not want to hack the desktop to enable the USB.Also using an external laptop with USB enabled is out of option in my case.
Many thanks.
Another way is using AirDroïd. You just need to install it on your test device, and you can manage it with a webapp :
your.static.ip.xx:8888
You can install your app with that way, it's really easy, you don't need any account in a local network.
For testing... no idea without usb, or without the emulator. Maybe you can log everything in a text file & get it (with airdroid for example).
EDIT
I think if you create an account you can use it external of you network.
http://web.airdroid.com/
Just create an account, & log on web & on the app, you could use it on the external way.
Why are you even bothering to use the desktop PC when your organization has made it unsuitable for development.
It will be hard work, but you could do all your development on the Android device itself, using AIDE
(Actually AIDE is pretty practical as a IDE if you have a large screen tablet, and pair it with a full size bluetooth keyboard).
Quote: "Inside your project bin folder there is an apk file. If you copy that file to a device you can then install the app from it.
When I am in your situation I throw my apk into dropbox and send out links for people to download it."
from this link
I doubt that if your company has disabled USB they still allow Bluetooth, but because you did not state it specifically:
If you can use Bluetooth, the best way would be to use it for running and debugging your App.
There are some Tutorials on the web.
For Example: http://zcourts.com/2013/07/19/android-debugging-over-bluetooth-without-root/
I'm looking for a way to write a file from a Windows application to an Android device SD card over a USB connection. To do this, I will need to obtain the drive letter of the SD card, and it's mount point. My Windows application is written in C++, so I'm most hoping for a solution in C++. If not possible, perhaps there is a Java solution which can then be placed in a C++ wrapper to be called by my application's code.
I've searched around and come up with a few ideas but nothing seems to work yet. First, I came across Google's documentation on a method,Environment.getExternalStorageDirectory(), but my assumption is that since this is part of the Android SDK, it is only usable from an application residing on an Android device. Secondly, I came across some functions in Windows' native API (WinBase.h primarily), which provides a way of locating all drives and their corresponding letters, but even if I can get this information, I don't know how to determine which of these is the connected Android device's SD card.
Any help is appreciated!
I'm not a windows application expert but if you can use system calls in your C++ program to call adb.exe, then you can execute adb commands directly to the device.
For example if you can execute "adb.exe devices" you can get a list of all android devices currently attached to the computer. From there, you can use any adb commands to push files onto the device.
More information on the adb commands here: ADB wiki
What you're looking for is probably doing an adb devices in combination with adb push <your file> /sdcard/<file on sdcard>
Good luck!
When an Android device is plugged in to a PC (through USB?), is the internal file system mapped to a drive letter on the PC? So that one can copy files to and from the Android under Windows?
And, can Emulator simulate the situation when it's plugged in? How?
Thank you in advance!
Yes, it CAN be mapped to a drive letter. It was much easier with something like a Droid X (Android 2.3), since it would show up as a mass storage device (disconnecting the card from your phone in the meantime), but it's also possible on newer phones such as the LG G3 if you're willing to install 2 free programs, which you probably would like to have anyway.
ES File Explorer - Remote Manager (FTP Server)
First, you need a file manager, not only because the built-in one is useless, but also because you need an FTP server. Install "ES File Explorer" on your Android Device. Then in the options, turn on the "Remote Manager" option, which will activate the FTP server and show you its local address like "192.168.1.3:3721. You can now access your phone as an FTP site from your computer when on your local WiFi network.
Net Drive - Remote Drive Mapping Utility
Next, all you have to do is install NetDrive: http://netdrive.net/ It's freeware and seems to be used by a lot of companies, because it lets you map cloud storage to local drives. That will allow you to map your FTP server on your phone as a local drive.
Don't bother trying to map an FTP site with explorer. First, you may run into a problem that's apparently caused by Chrome, where you can't even add an FTP network location. You'll get an unexpected error telling you the path format is invalid. Interestingly, that is solved by opening the registry editor, then under [HKEY_CLASSES_ROOT\ftp] add a key named "ShellFolder" with string value "{E436EBB6-524F-11CE-9F53-0020AF0BA770}". The error will immediately cease occurring, with no restart or any other action required. Just go back in and add the ftp network location. That, however, still does not allow you to map it to a drive letter, which is why you need NetDrive.
As of Android 4, the wise ones have removed USB Mass Storage support for accessing the internal phone memory. So you no-longer get direct block-access (or a driver letter in windows). You can usually choose on the phone between MTP, or PTP (Media / Photo Transfer protocols) for whichever your OS supports better.
If your device has removable storage it should still support USBMS (with a drive letter) for that partition. At least Android still supports that, but your Manufacturer or Carrier-ware may still fail you here.
However, when it comes to the phone memory, there was a trade-off made in Honeycomb. Unified storage prevents wasted space (no more separate storage for phone / data, and having one fill up first and having confused frustrated users trying to move apps to SD, etc). The trade-off requires that:
Android can no longer ever yield up the storage for the host PC to
molest directly over USB.
Initially for Mac and Linux where support for MTP/PTP has been slower, You can use an FTP app on your phone. But now there is an increasing number of Desktop (PC/Mac/Linux) apps that understand and support the MTP or PTP protocols. You just don't get block access and so you can't get a drive letter without some hackery / third party software.
There have been hacks over the years to make FTP or WebDav or some other protocol work behind a windows drive letter, and something like could still work work for these MTP/PTP protocols, but I have yet to see any such consumer usable software for windows.
If your Linux distro doesn't include MTP support, gMTP seems pretty popular.
You can mount the device via USB but (in Win7 at least) it doesn't appear to have its own drive letter; rather it's treated like a camera or another media device. It doesn't mount automatically; you generally need to "opt-in" in the notification area with something like "Turn on USB storage"
Don't know about emulators.
Using Eclipse you can push and pull files to the emulator using the DDMS perspective. Doing similar on a real device, iirc will require root access to the device, at least to get to the 'sensitive' areas.
The SDK tools will also provide a way of push and pull via the command line.
possible with https://github.com/billziss-gh/sshfs-win
difficult finding good sshservers for android, know that at least one works but doesn't autostart at wifi and have to manually restarted, which it was possible to "come home from work, drive is connected"
this server seams to work fine
https://play.google.com/store/apps/details?id=net.xnano.android.sshserver.tv&hl=en_US
Wanted to backup(incremental) android device using Areca backup utility which requires src and dest to have drive paths.
After trying various methods like adb-sync, Syncthing, webDAV, etc. Got it working with ftp sharing.
Download any ftp server app. I used "WiFi FTP Server" by Medha Apps on Playstore to create a ftp server something like this- ftp://username:*#xxx.xxx.xxx.xxx:yyyy where username can be set in app settings and xxx is i.p. with yyyy as port number.
Map ftp URL to drive path by using free app- "DirectNet Drive"
Use the drive as if it's in your own system, though it will be slow being wireless.