Tag Archives: hack

Android Proguard a General Idea

What is Proguard on android and what does it do?

ProGuard is a tool that comes with the Android SDK. It  shrinks, optimizes, and obfuscates your code by removing unused code and renaming classes, fields, and methods with semantically obscure names. The result is a smaller sized .apk file that is more difficult to reverse engineer. Because ProGuard makes your application harder to reverse engineer, it is important that you use it when your application utilizes features that are sensitive to security.

How to enable it? And is it recommended?

ProGuard is integrated into the Android build system. And to enable it you just have to find the “project.properties” file in your android project and have to uncomment the line which sets the path for the ProGuard. Also Proguard slows the app building sequence.
So you do not have to invoke it manually. ProGuard runs only when you build your application in release mode, so you do not have to wait longer time when debugging the app. Having ProGuard run is completely optional, but highly recommended.

So is that all that we have to do to enable and use ProGuard?

Yes that’s the basic, and it only does the Shrinking, but there are 2 more functions that give more advantages in increasing the security and management of the build.
They are Obfuscation and Repackaging.

So what is Obfuscation and how does it Work

With tools available to extract the contents of APK’s, deodex, and read the class files, it’s important to obfuscate to protect the proprietary aspects of your codebase.

ProGuard generates a mapping file that allows you to map the stack traces of obfuscated code to actual methods. Basically it replaces the methods in meaning full name to something unguessable like a work or letter.

Original Code

