How To Change Imei In Android Studio Emulator For Mac
Dec 11, 2009 In fact they are, and IMEI number can be modified in a few simple steps: backup the emulator binary open the binary with your favourite hex editor search for +CGSN string followed by a null byte, it should be followed by 15 digits of the IMEI number. Jan 29, 2017 How to change Device ID on Android Nox App Player. Skip navigation. How to change IMEI+Device ID+Android ID+Phone Model of Bluestacks in one go. Top 5 Best Android Emulators.
-->To connect to the Android Emulator running on a Mac from a Windowsvirtual machine, use the following steps:
Start the emulator on the Mac.
Kill the
adb
server on the Mac:Note that the emulator is listening on 2 TCP ports on the loopbacknetwork interface:
The odd-numbered port is the one used to connect to
adb
. See alsohttps://developer.android.com/tools/devices/emulator.html#emulatornetworking.Option 1: Use
nc
to forward inbound TCP packets received externally on port 5555 (orany other port you like) to the odd-numbered port on the loopbackinterface (127.0.0.1 5555 in this example), and to forward theoutbound packets back the other way:As long as the
nc
commands stay running in a Terminal window, thepackets will be forwarded as expected. You can type Control-C inthe Terminal window to quit thenc
commands once you're doneusing the emulator.(Option 1 is usually easier than Option 2, especially if System Preferences > Security & Privacy > Firewall is switched on.)
Uniflow client for mac. Option 2: Use
pfctl
to redirect TCP packets from port5555
(or any other port youlike) on theShared Networking interface tothe odd-numbered port on the loopback interface (127.0.0.1:5555
in this example):This command sets up port forwarding using the
pf packet filter
system service. The line breaks are important. Be sure to keep themintact when copy-pasting. You will also need to adjust theinterface name from vmnet8 if you're using Parallels.vmnet8
isthe name of the special NAT device for the Shared Networkingmode in VMWare Fusion. The appropriate network interface inParallels is likelyvnic0.Connect to the emulator from the Windows machine:
Replace 'ip-address-of-the-mac' with the IP address of the Mac, for example as listed by
ifconfig vmnet8 grep 'inet '
. If needed, replace5555
with the other port you like from step 4. (Note: one way to get command-line access toadb
is via Tools > Android > Android Adb Command Prompt in Visual Studio.)
Alternate technique using ssh
If you have enabled Remote Login on the Mac, then you can use ssh
port forwarding to connect to the emulator.
Install an SSH client on Windows. One option is to installGit for Windows. The
ssh
command will then be available in the Git Bash command prompt.Follow steps 1-3 from above to start the emulator, kill the
adb
server on the Mac, and identify the emulator ports.Run
ssh
on Windows to set up two-way port forwarding between alocal port on Windows (localhost:15555
in this example) and theodd-numbered emulator port on the Mac's loopback interface(127.0.0.1:5555
in this example):Spf editor for mac. Replace
mac-username
with your Mac username as listed bywhoami
. Replaceip-address-of-the-mac
with the IP address ofthe Mac.Connect to the emulator using the local port on Windows:
(Note: one easy way to get command-line access to
adb
is viaTools > Android > Android Adb Command Prompt in Visual Studio.)
A small caution: if you use port 5555
for the local port, adb
willthink that the emulator is running locally on Windows. This doesn'tcause any trouble in Visual Studio, but in Visual Studio for Mac itcauses the app to exit immediately after launch.
Alternate technique using adb -H
is not yet supported
In theory, another approach would be to use adb
's built-in capabilityto connect to an adb
server running on a remote machine (see forexample https://stackoverflow.com/a/18551325).But the Xamarin.Android IDE extensions do not currently provide a wayto configure that option.
Contact information
This document discusses the current behavior as of March, 2016. Thetechnique described in this document is not part of the stable testingsuite for Xamarin, so it could break in the future.
If you notice that the technique no longer works, or if you notice anyother mistakes in the document, feel free to add to the discussion onthe following forum thread:http://forums.xamarin.com/discussion/33702/android-emulator-from-host-device-inside-windows-vm.Thanks!
Introduction
Device binding is commonly used in android application for tracking a user’s device and ensure accountability. Some android application developers use this device id binding technique to uniquely identify users. When an application offers the discount promo code for user’s benefits, application acquires device attribute to track users against that specific promo code. In some case, the developer uses IMEI number to validate the user’s applied promo code whether it is valid or not.
Following are the device attributes used by an android application for device id mapping.
- Android device ID
- IMEI no.
- Mac address
Below is a scenario in which by changing IMEI number, device id binding validation is bypassed. IMEI number is a unique for each mobile handset, used by GSM to identify a valid device on the network.
Pre-requisites
- A rooted Android device
- Xposed framework
- IMEI changer pro application
IMEI number validation bypass
This scenario is based on android application which uses the IMEI number for device ID mapping. The business purpose of the application was to provide a promotional offer on a new application installation and for a new user ID. Hence a user cannot avail the same offer if any of below cases:
- If the user ID was registered on any of the device.
- If the mobile application was previously installed on the device. (uninstalling and reinstalling the application, then promo code won’t work to avail any offer)
Hence to avail the offer, an unregistered user should download the application to the mobile devices for the first time.
[Validation] Note: Application provides the user to generate a pin for accessing some good offers on ecommerce application. Only onetime, a single user with an android device can register for pin generation after a successful generation of pin user cannot register again. Application sends all parameter in encrypted form and it has also a request checksum to validate the request integrity.
Steps to bypass the IMEI validation
Firstly, attacker registers himself on a valid android device. After that his device maps with his corresponding user id and he generates the pin.
After registration, attacker again enters all the details for generating pin as shown in figure 1.
After submitting the request, application throws an error that the “Device is already registered with another CustID”
It was observed that application is using IMEI number mapping when user register by submitting his first pin generate request.
After analyzing the burp request of pin generation, it was observed that application’s whole request was in encrypted form. So it would be difficult for an attacker to tamper the parameter values of IMEI number as shown in figure 4.
Changing IMEI number through Xposed framework
To change IMEI number attacker should have a root android device. Xposed IMEI changer is an android application which helps to change IMEI number for other applications. It is a module under Xposed framework, it doesn’t change the IMEI number permanently but it changes the IMEI number virtually to fool other application.
After changing the IMEI number, attacker can generate Pin for promo offer successfully as shown in figure Below.
Recommendation
- Device binding for application should not rely on single value attribute of device. Developer may use such as App ID, Android device id, MAC address.
- It is recommended to use random token with IMEI no and other attributes of device.
- Application must use hashing algorithm when it sends to server side for validation of device.
- Application must have root detection capabilities, after that it would be difficult to change device attributes such as IMEI, android id and app ID for an android device user.
- Application preference file contents should be in encrypted or unreadable form.