2012-09-24

android apk files decompile / reverse engineering


- Download dex2jar tools on your computer
http://code.google.com/p/dex2jar/downloads/list
- Extract dex2jar tools
- run cmd and \dex2jar-version\dex2jar.bat yourApk.apk
- this generate yourApk.apk to yourApk.jar
- use jdgui to view the
yourApk.jar source.
http://java.decompiler.free.fr/?q=jdgui

--
Keywords: *.apk decompile, *.apk reverse engineering, dex2jar, jdgui

2012-09-19

Android Can not save APN Setting --> Fixed

Hi,

If your android telephone doesn't save the apn setting, you can follow these steps:

1. Install your phone 'Tweakker APN INTERNET MMS' on google play or open the link below
https://play.google.com/store/apps/details?id=com.tweakker
2. Select your provider and follow other steps
3. Thats all

If you backup this apn setting, you can install 'APN Backup & Restore' after this operation.
https://play.google.com/store/apps/details?id=com.riteshsahu.APNBackupRestore

No reset, no update. This instructions runs correctly on htc wildfire s (android 2.3.5).



--
Keywords: Android Can not save APN Setting, APN save problem, APN Settings Not Saving







2012-03-03

Jsf 2.0 Hello World :)

Hi, sample jsf page and codes are here :)





Notice: Default tomcat server port is 8080, but my tomcat server port is 8081.Well, your page link http://127.0.0.1:8080/02/


2012-02-26

Java - Threads


// 1. implements Runnable, 2. extend Thread, 3. extend TimerTask 
// *** A thread is born, started, runs, and then dies.

// *** this.yield() -> Causes the currently executing thread object to temporarily pause and allow other threads to execute. 
public final void setDaemon(boolean on)
public final void join(long millisec)
public void interrupt()
public final boolean isAlive()
public static void yield()
public static boolean holdsLock(Object x)

// *** Timer Task
public class GCTask extends TimerTask {
 public void run() {
  System.out.println("Running the scheduled task...");
  System.gc();
 }
}

Timer timer = new Timer();
GCTask task = new GCTask();
timer.schedule(task, 5000, 5000);

// *** Fixed-delay execution. The period is the amount of time between the ending of the previous execution and the beginning of the next execution.
// *** Fixed-rate execution. The period is the amount of time between the start-ing of the previous execution and the beginning of the next execution.

// *** Synchronized
public synchronized void deposit(double amount) {}

public void deposit(double amount) {
 synchronized (this) {
  // ....
  try {
   Thread.sleep(4000);
  } catch (InterruptedException e) {}
 }
}

// *** Deadlock issues --> Ordering Lock
// *** wait() & notify() --> The wait() and notify() methods from the Object class are useful when multiple threads need to access the same data in any type of producer/consumer scenario.

Java - Compile Time & Run Time

 

// *** instanceof keyword using
// *** Usage: reference instanceof ClassName
if(h instanceof Salary)
{
 Salary s = (Salary) h;
 s.computePay();
}

// *** Virtual Methods
public class Employee {
 //....
 public void mailCheck() {}
}

public class Salary extends Employee {
 //....
 @override
 public void mailCheck() {}
}

public class SuperDemo {
 public static void main(String[] args) {
  //...
  System.out.println("Instantiating a Salary");
  Employee s = new Salary();
  s.name = "XXX";
  s.address = "";
  
  System.out.println("*** Invoking mailCheck on s ***");
  // compile time refers to Employee Class
  // run time refers to Salary Class
  s.mailCheck();
 }
}

Java - Getting Started

 

// *** Both object and object2 refer to this one object!
SampleObject object = new SampleObject();
SampleObject object2 = object;


// object.getSampleName doesn't change!
SampleUtil.tryReferanceData(object.getSampleName);

public class SampleUtil{
 
 public static void tryReferanceData(String inputy) {
  inputy = "tryReferanceData";
 }
}


// method parameters & fields...
public void setCurrency(Double currency)
{
 // The parameter visitor is the same name as the field visitor. 
 currency = currency;  
 // correct this
 this.currency = currency;
}


// *** the java naming convention recommends package names be all lovercase
// *** prodected access can seem child class or  other class in the same package.
// *** A static fiels or method can be accessed without any instances of the class existing.
// *** Created objects' static fields reference only one memory location.
public class Employee {
 public String name;
 public static int moneyAmount; // Created all objects reference this static fields!
 //.....
 public static int getMoneyAmount() {
  return moneyAmount;
 }
}

// *** the java naming convention recommends package names be all lovercase
// *** prodected access can seem child class or  other class in the same package.
// *** A static fiels or method can be accessed without any instances of the class existing.
// *** Created objects' static fields reference only one memory location.
public class Employee {
 public String name;
 public static int moneyAmount; // Created all objects reference this static fields!
 //.....
 public static int getMoneyAmount() {
  return moneyAmount;
 }
}

2012-02-09

ORA-12154 Toad Plsql Developer

If ORA-12154 error occurs when a user attempts to logon to an Oracle Database with Toad/Plsql Dev/etc app. on your 64bit win machine, you can adjust this error.

C:\Program Files (x86)\PLSQL Developer copy to C:\Program Files\PLSQL Developer
C:\Program Files (x86)\XXXAPP  copy to C:\Program Files\XXXAPP

ORA-12154: TNS:could not resolve the connect identifier

2010-09-05

log4j sample - 01

log4j ile basit bir uygulama yapalım.
Bu uygulama da BasicConfigurator.configure(); metodunu kullandık ve böylece log4j.properties dosyasına gereksinimiz kalmadı.

 import org.apache.log4j.BasicConfigurator;  
 import org.apache.log4j.Level;  
 import org.apache.log4j.Logger;  
 import org.apache.log4j.Priority;  
 /**  
  *   
  * @author K_Goksu --> http://www.kasimgoksu.com  
  *   
  */  
 public class MySampleApp {  
      static Logger logger = Logger.getLogger(MySampleApp.class);  
      @SuppressWarnings("unchecked")   
      public static void main(String[] args) {  
           // load default configure, don't need log4j.properties file!  
           BasicConfigurator.configure();  
           //           # Set root logger level to DEBUG and its only appender to A1.  
           //           log4j.rootLogger=DEBUG, A1  
           //  
           //           # A1 is set to be a ConsoleAppender.  
           //           log4j.appender.A1=org.apache.log4j.ConsoleAppender  
           //  
           //           # A1 uses PatternLayout.  
           //           log4j.appender.A1.layout=org.apache.log4j.PatternLayout  
           //           log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n  
           logger.info("### Log4j sample :))) ###\n");  
           Priority[] allPossiblePriorities = Level.getAllPossiblePriorities();  
           for (int i = 0; i < allPossiblePriorities.length; i++) {  
                //TRACE < DEBUG < INFO < WARN < ERROR < FATAL  
                logger.setLevel((Level) allPossiblePriorities[i]);  
                System.out.println("### Level priorty is now " + allPossiblePriorities[i]);  
                logger.debug("DEBUG");  
                logger.info("INFO");  
                logger.warn("WARN");  
                logger.error("ERROR");  
                logger.fatal("FATAL");  
                System.out.println("\n\n");  
           }  
      }  
 }  

Kaynak koda buradan ulaşabilirsiniz.