Wednesday, July 27, 2011

Upcoming Smartphones WOW Just take a look



Nokia N9
One of the first of the all new MeeGo line of devices and from what we hear the last for Nokia as well, is the Nokia N9. This rectangular colorful block of a handset is equipped with all kinds of goodies from a Gorilla Glass display that’s also coated with an anti-glare polarizer (very handy for out door viewing I imagine) to a 1GHz Cortex A8 CPU for speed, NFC (Near Field Communication) support with Angry Birds Magic thrown in plus the Dolby Mobile sound engine. Although the handset will be available in 16GB and 32GB models, like the Nexus S, it will not have support for external memory which might be a bit of downer for some. The Nokia N9 will also be available in a variety of funky colors.
The MeeGo toting smartphone features -
  • a 3.9-inch AMOLED capacitive touchscreen with a 480 x 854 pixel resolution and 16 million colors
  • 3G, Wi-Fi with hotspot capabilities, EDGE/GPRS,
  • Bluetooth 2.1 with A2DP, USB 2.0
  • GPS with A-GPS support for Ovi Maps, Geotagging
  • 8 megapixel autofocus camera with dual LED flash, 720p video recording
  • Secondary camera for video calling
  • 16GB internal memory
  • 3.5mm handsfree socket for TV Out as well
  • Dolby Digital Plus

MILESTONE XT883
It was disappointing to realize that the Motorola MILESTONE 2 never did make it to India so my hopes are high for the XR883 making it here. This next-gen MILESTONE will feature a Dual-core 1GHz TI OMAP4 processor running Android Gingerbread and of course the customary MILESTONE slide out QWERTY keypad. Although it hasn’t been officially confirmed, it's quite unlikely that Motorola would not include it on this model when its predecessor the XT720 was equipped with a port. The onboard 8MP camera will be capable of full HD video recording and so naturally full HD video playback as well. The high-res mobile display should put it in the league of the or Samsung Galaxy SII although it falls just a little bit short of “Retina” quality resolution.
Motorola’s MILESTONE XT883 will also come with -

  • a 4-inch capacitive touchscreen with a 540 x 960 pixel resolution and 16 million colors
  • 3G, Wi-Fi with hotspot capabilities, EDGE/GPRS,
  • Bluetooth 2.1 with A2DP, USB 2.0
  • GPS with A-GPS support, Geotagging
  • 8 megapixel autofocus camera with LED flash, 1080p video recording
  • Secondary VGA camera for video calling
  • 16GB internal memory
  • 3.5mm handsfree socket
  • microSD card support up to 32GB

Xperia Pro
Sony’s Xperia range of Android enabled smartphones have been enjoying their spotlight for a while now and the Xperia Pro with its slide out full QWERTY keypad with individually spaced keys is due to hit the shelves soon. The Xperia Pro is also said to have a scratch resistant display. This funky looking smartphone will be out with Android Gingerbread running on a Qualcomm Snapdragon 1 GHz processor and Sony’s Mobile Bravia Engine to help enhance the device's visual capabilities. With DLNA as well as HDMI media streaming will be a breeze. The onboard 8 Megapixel camera will have features that include Geotagging, face/smile detection and Touchfocus.
The Sony Ericsson Xperia Pro will be equipped with -

  • a 3.7-inch LED-backlit LCD touchscreen with a 480 x 854 pixel resolution and 16 million colors
  • 3G, Wi-Fi with hotspot capabilities and DLNA compatibility, EDGE/GPRS,
  • Bluetooth 2.1 with A2DP, USB 2.0
  • GPS with A-GPS support, Geotagging
  • 8 megapixel autofocus camera with LED flash, 720p video recording
  • Secondary VGA camera for video calling
  • 1GB internal memory
  • 3.5mm handsfree socket for TV Out as well
  • FM radio
  • HDMI Out
  • microSD card support up to 32GB

Saturday, July 9, 2011

Android Basics


1) Android Basics

Introduction:

Android is a software stack for mobile devices that includes an operating system, middleware and key applications. Google Inc. purchased the initial developer of the software, Android Inc., in 2005. Android's mobile operating system is based on the Linux kernel. Google and other members of the Open Handset Alliance collaborated on Android's development and release. TheAndroid Open Source Project (AOSP) is tasked with the maintenance and further development of Android. The Android operating system is currently the world's best-selling Smartphone platform.

