package com.paintown;

import java.io.*;
import android.content.res.AssetManager;

public class Paintown extends Activity {

    static AssetManager assetManager;
    
    protected void runCommand(String command){
        try {
            // Executes the command.
            Process process = Runtime.getRuntime().exec(command);
        } catch (IOException e) {
            throw new RuntimeException(e);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }
    
    /** Load assets. */
    @Override
    protected void onCreate(Bundle icicle) {
        
        assetManager = getAssets();
        InputStream in = assetManager.open("paintown.so");
        OutputStream out = new FileOutputStream("/data/data/paintown/com.paintown");
        byte[] buffer = new byte[1024];
        int length;
        while ((length = in.read(buffer)) > 0){
            out.write(buf, 0, len);
        }
        in.close();
        out.close();
        try {
            runCommand("/system/bin/chmod 744 /data/data/paintown/com.paintown");
            // Run paintown
            runCommand("/data/data/paintown/com.paintown");
        } catch (RuntimeException e){
        }
    }
}
@@ -34,16 +34,109 @@
 a.io.*;%0A
+import android.app.Activity;%0Aimport android.os.Bundle;%0Aimport android.content.res.Resources;%0A
 import a
@@ -299,16 +299,40 @@
 command)
+ throws RuntimeException
 %7B%0A      
@@ -533,93 +533,8 @@
   %7D 
-catch (InterruptedException e) %7B%0A            throw new RuntimeException(e);%0A        %7D
 %0A   
@@ -569,22 +569,8 @@
  */%0A
-    @Override%0A
     
@@ -615,24 +615,42 @@
  %7B%0A        %0A
+        try %7B%0A    
         asse
@@ -669,24 +669,28 @@
 etAssets();%0A
+    
         Inpu
@@ -744,16 +744,20 @@
         
+   
+ 
 OutputSt
@@ -833,16 +833,20 @@
         
+    
 byte%5B%5D b
@@ -877,16 +877,20 @@
         
+   
+ 
 int leng
@@ -893,16 +893,20 @@
 length;%0A
+    
         
@@ -953,24 +953,28 @@
             
+    
 out.write(bu
@@ -978,16 +978,19 @@
 (buf
+fer
 , 0, len
 );%0A 
@@ -985,16 +985,19 @@
 , 0, len
+gth
 );%0A     
@@ -995,26 +995,34 @@
 h);%0A        
+ 
-%7D%0A
+   %7D%0A    
         in.c
@@ -1033,24 +1033,28 @@
 ();%0A        
+ 
+   
 out.close();
@@ -1054,37 +1054,32 @@
 lose();%0A        
-try %7B
 %0A            run
@@ -1271,16 +1271,49 @@
 ion e)%7B%0A
+        %7D catch (IOException e)%7B%0A
         

Fix java compile errors.