Retreiving the IMEI from an XDA II - Windows Mobile Development and Hacking General

Hi all,
We are developing a web aplicaction (J2EE) from the XDA II platform. I was wondering if it is possible to retrieve the IMEI. The idea would be to send the IMEI to the server via AJAX (if it´s supported),html post via https when the user opens the browser which will then validate the IMEI against a set of entries in an LDAP V3 server.
Is it possible via VBScript/other to get a handle to a specfic dll (ActiveX) that will retrieve the IMEI. I persume that there would be a security issue retrieving the IMEI.
Thanks alot,
Gerardo Macari

To get a serial number:
http://www.pocketpcdn.com/articles/serial_number2002.html
Code:
#include <WINIOCTL.H>
extern "C" __declspec(dllimport)
BOOL KernelIoControl(
DWORD dwIoControlCode, LPVOID lpInBuf, DWORD nInBufSize,
LPVOID lpOutBuf, DWORD nOutBufSize, LPDWORD lpBytesReturned
);
#define IOCTL_HAL_GET_DEVICEID CTL_CODE(FILE_DEVICE_HAL, 21, METHOD_BUFFERED, FILE_ANY_ACCESS)
CString GetSerialNumberFromKernelIoControl()
{
DWORD dwOutBytes;
const int nBuffSize = 4096;
byte arrOutBuff[nBuffSize];
BOOL bRes = ::KernelIoControl(IOCTL_HAL_GET_DEVICEID,
0, 0, arrOutBuff, nBuffSize, &dwOutBytes);
if (bRes) {
CString strDeviceInfo;
for (unsigned int i = 0; i<dwOutBytes; i++) {
CString strNextChar;
strNextChar.Format(TEXT("%02X"), arrOutBuff[i]);
strDeviceInfo += strNextChar;
}
CString strDeviceId =
strDeviceInfo.Mid(40,2) +
strDeviceInfo.Mid(45,9) +
strDeviceInfo.Mid(70,6);
return strDeviceId;
} else {
return _T("");
}
}
Or try this:
http://www.peterfoot.net/RetrieveIMEIThroughTAPI.aspx
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
VB Example enclosed.

Related

[Q] Something I don't understant about "Avoid Creating Objects".

Hello,
I've reading the topic About Avoid Creating Objects in Designing for performance for android and says:
When extracting strings from a set of input data, try to return a substring of the original data, instead of creating a copy. You will create a new String object, but it will share the char[] with the data.
I don't understand it. Maybe I have to get a book of java, jeje.
Well, it's difficult to find information about this paragraph.
Could you write an example or explain it?
Thank you.
How I understand your quote, it works like show in this image:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
The above method is the suggested one. Here the returned substring of the original string still points internally to the original char[] array so there is no memory wasted.
In the second method a (shortened) copy of the original string is made, so you are wasting (in this example) 6 more bytes of memory.
Thank you.
Now I understand. In the better option you reuse the same array. So there is no need to create a new object.

[Q] Vibrant possibly bricked. Please help!

Hello!
During the firmware on the stock firmware Eugene_2E_JK2_Froyo through Odin, Odin hung on <ID:0/014> factoryfs.rfs (at this time on the phone was burning violet on the screen) and so stood for about 15 minutes - I turned off the phone from the computer, took out the battery to restart the phone, put battery back, try turn on my phone, but it is not included!
If you try to include Recovery - a screen appears with the message:
RST_STAT = 0x1
PWIC_IRQ1 = 0x3c
PWIC_IRQ2 = 0x0
PWIC_IRQ3 = 0x0
PWIC_IRQ4 = 0x0
PWIC_STATUS1 = 0xc0
PWIC_STATUS2 = 0x2c
In other cases, the phone does not react to any buttons
I found a similar theme in http://forum.xda-developers.com/showthread.php?p=7435894, but my phone don’t wont to turn on screen
Please help!
P.S. I'm not English speaking and my English is some bad, I am use Google Translater
Please answer the more neutral English
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
try taking out the SIM, SD card, and battery and leave it for about 15 minutes. at this time replace only the battery and see if it starts up without that error.
http://forum.xda-developers.com/showthread.php?t=773006
Looks like no power button / only volume seems to werk for most there to get into DLmode. A jig might help as well. Good luck!