Android has a large community of developers writing applications ("apps") that extend the functionality of the devices. There are currently over 200,000 apps available for Android. Android Market is the online app store run by Google, though apps can also be downloaded from third-party sites. Developers write primarily in the Java language, controlling the device via Google-developed Java libraries.

The unveiling of the Android distribution on 5 November 2007 was announced with the founding of the Open Handset Alliance, a consortium of 80 hardware, software, and telecom companies devoted to advancing open standards for mobile devices. Google released most of the Android code under the Apache License, a free software and open source license.

The Android open-source software stack consists of Java applications running on a Java-based, object-oriented application framework on top of Java core libraries running on a Dalvik virtual machine featuring JIT compilation. Libraries written in C include the surface manager, OpenCore media framework, SQLite relational database management system, OpenGL ES 2.0 3D graphics API, WebKit layout engine, SGL graphics engine, SSL, and Bionic libc. The Android operating system, including the Linux kernel, consists of roughly 12 million lines of code including 3 million lines of XML, 2.8 million lines of C, 2.1 million lines of Java, and 1.75 million lines of C++.


Version history

2.1 Eclair

Changelog:
  • Sync: Expanded Account sync. Multiple accounts can be added to a device for email and contact synchronization
  • Email: Exchange support, Combined inbox to browse email from multiple accounts in one page.
  • Bluetooth: 2.1 support
  • Contacts: Tap a contact photo and select to call, SMS, or email the person.
  • Messaging: Search all saved SMS and MMS messages. Auto delete oldest messages in a conversation when a defined limit is reached.
  • Camera: Flash support, Digital zoom, Scene mode, White balance, Color effect, Macro focus
  • Virtual keyboard: Improved typing speed, smarter dictionary learns from word usage and includes contact names as suggestions.
  • Browser: Refreshed UI, Bookmark thumbnails, Double-tap zoom, Support for HTML5
  • Calendar: Agenda view enhanced, Attending status for each invitee, Invite new guests to events.
  • System: Optimized hardware speed, Revamped UI
  • Display: Support for more screen sizes and resolutions, Better contrast ratio
  • Maps: Improved Google Maps 3.1.2
  • MotionEvent class enhanced to track multi-touch events
  • Live Wallpapers: Home screen background images can be animated to show movement

2.2 Froyo

Changelog:
  • System: Speed, memory, and performance optimizations
  • Additional application speed improvements courtesy of JIT implementation
  • Integration of Chrome's V8 JavaScript engine into the Browser application
  • Improved Microsoft Exchange support (security policies, auto-discovery, GAL look-up, calendar synchronization, remote wipe)
  • Improved application launcher with shortcuts to Phone and Browser applications
  • USB tethering and Wi-Fi hotspot functionality
  • Added an option to disable data access over mobile network
  • Updated Market application with batch and automatic update features
  • Quick switching between multiple keyboard languages and their dictionaries
  • Voice dialing and contact sharing over Bluetooth
  • Support for numeric and alphanumeric passwords
  • Support for file upload fields in the Browser application
  • Support for installing applications to the expandable memory
  • Adobe Flash support
  • Support for extra high DPI screens (320 dpi), such as 4" 720p

2.3 Gingerbread

Changelog:
  • System: Updated user interface design for simplicity and speed
  • Display: Support for extra-large screen sizes and resolutions (WXGA and higher)
  • Internet calling: Native support for SIP VoIP telephony
  • Virtual Keyboard: Faster, more intuitive text input, improved accuracy, better suggested text. Voice input mode
  • Copy/Paste: Enhanced. Select a word by press-hold, copy, and paste.
  • Near Field Communication lets the user read an NFC tag embedded in a poster, sticker, or advertisement.
  • New audio effects such as reverb, equalization, headphone virtualization, and bass boost
  • System: Improved power management with a more active role in managing apps that are keeping the device awake for too long.
  • Download Manager gives the user easy access to any file downloaded from the browser, email, or another application.
  • Camera: Access multiple cameras on the device, including a front-facing camera, if available.
  • Media: Support for WebM/VP8 video playback, and AAC audio encoding
  • System: Enhanced support for native code development
  • Audio, graphical, and input enhancements for game developers
  • Concurrent garbage collection for increased performance
  • Native support for more sensors (such as gyroscopes and barometers)
  • Switched from YAFFS to ext4 on newer devices

Android Architecture



