Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts

Saturday, July 19, 2014

How to use the same C++ code for Android and iOS?

Best tutorial on using C++ code with iOS and Android

Please read this wonderful StackOverflow post:

Tuesday, July 3, 2012

How to install Eclipse on Ubuntu

How to install Eclipse

Open your terminal:

sudo apt-get install eclipse

This is will install the stable version from the repositories.

How to switch your Java version on Ubuntu

How to easily change your Java version

This is how you can get the versions you are using now:

java -version
javac -version
javaws -version

Easily change which Java installation you would like to use:

sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo update-alternatives --config javaws

If you have installed this repository:

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update

You can install a graphical version to easily change your Java version:

sudo apt-get install update-java
sudo update-java

How to install Java 7 on Ubuntu

How to install Java 7 - fastest way
Add this repository:

sudo add-apt-repository ppa:webupd8team/java

Update your package list:

sudo apt-get update

Add this, in case you don't have it:

sudo mkdir -p /usr/lib/mozilla/plugins

Finally install Java 7:

sudo apt-get install oracle-jdk7-installer

Tuesday, May 8, 2012

How to Reverse Engineer Android Malware

Reverse Engineer Android Malware

Tools you may need for decompiling Android malware:

apktool – a tool used for manipulating .apk files
jad – a Java decompiler (Windows only)
JD-Core + JD-GUI – another Java decompiler, supporting newer Java versions and features
dex2jar – a tool for converting .dex files to .class files
   Download: (dex2jar)
apkinspector - all in one tool

However, this tutorial is fairly easy and simple and I will only be using dex2jar and jd-gui. This tutorial is a standard for all apps. You can use the same tools and methods to help decompile your applications and other applications, especially malware, in order to see and understand what the code is actually doing.

So, say we have our malicious malware such as "file.apk".

A lot of these tools can be used in Windows as well as Linux, however I happen to be using Windows for this tutorial.
For Linux: sh file.apk
For Windows: dex2jar.bat file.apk

This will create the file called file_dex2jar.jar. Now we can easily view our app's code with jd-gui.
Simply just click on the jd-gui and open the file_dex2jar.jar.

 Now we can easily read and see the code.

Further Research/Advanced Topics:

  • Code Obfuscation 
  • Decompiling Manifest Files
  • Obtaining the Resources - images, etc.

For Related Articles:

Thursday, September 1, 2011

Android - FREE Samples

Free Code and Projects
I used Google to find these, very helpful for learning new layouts and different android features.


Blogspot(Google Blogs)

Google Code



Monday, May 30, 2011

HelloWorld in Java

For a pure Java HelloWorld:

public class HelloWorld {
 public static void main(String[] args) {


java HelloWorld

HelloWorld in Android

1) Download Eclipse IDE:
2) Download Android SDK for Eclipse:
-Installing Setup:
3) Beginning Tutorial:
location: HelloWorld > src > com.HelloWord >
package com.HelloWorld;

import android.os.Bundle;

public class Hello extends Activity {
    /** Called when the activity is first created. */
    public void onCreate(Bundle savedInstanceState) {



location: HelloWorld > res > layout > main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android=""


location: HelloWorld > res > values > strings.xml
<?xml version="1.0" encoding="utf-8"?>
    <string name="hello">Hello World, Hello!</string>
    <string name="app_name">HelloWorld</string>


location: HelloWorld > AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=""
    <uses-sdk android:minSdkVersion="3" />

    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".Hello"
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />


Notice: "System.out.println("HelloWorld!");" is not being used because "HelloWorld" is a string pulled from "strings.xml" which is used in the "main.xml"