public Data(int id, int result, String message) {
       mId = id;
       mResult = result;
       mMessage = message;

Obfuscated Code

public a(int paramInt1, int paramInt2, String paramString)
       this.a = paramInt1;
       this.b = paramInt2;
       this.c = paramString;

 Hope you got an idea on how it works

So what is Repackaging?

Repackaging allows ProGuard to take externals jars and class files and move them to a single container with a common java package location.

For those of you building libraries, repackaging is extremely helpful if you choose to show a simple interface to third party developers while keeping a maintainable and well structured project hierarchy in the source repository. This can also be useful in organizing lower level packages while exposing well defined interfaces!


There is another function of Proguard which Optimizes the code, where you can specify which part of the code, which type of code needs to be Optimized.  However, there are known incompatibility issues with various Dalvik versions.
But It is good to know this feature, which can be used without issues using some other tools.

Reference : http://www.crashlytics.com/blog/mastering-proguard-for-building-lightweight-android-code/, http://developer.android.com/tools/help/proguard.html


Installing Google Glass in an Android Phone

Ok in this article we will see how to install Google Glass in your Android phone.
Actually we are installing some apps that are specific(That comes with) to the glass. These apps are taken from the explorer glass system dump(OS).

There are more things you can explore using the System dump but as for now. We will bring the basic functionality of the Google Glass to the Android phone.

Prerequisites – You need a wifi connection to authorize the google account to your glass software. Reason is google glass only has wifi connectivity so its only means to connect to internet is through wifi, so they don’t have data related libraries’ so if you are connected through your data connection it wont work. But if you don’t have a wifi, create a hotspot through a laptop or smartphone and change your data into wifi. But you can try using the data connection and post a comment if it works.

There must be a

Step 1
Download the GoogleGlass.rar

Extract the file.

To simply install, copy these files into the SD Card of your android phone and
click on them and
it will prompt you, from which app to open the file,
select the package installer.
(If this is not the first time you are installing an app in this method you can skip this sline)Then it will ask you to enable the third party app/unknown source app installation,
which you can find in the Settings–> Security
Now you can install the apks.

First of all Instal the following files

  • glassbrowser-modded.apk
  • GlassCamera.apk
  • GlassHangouts.apk
  • glasshome-modded.apk
  • glassmaps-modded.apk
  • glasspeople-modded.apk
  • glasssetup-modded.apk
  • GlassSound.apk
  • glassvoice-modded.apk

After installing all these apks (Don’t run any of the apps as soon as you install), before opening any app open the ‘Glass Setup’ app which is available now in your app list.
And you will see the following screen.

At this point you must login to
https://www.google.com/myglass using your google account that you wish to associate with your glass App.

First you will see this page in your browser

Now click on the Start link and you will go to this page

As usual agree to the agreements and click continue
Add the wifi name and password(You can try using fake name and password).
And click on the Add network

Now you will see this. Screen, in the original glass you can scan the code but in the app we have installed in the phone that feature won’t work. But if you keep the Google Setup app open, automatically the continue button will be enabled, if it did not work, close the app and restart the app and it will get authorized and you are ready open the Google Glass.

Now you will be redirected to your Glass Companion page, here you will see all the glasswares(In google glass apps are called glasswares) you have subscribed, here you can manage them. Or there is an app called glass companion, which I have added in the rar you downloaded now.

This is the Website Glass Companion

This is the Android App

Now you can Open the ‘Glass Home’ App from your App list
And you will See this View

And start the operations by saying the magic word ‘ok glass’And you will see available commands

So this is how the google glass works,
for how to use commands please see my first article on Google Glass

Most of the commands will not work,
Ok glass–> google… will wok and it acts like google now.
Ok glass–>Send a message to will work if you have added contacts from your gmail account in the glass comapnion

Most of the others will not work. But in my next post I’ll write an article on how to make the command ‘take a picture works’, be ready some basic android programing stuff will be there.

Be ready to do some Android Code…!

Download the Whole System Dump from Here

Update (12/3/2014): Now after the GlassSneakPeak GDK is released, now you can develop apps using the GDK and add your own commands easily and can open them using voice commands. I am not sure but if you manage to get the latest XE12 Glass OS or later and install it in the phone it should work. If I have time Ill publish a new post on it.

Sony Xperia Illumination Bar Code(Some Code that May Interest you)

Here in this blog I am adding the illumination bar control activity class which I hacked and got from the famous Illumination bar App for Sony Xperia Android Phones. Hope you can get the basic Idea of the classes you have to access to take control of the lights Happy Coding.

If you are new to Illumination Bar App try it in the Google Play App Store

If you want to know how to hack an Android App step by step, please check my Blog on Android App Hacking

Thank You


package com.rundgong.illuminationcontrol;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.ContextWrapper;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.Iterator;

public class IlluminationControlActivity extends Activity
public static final int LED_RGB = 1;
public static final int LED_WHITE = 0;
public static boolean sAccessibilityIsMissing = false;
public static final int sWhitePos = 6;
public static int testBlinkCounter = 0;
BooleanItemSummary mAlwaysOnSummary;
ArrayList mAppConfigs;
ArrayList mAppNotificationDatas = getDefaultApps();
GeneralSettingsSummary mGeneralSettingsSummary;
LinearLayout.LayoutParams mLayoutParams;
View mMainView;
NightModeSummary mNightModeSummary;
ArrayList mPhoneConfigs;
SelectThemeColorSummary mSelectThemeColorSummary;
BooleanItemSummary mTempDisable;

sAccessibilityIsMissing = true;

private void addAppNotifications()
LinearLayout localLinearLayout = (LinearLayout)this.mMainView.findViewById(2131165198);
localLinearLayout.addView(getHeadlineView(getString(2131034117)), this.mLayoutParams);
Iterator localIterator1 = this.mAppNotificationDatas.iterator();
Iterator localIterator2;
if (!localIterator1.hasNext())
localIterator2 = new UserApps(this).mUserApps.iterator();
while (true)
if (!localIterator2.hasNext())
AppNotificationData localAppNotificationData1 = (AppNotificationData)localIterator1.next();
ConfigItemSummary localConfigItemSummary1 = new ConfigItemSummary(this, localAppNotificationData1.displayName, localAppNotificationData1.packageId, true);
localLinearLayout.addView(localConfigItemSummary1, this.mLayoutParams);
AppNotificationData localAppNotificationData2 = (AppNotificationData)localIterator2.next();
ConfigItemSummary localConfigItemSummary2 = new ConfigItemSummary(this, localAppNotificationData2.displayName, localAppNotificationData2.packageId, true);
localLinearLayout.addView(localConfigItemSummary2, this.mLayoutParams);

static void fileLog(CharSequence paramCharSequence)

static int getBaseIntensity(int paramInt)
int i = 255;
switch (paramInt)
case 6:
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
while (true)
return i;
i = 4;
i = 8;
i = 17;
i = 34;
i = 79;
i = 143;

static BlinkData getBlinkTimeFromPosition(int paramInt)
BlinkData localBlinkData;
switch (paramInt)
localBlinkData = new BlinkData(0, 0);
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
while (true)
return localBlinkData;
localBlinkData = new BlinkData(0, 0);
localBlinkData = new BlinkData(1000, 1000);
localBlinkData = new BlinkData(500, 500);
localBlinkData = new BlinkData(150, 150);
localBlinkData = new BlinkData(2000, 2000);
localBlinkData = new BlinkData(2000, 5000);
localBlinkData = new BlinkData(2000, 10000);
localBlinkData = new BlinkData(2000, 30000);
localBlinkData = new BlinkData(2000, 60000);

static int getColorFromPosition(int paramInt1, int paramInt2)
int i = getBaseIntensity(paramInt2);
int j;
switch (paramInt1)
j = -1;
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
while (true)
return j;
j = -16777216 + 65536 * i;
j = -16777216 + i * 256;
j = -16777216 + i;
j = -16777216 + 65536 * i + i * 256;
j = i + (-16777216 + i * 256);
j = i + (-16777216 + 65536 * i);
j = i + (-16777216 + 65536 * i + i * 256);

static ArrayListgetDefaultApps()
ArrayList localArrayList = new ArrayList();
localArrayList.add(new AppNotificationData("com.android.calendar", "Calendar"));
localArrayList.add(new AppNotificationData("com.android.email", "Email"));
localArrayList.add(new AppNotificationData("com.facebook.katana", "Facebook"));
localArrayList.add(new AppNotificationData("com.google.android.gm", "Gmail"));
localArrayList.add(new AppNotificationData("com.google.android.apps.plus", "Google+"));
localArrayList.add(new AppNotificationData("com.google.android.gsf", "Google Talk"));
localArrayList.add(new AppNotificationData("com.twitter.android", "Twitter"));
localArrayList.add(new AppNotificationData("com.whatsapp", "WhatsApp"));
return localArrayList;

static int getDefaultLedNumForDevice()
if (Build.MODEL.contains("ST25"));
for (int i = 1; ; i = 0)
return i;

private TextView getHeadlineView(String paramString)
TextView localTextView = new TextView(this);
return localTextView;

static String getLedIdFromNumber(int paramInt)
if (paramInt == 1);
for (String str = "com.sonyericsson.illumination.intent.extra.value.BUTTON_RGB"; ; str = "com.sonyericsson.illumination.intent.extra.value.BUTTON_2")
return str;

public static void illuminate(ContextWrapper paramContextWrapper, int paramInt1, int paramInt2, BlinkData paramBlinkData, int paramInt3)
Intent localIntent;
if ((paramBlinkData == null) || (paramBlinkData.onTime == 0))
localIntent = new Intent("com.sonyericsson.illumination.intent.action.START_LED");
 localIntent.putExtra("com.sonyericsson.illumination.intent.extra.LED_ON_TIME", paramInt2);
while (true)
localIntent.putExtra("com.sonyericsson.illumination.intent.extra.PACKAGE_NAME", "com.rundgong.illuminationcontrol");
 localIntent.putExtra("com.sonyericsson.illumination.intent.extra.LED_ID", getLedIdFromNumber(paramInt3));
 localIntent.putExtra("com.sonyericsson.illumination.intent.extra.LED_COLOR", paramInt1);
 localIntent = new Intent("com.sonyericsson.illumination.intent.action.START_LED_PULSE");
 localIntent.putExtra("com.sonyericsson.illumination.intent.extra.LED_NO_OF_PULSES", paramInt2 / (paramBlinkData.offTime + paramBlinkData.onTime));
 localIntent.putExtra("com.sonyericsson.illumination.intent.extra.LED_PULSE_ON_TIME", paramBlinkData.onTime);
 localIntent.putExtra("com.sonyericsson.illumination.intent.extra.LED_PULSE_OFF_TIME", paramBlinkData.offTime);

private void refreshGUI()
Iterator localIterator = this.mPhoneConfigs.iterator();
while (true)
if (!localIterator.hasNext())

private void startBackgroundService()
startService(new Intent(this, BackgroundService.class));
startService(new Intent(this, NotificationService.class));

public void addMoreAppsButtonClicked(View paramView)
startActivity(new Intent(this, AddAppsActivity.class));

public void donateButtonClicked(View paramView)
startActivity(new Intent("android.intent.action.VIEW", Uri.parse("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=H7LW4D3XWK9GC")));

AlertDialog getAccessibilityDialog()
AlertDialog.Builder localBuilder = new AlertDialog.Builder(this);
localBuilder.setMessage(2131034157).setCancelable(false).setPositiveButton("Yes", new DialogInterface.OnClickListener()
public void onClick(DialogInterface paramDialogInterface, int paramInt)
IlluminationControlActivity.this.startActivity(new Intent("android.settings.ACCESSIBILITY_SETTINGS"));
}).setNegativeButton("No", new DialogInterface.OnClickListener()
public void onClick(DialogInterface paramDialogInterface, int paramInt)
return localBuilder.create();

public void helpButtonClicked(View paramView)
startActivity(new Intent(this, HelpActivity.class));

public void onCreate(Bundle paramBundle)
this.mMainView = ((LayoutInflater)getSystemService("layout_inflater")).inflate(2130903043, null);
this.mGeneralSettingsSummary = new GeneralSettingsSummary(this);
this.mAlwaysOnSummary = new BooleanItemSummary(this, getString(2131034129), "keyLightAlwaysOn");
this.mTempDisable = new BooleanItemSummary(this, getString(2131034130), "tempDisableIllumination");
this.mNightModeSummary = new NightModeSummary(this);
this.mSelectThemeColorSummary = new SelectThemeColorSummary(this);
this.mPhoneConfigs = new ArrayList();
this.mAppConfigs = new ArrayList();
this.mLayoutParams = new LinearLayout.LayoutParams(-1, -2);
this.mLayoutParams.setMargins(0, 1, 0, 0);
LinearLayout localLinearLayout1 = (LinearLayout)this.mMainView.findViewById(2131165196);
localLinearLayout1.addView(getHeadlineView(getString(2131034114)), this.mLayoutParams);
localLinearLayout1.addView(this.mGeneralSettingsSummary, this.mLayoutParams);
localLinearLayout1.addView(this.mAlwaysOnSummary, this.mLayoutParams);
localLinearLayout1.addView(this.mTempDisable, this.mLayoutParams);
localLinearLayout1.addView(this.mNightModeSummary, this.mLayoutParams);
localLinearLayout1.addView(this.mSelectThemeColorSummary, this.mLayoutParams);
LinearLayout localLinearLayout2 = (LinearLayout)this.mMainView.findViewById(2131165197);
localLinearLayout2.addView(getHeadlineView(getString(2131034116)), this.mLayoutParams);
ConfigItemSummary localConfigItemSummary1 = new ConfigItemSummary(this, "SMS", "sms", false);
localLinearLayout2.addView(localConfigItemSummary1, this.mLayoutParams);
ConfigItemSummary localConfigItemSummary2 = new ConfigItemSummary(this, "Missed Calls", "missedCalls", false);
localLinearLayout2.addView(localConfigItemSummary2, this.mLayoutParams);
ConfigItemSummary localConfigItemSummary3 = new ConfigItemSummary(this, "Battery Full", "batteryFull", false);
localLinearLayout2.addView(localConfigItemSummary3, this.mLayoutParams);
ConfigItemSummary localConfigItemSummary4 = new ConfigItemSummary(this, "Battery Empty", "batteryEmpty", false);
localLinearLayout2.addView(localConfigItemSummary4, this.mLayoutParams);

public void onResume()
if (sAccessibilityIsMissing)

public static class BlinkData
int offTime = 0;
int onTime = 0;

public BlinkData(int paramInt1, int paramInt2)
this.onTime = paramInt1;
this.offTime = paramInt2;

Let’s Hack Android Apks

Ok guys i know many of you have tried to hack android apks using APK tool, but is it a success????
No I don’t think so you get a encrypted code, but you get the images out of it.

But here I am gona guid you using 2 tools
one is Dex2JAR and the other one is the JD GUI
Download Dex2JAR here
Download JDGUI here

Ok now I hope you know how to get an apk file from an Android App, the easiest way is to use the App Super Backup app available in the Google Market.

1.Get the APK from your phone memory card , where the Super Backup normally puts the apk.

2.Extract the DEX2JAR file

3.copy the APK file you want to extract code in to that file

4.now open the command prompt and change the directory

(command to change directory in command prompt”cd C:\Users\Amalan\Desktop\dex2jar-\dex2jar-″)to the directory where you have copied your APK in my case the directory is “C:\Users\Amalan\Desktop\dex2jar-\dex2jar-”

5.now to convert the APK to JAR type this command “dex2jar.bat ‘yourapp.apk’ ” and press enter and you will get the JAR file of your APK.

6.now extract the JDGUI and there you will find ‘jd-gui’ exe file, run it

7.now drag and drop the JAR file you just created, Voila you will find all the code in it. Not a Single Encryption the total code is available to you.

8.here you wont get any drawable files, for that use APK TOOL or just rename the ‘.apk’ to ‘.rar’ and extract and you can take all the images.

Thats it you have successfully Extracted the full source code out of your favorite Android App