FEATURES OF ANDROID
  • Handset layouts The platform is adaptable to larger, VGA, 2D graphics library, 3D graphics library based on OpenGL ES 2.0 specifications, and traditional smartphone layouts.
  • Storage SQLite, a lightweight relational database, is used for data storage purposes
  • Connectivity Android supports connectivity technologies including GSM/EDGE, IDEN, CDMA, EV-DO, UMTS, Bluetooth, Wi-Fi (no connections through Proxy server and no Ad hoc wireless network), LTE, NFC and WiMAX.
  • Messaging SMS and MMS are available forms of messaging, including threaded text messaging and now Android Cloud To Device Messaging Framework(C2DM) is also a part of Android Push Messaging service.
  • Multiple Language Support Multiple languages are available on Android. The number of languages more than doubled for the platform 2.3 Gingerbread. Android lacks font rendering of several languages even after official announcements[citation needed] of added support (e.g. Hindi).
  • Web browser The web browser available in Android is based on the open-source WebKit layout engine, coupled with Chrome's V8 JavaScript engine. The browser scores a 93/100 on the Acid3 Test.
  • Java support While most Android applications are written in Java, there is no Java Virtual Machine in the platform and Java byte code is not executed. Java classes are compiled into Dalvik executables and run on the Dalvik virtual machine. Dalvik is a specialized virtual machine designed specifically for Android and optimized for battery-powered mobile devices with limited memory and CPU. J2ME support can be provided via third-party applications.
  • Media support Android supports the following audio/video/still media formats: WebM, H.263, H.264 (in 3GP or MP4 container), MPEG-4 SP, AMR, AMR-WB (in 3GP container), AAC, HE-AAC (in MP4 or 3GP container), MP3, MIDI, Ogg Vorbis, FLAC, WAV, JPEG, PNG, GIF (though earlier versions do not support animated GIFs, BMP.
  • Streaming media support RTP/RTSP streaming (3GPP PSS, ISMA), HTML progressive download (HTML5 <video> tag). Adobe Flash Streaming (RTMP) and HTTP Dynamic Streaming are supported by the Flash plugin. Apple HTTP Live Streaming is supported by RealPlayer for Mobile, and by the operating system in Android 3.0 (Honeycomb). Microsoft Smooth Streaming is planned to be supported through the awaited port of Silverlight plugin to Android.
  • Additional hardware support Android can use video/still cameras, touchscreens, GPS, accelerometers, gyroscopes, magnetometers, dedicated gaming controls, proximity and pressure sensors, thermometers, accelerated 2D bit blits (with hardware orientation, scaling, pixel format conversion) and accelerated 3D graphics.
  • Multi-touch Android has native support for multi-touch which was initially made available in handsets such as the HTC Hero. The feature was originally disabled at the kernel level (possibly to avoid infringing Apple's patents on touch-screen technology at the time). Google has since released an update for the Nexus One and the Motorola Droid which enables multi-touch natively.
  • Bluetooth Supports A2DP, AVRCP, sending files (OPP), accessing the phone book (PBAP), voice dialing and sending contacts between phones. Keyboard, mouse and joystick (HID) support is available through manufacturer customizations and third-party applications. Full HID support is planned for Android 3.0 (Honeycomb).
  • Video calling Android does not provide native video calling support, but some handsets have a customized version of the operating system that support it, either via the UMTS network (like the Samsung Galaxy S) or over IP. Video calling through Google Talk is available in Android 2.3.4 and later.
  • Multitasking Multitasking of applications is available.
  • Voice based features Google search through voice has been available since initial release. Voice actions for calling, texting, navigation, etc. are supported on Android 2.2 onwards.
  • Tethering Android supports tethering, which allows a phone to be used as a wireless/wired hotspot. Prior to Android 2.2 this was supported by third-party applications or manufacturer customizations.
  • Screen Capture Android does not currently support screenshot capture. This is supported by manufacturer and third-party customizations.

Friday, July 8, 2011

How To: Begin hacking android apps

Note: This is for educational purpose only. Do not try this for commercial purpose


Introduction
Since I started doing Android development, I have looked at many licensing options, from simple forward locking (/data/app-private), which was a complete failure, to KeyesLab’s AAL which I really liked, to a custom one I was privy to, written by my friend Colin O’Dell. I even went as far as writing two different ones myself.

By far the best looking, and nicest option I have seen is Google’s own Android Licensing Service. However, even Goliath can fall to a pebble.

A few days ago, after asking the AndroidPolice editors to write an article on piracy, I found a problem with Google’sAndroid License Verification Library. A minor patch to an application employing this official, Google-recommended protection system will render it completely worthless.


Implications
Our findings show that most (any?) apps can be easily patched and stripped of licensing protection, making them an easy target for off-Market, pirated distribution. By corollary, this means that sites dedicated to pirating apps can continue to do so, using a few automated scripts mixed with some smarts.

Demo
Watch this demonstration video of my patch method tricking both the protected version of the game StarHunt and the Google LVL demo app into thinking they have been purchased legitimately



Breaking The Library (aka The Technical Mumbo Jumbo)
A little back-story on Java, which most Android applications are written in. Java applications are compiled into bytecode, that runs on top of a Virtual Machine, generally independent of platform. Due to the need for cross compatibility, the bytecode is fairly readable. Many software suites exist to decompile/disassemble it, making it an easy target for reverse engineering.

For Android, the main disassembly suite is smali/baksmali. The bytecode output from baksmali can be edited in any text editor, and reassembled using smali.

"smali/baksmali is an assembler/disassembler for the dex format used by dalvik, Android’s Java VM implementation. The syntax is loosely based on Jasmin’s/dedexer’s syntax, and supports the full functionality of the dex format (annotations, debug info, line info, etc.)"

[*]please note, theres more ways to decompiling/compiling apks such as apktool which is in .jar(jave) it has no GUI, unlike apk manager thats has somewhat of a GUI

Because the License Verification Library is not part of the Android OS (i.e. it doesn’t ship with phones – it’s an optional SDK download), an app developer needs to package it with the app that uses it, making it an easier patch target, without requiring root access.
Image

The first step in reproducing this is to dissemble the apk using baksmali and find the LicenseValidator class. In custom implementations and pro-guarded apps like Tasker, this filename will differ, and so will the code, but not enough to stop a pirate from patching it.

When disassembling the basic implementation of the licensing service, you will find this file out/com/android/vending/licensing/LicenseValidator.smali. This class responds back to the application, telling it the results of the verification attempt. Opening this file in a text editor will show you the bytecode, and at the beginning you will see these constants.


LicenseValidator.smalli constants 
CODE: SELECT ALL
.field private static final ERROR_CONTACTING_SERVER:I = 0x101
.field private static final ERROR_INVALID_PACKAGE_NAME:I = 0x102
.field private static final ERROR_NON_MATCHING_UID:I = 0x103
.field private static final ERROR_NOT_MARKET_MANAGED:I = 0x3
.field private static final ERROR_OVER_QUOTA:I = 0x5
.field private static final ERROR_SERVER_FAILURE:I = 0x4
.field private static final LICENSED:I = 0x0
.field private static final LICENSED_OLD_KEY:I = 0x2
.field private static final NOT_LICENSED:I = 0x1


This code itself is unimportant, and may not show up in custom implementations, but it will help you understand the next step.

Scrolling to the bottom of LicenseValidator.smali, you will see this block of code in the “verify” method:

LicenseValidator.smali verify 

CODE: SELECT ALL
.sparse-switch
0x0 -> :sswitch_d3
0x1 -> :sswitch_de
0x2 -> :sswitch_d3
0x3 -> :sswitch_11d
0x4 -> :sswitch_f3
0x5 -> :sswitch_101
0x101 -> :sswitch_e5
0x102 -> :sswitch_10f
0x103 -> :sswitch_116
.end sparse-switch


This is a switch block, which essentially tells the licensing library what to do next, depending on the results of the verification query. Each possible result is “mapped” to a different function.

Notice how the values on the left correspond to the constants at the beginning of the file. 0X0 and 0×3 are both positive results, which will tell the application that your device has a valid license. The others are various forms of negative results, and depending on how the application is coded, will result in different things.

The important one here is 0×1, or NOT_LICENSED. By changing “0×1 -> :sswitch_de ” to “0×1 -> :sswitch_d3” we basically point it to a positive outcome instead, so the library tells your app the license is actually valid.

The final step is to reassemble with smali, placing the new dex file in the apk, and re-sign it with any valid key (even test-keys).

Even though the library knows the status is NOT_LICENSED, the described tweak ensures the application will receive a LICENSED result instead and believe that it is, in fact, licensed. This method is so simple, even a novice programmer could write a script to automatically patch most apps.



Credits:.blackdroid