[Q] Intent for device list in Wi-fi direct

I have enabled wifi through code ...
wifiManager = (WifiManager) this.getSystemService(Context.WIFI_SERVICE);
wifiManager.setWifiEnabled(true);
I want to redirect to the Available devices in the wi-fi direct screen. I dont wanna implement my own listview for devices and stuff, as shown in the Wi-fi direct demo on android sdk.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
This has been done in an app on PlayStore, where the app redirects to the devices screen and the file transfer begins on selecting a device, just like bluetooth. Whats the intent for this?
gamerxxxn said:
I have enabled wifi through code ...
wifiManager = (WifiManager) this.getSystemService(Context.WIFI_SERVICE);
wifiManager.setWifiEnabled(true);
I want to redirect to the Available devices in the wi-fi direct screen. I dont wanna implement my own listview for devices and stuff, as shown in the Wi-fi direct demo on android sdk.
This has been done in an app on PlayStore, where the app redirects to the devices screen and the file transfer begins on selecting a device, just like bluetooth. Whats the intent for this?
Click to expand...
Click to collapse
http://stackoverflow.com/questions/16581549/intent-for-device-list-in-wi-fi-direct-android

[Semi-OT] Weird/Funny Stuff Hidden in the Stock Image

There's a LOL-cat hidden in Oobe.apk. The original filename is nook_icon_i_can_haz.png:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Click to expand...
Click to collapse
Among the default Terms & Conditions, there's this gem (also in Oobe.apk):
ncCheckboxAdd("OPTIONAL_PUBBLES", "Yes, I love to receive marketing emails! Count me in. Let's do it. I'm a huge fan of this stuff. Really.", false);
Click to expand...
Click to collapse
The missing Bronte sister? Discovered in QuickStartActivity.apk:
Click to expand...
Click to collapse
The following message can be found in the bootloader (u-boot.bin):
% strings u-boot.bin | fgrep here
How did we get here %s %d ?
Click to expand...
Click to collapse
Don't know how to get "there," so don't ask.
Other than that, there are some typos, such as this one in DownloadProvider.apk:
.field public static final ACTION_READ_ENQUEUE:Ljava/lang/String; = "com.android.providers.dowloads.ENQUEUE_DOWNLOAD"
Click to expand...
Click to collapse
or this one in framework.jar:
.field public static final MY_FIELS:Ljava/lang/String; = "My Files"
Click to expand...
Click to collapse
If you know anything else, please share.

[DEV] OkHttp Profiler-Android Studio plugin for an OkHttp/Retrofit requests profiling

Hi! Let me introduce the OkHttp Profiler plugin for an Android Studio and an IntellijIDEA. It can show HTTP/HTTPS request details in the IDE tool window. You can explore request/response headers, inspect the JSON as a tree, as a plain text etc. And you can easily create a Java/Kotlin model from the data. Just click the right mouse button on a root element of the tree (or any other), choose Java or Kotlin, and select a folder for a new file in the project.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
To activate, just add the library to the Android Gradle file (build.gradle) in your module (application/app/build.gradle)
Code:
dependencies {
//……………
implementation 'com.itkacher.okhttpprofiler:okhttpprofiler:1.0.3'
}
Sync the Gradle project to apply the changes and set an interceptor to the OkHttp client by adding the following code to OkHttp client or Retrofit:
Code:
OkHttpClient.Builder builder = new OkHttpClient.Builder();
if (BuildConfig.DEBUG) {
builder.addInterceptor(new OkHttpProfilerInterceptor());
}
OkHttpClient client = builder.build();
Now open Android Studio preferences, select the "Plugins" tab, then "Browse repositories" and type "OkHttp Profiler" into a search field.
Press "Install" and "Restart".
The plugin will appear in right bottom corner of the Android Studio
The source code of the Android library
https://github.com/itkacher/OkHttpProfiler
The issue tracker
https://github.com/itkacher/OkHttpProfiler/issues

Categories

Resources