Peakode is growing fast

Our company is growing fast. Since we start building mobile applications we came too far. With an amazing team of engineers and designers we’ll achieve more than that in the near future. We will never settle down. Will always follow the latest technologies and stay at the edge.


Obfuscate / Encrypt a String in Java

This how you can decrypt an obfuscated string in Java. Give an obfuscated string that encrypted with a certain key value.

private String obfuscateString(String str, String key) {

byte[] data = str.getBytes(Charset.forName(“UTF-16BE”));

byte[] keyData = key.getBytes(Charset.forName(“UTF-16BE”));

byte[] keyPtr = keyData;

int keyIndex = 0;

for (int i = 0; i < data.length; i++) {

char dataChar = (char) data[i];
char dataKeyPtrChar = (char) keyPtr[keyIndex];

dataChar = (char) (dataChar ^ dataKeyPtrChar);

data[i] = (byte) dataChar;


if (keyIndex == key.length())
keyIndex = 0;
keyPtr = keyData;

String result = null;
try {
result = new String(data, “UTF-16BE”);
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block

return result;

Intel® Hardware Accelerated Execution Manager and OS X Mavericks

As you know, Android emulators are very very very slow :/  So we are using Intel HAXM for speeding up our emulator. But there is a problem with the new OS X Mavericks system. It freezes when you just install HAXM from SDK manager and start your first emulator. Also If you search a little bit you’ll probably come across to a solution that Intel released. It’s a HotFix for OS X Mavericks. After installing this fix, you’ll be able to use your emulator at sonic speed :)

Here is the link for HotFix…:

After installing your HAXM from SDK Manager, just download this fix and install it. It will solve the problem.

Don’t use Java JDK 8 for Android development on OS X

I’ve recently switch to OS X Mavericks. But there was no Java installed by default on this system due to security policy of the Apple. So I decided to install Java JDK from Oracle’s website. I’ve installed the latest version of the JDK which is JDK 1.8.0. So I downloaded and installed it. Then I started my Eclipse ADT Bundle. It showed me an error about the JRE. And It was basically saying “You need to install Java JRE 6 to run Eclipse”. So I’ve installed default Apple Java Runtime Environment 6 from this link:

This installation solved my problem at first. Eclipse opened properly and I downloaded all of the necessary android sdk files from the SDK Manager. Then I’ve encountered an error and it was saying;

“posix_spawn is not a supported process launch mechanism on this platform”

At first I couldn’t find any solution for that problem on any website. Even posted on Stackoverflow. Then I also installed Java JDK 1.7.0 on my system. And decided to remove JDK 8 from my system and go with JDK7. This method worked fine for Eclipse and problems solved suddenly.

So don’t use JDK 8 for Android development on Eclipse!

What if you forgot your Android keystore password?

Android keystore is so important for updating your application on the market. You musn’t forget your keystore password in order to sign your apk. Because forgeting your keystore password also means loosing your application. You never want it.

Let assume you forgot your keystore password. There is a method that you can restore your password. But there is no guarantee that you will get your password. This method is called  “smart word list attack”. With this method you’ll need a jar packacge which is called AndroidKeystoreBrute_v1.03.jar. Also with this jar you’ll need a txt file for the possible word list that your password could contain. This small program simply checks all the iterations in this txt file. So the list in this file must be related with your password. So you should remember maybe a little bit of your password. At least some letters :)

For example, your password is “bl13ue0bird”. So in order to find your password your wordlist text file should contain some of the words or letter of this password.


How to implement:
First download this jar file from this link ->

Next copy this jar file to a directory such as \home directory. In this directory create your own “wordlist” text file. Then also copy your keystore file into this directory. Now open your terminal/console and enter to your directory which your jar file exist.

Now put this line into your console, change “yourkeystore” to yours, change “wordlist” to your text file and press enter.

java -jar AndroidKeystoreBrute_v1.03.jar -m 3 -k “yourkeystore” -d “wordlist”

If you lucky enough you’ll get keystore password. But remember it could take long time to detect your password.

You can find more methods like brute force attack at this link


How to easily make custom push notifications using Parse?

Sending push notificaitons to your users is very useful. And it is very simple with backend services like Parse.

This tutorial can be helpful if you are familiar with the Parse. Otherwise you should at least finish simple push notification tutorial at Parse Tutorials.

If you’ve already finished this tutorial you might noticed that this implication is just sending your user to a default activity. It’s not chaning depending on your notification’s content. But you might want to change activity and direct your user to different activities.

In order to do this, you must create a CustomNotificationReceiver which extends BradcastReceiver class. And don’t forget to change package name to yours.

First you must add these colored lines to your AndroidManifest.xml file just after the ParseBroadcastReceiver.


<service android:name=”com.parse.PushService” />

<receiver android:name=”com.parse.ParseBroadcastReceiver” >
<action android:name=”android.intent.action.BOOT_COMPLETED” />
<action android:name=”android.intent.action.USER_PRESENT” />
<receiver android:name=”” android:exported=”false”>
<action android:name=”” />
android:permission=”” >
<action android:name=”” />
<action android:name=”” />

<category android:name=”” />

If you’ve added these lines you must create a CustomNotificationReceiver. Before that you should delete this line from your app class.

PushService.setDefaultPushCallback(this, MainActivity.class, R.drawable.ic_launcher);

Your CustomNotificationReceiver should be like that

import org.json.JSONException;
import org.json.JSONObject;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

// You must change these imports to yours


public class CustomNotificationReceiver extends BroadcastReceiver {

NotificationCompat.Builder mBuilder;
Intent resultIntent;
int mNotificationId = 001;
Uri notifySound;

String alert; // This is the message string that send from push console

public void onReceive(Context context, Intent intent) {

//Get JSON data and put them into variables
try {

JSONObject json = new JSONObject(intent.getExtras().getString(

alert = json.getString(“alert”).toString();

} catch (JSONException e) {


//You can specify sound
notifySound = RingtoneManager


mBuilder = new NotificationCompat.Builder(context);
mBuilder.setSmallIcon(R.drawable.ic_launcher); //You can change your icon
mBuilder.setContentTitle(“Your notification title”);

// this is the activity that we will send the user, change this to anything you want
resultIntent = new Intent(context, MainActivity.class);

PendingIntent resultPendingIntent = PendingIntent.getActivity(context,
0, resultIntent, PendingIntent.FLAG_UPDATE_CURRENT);


NotificationManager notificationManager = (NotificationManager) context




And also you should send your notification in JSON format, not text. This is a sample of this JSON format. You can increase the strings that you send. Customize them for your usage.

“alert”: “This is your notification message”