// Path: app/src/main/java/ua/naiksoftware/j2meloader/MainActivity.java
// public class MainActivity extends AppCompatActivity {
// 
// 	private String startPath;
// 	private static final String EXTS = ".jar.zip.java";
// 	private AppsListFragment appsListFragment;
// 	private final List<AppItem> apps = new ArrayList<AppItem>();
// 
// 	/** Путь к папке со сконвертированными приложениями */
// 	private String pathConverted;
// 
// 	private JarConverter converter;
// 
// 	@Override
// 	protected void onCreate(Bundle savedInstanceState) {
// 		super.onCreate(savedInstanceState);
// 		setContentView(R.layout.activity_main);
// 
// 		startPath = Environment.getExternalStorageDirectory().getAbsolutePath();
// 
// 		pathConverted = getApplicationInfo().dataDir + "/converted/";
// 		appsListFragment = new AppsListFragment(apps);
// 		// update the main content by replacing fragments
// 		FragmentManager fragmentManager = getSupportFragmentManager();
// 		fragmentManager.beginTransaction()
// 				.replace(R.id.container, appsListFragment).commit();
// 		updateApps();
// 	}
// 
// 	@Override
// 	public boolean onCreateOptionsMenu(Menu menu) {
// 		getMenuInflater().inflate(R.menu.main, menu);
// 		return super.onCreateOptionsMenu(menu);
// 	}
// 
// 	@Override
// 	public boolean onOptionsItemSelected(MenuItem item) {
// 		int id = item.getItemId();
// 		if (id == R.id.action_settings) {
// 			return true;
// 		}
// 		return super.onOptionsItemSelected(item);
// 	}
// 
// 	public void updateApps() {
// 		apps.clear();
// 		AppItem item;
// 		String author = getString(R.string.author);
// 		String version = getString(R.string.version);
// 		String[] appFolders = new File(pathConverted).list();
// 		if (!(appFolders == null)) {
// 			for (String appFolder : appFolders) {
// 				TreeMap<String, String> params = FileUtils
// 						.loadManifest(new File(pathConverted + appFolder
// 								+ ConfScreen.MIDLET_CONF_FILE));
// 				item = new AppItem(R.drawable.app_default_icon,
// 						params.get("MIDlet-Name"), author
// 								+ params.get("MIDlet-Vendor"), version
// 								+ params.get("MIDlet-Version"));
// 				item.setPath(pathConverted + appFolder);
// 				apps.add(item);
// 			}
// 		}
// 		AppsListAdapter adapter = new AppsListAdapter(this, apps);
// 		appsListFragment.setListAdapter(adapter);
// 	}
// }
// 
// Path: app/src/main/java/filelog/Log.java
// public class Log {
// 
//     private static final String token = " : ";
//     private static final long MAX_LEN = 300 * 1024;//50 Kb
// 
//     public static void d(String tag, String message) {
//         try {
//             boolean noClear;
//             File file = new File(Environment.getExternalStorageDirectory(), "log_j2meloader.txt");
//             if (file.length() > MAX_LEN) {
//                 noClear = false;
//             } else {
//                 noClear = true;
//             }
//             FileWriter fw = new FileWriter(file, noClear);
//             String msg = "\n" + new Date().toLocaleString() + token + tag + token + message;
//             fw.write(msg);
//             fw.flush();
//             fw.close();
//             //Log.d("L", msg);
//         } catch (IOException e) {
//             android.util.Log.e("L", "err in logging", e);
//         }
//     }
// }


import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import ua.naiksoftware.j2meloader.MainActivity;
import android.content.Context;
import android.content.Intent;
import android.os.Environment;
import android.view.LayoutInflater;
import filelog.Log;

/*
 * Copyright 2012 Kulikov Dmitriy, Naik
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package javax.microedition.util;



public class ContextHolder {

	private static final String tag = "ContextHolder";


// Path: app/src/main/java/ua/naiksoftware/j2meloader/MainActivity.java
// public class MainActivity extends AppCompatActivity {
// 
// 	private String startPath;
// 	private static final String EXTS = ".jar.zip.java";
// 	private AppsListFragment appsListFragment;
// 	private final List<AppItem> apps = new ArrayList<AppItem>();
// 
// 	/** Путь к папке со сконвертированными приложениями */
// 	private String pathConverted;
// 
// 	private JarConverter converter;
// 
// 	@Override
// 	protected void onCreate(Bundle savedInstanceState) {
// 		super.onCreate(savedInstanceState);
// 		setContentView(R.layout.activity_main);
// 
// 		startPath = Environment.getExternalStorageDirectory().getAbsolutePath();
// 
// 		pathConverted = getApplicationInfo().dataDir + "/converted/";
// 		appsListFragment = new AppsListFragment(apps);
// 		// update the main content by replacing fragments
// 		FragmentManager fragmentManager = getSupportFragmentManager();
// 		fragmentManager.beginTransaction()
// 				.replace(R.id.container, appsListFragment).commit();
// 		updateApps();
// 	}
// 
// 	@Override
// 	public boolean onCreateOptionsMenu(Menu menu) {
// 		getMenuInflater().inflate(R.menu.main, menu);
// 		return super.onCreateOptionsMenu(menu);
// 	}
// 
// 	@Override
// 	public boolean onOptionsItemSelected(MenuItem item) {
// 		int id = item.getItemId();
// 		if (id == R.id.action_settings) {
// 			return true;
// 		}
// 		return super.onOptionsItemSelected(item);
// 	}
// 
// 	public void updateApps() {
// 		apps.clear();
// 		AppItem item;
// 		String author = getString(R.string.author);
// 		String version = getString(R.string.version);
// 		String[] appFolders = new File(pathConverted).list();
// 		if (!(appFolders == null)) {
// 			for (String appFolder : appFolders) {
// 				TreeMap<String, String> params = FileUtils
// 						.loadManifest(new File(pathConverted + appFolder
// 								+ ConfScreen.MIDLET_CONF_FILE));
// 				item = new AppItem(R.drawable.app_default_icon,
// 						params.get("MIDlet-Name"), author
// 								+ params.get("MIDlet-Vendor"), version
// 								+ params.get("MIDlet-Version"));
// 				item.setPath(pathConverted + appFolder);
// 				apps.add(item);
// 			}
// 		}
// 		AppsListAdapter adapter = new AppsListAdapter(this, apps);
// 		appsListFragment.setListAdapter(adapter);
// 	}
// }
// 
// Path: app/src/main/java/filelog/Log.java
// public class Log {
// 
//     private static final String token = " : ";
//     private static final long MAX_LEN = 300 * 1024;//50 Kb
// 
//     public static void d(String tag, String message) {
//         try {
//             boolean noClear;
//             File file = new File(Environment.getExternalStorageDirectory(), "log_j2meloader.txt");
//             if (file.length() > MAX_LEN) {
//                 noClear = false;
//             } else {
//                 noClear = true;
//             }
//             FileWriter fw = new FileWriter(file, noClear);
//             String msg = "\n" + new Date().toLocaleString() + token + tag + token + message;
//             fw.write(msg);
//             fw.flush();
//             fw.close();
//             //Log.d("L", msg);
//         } catch (IOException e) {
//             android.util.Log.e("L", "err in logging", e);
//         }
//     }
// }


// Path: app/src/main/java/javax/microedition/util/ContextHolder.java
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import ua.naiksoftware.j2meloader.MainActivity;
import android.content.Context;
import android.content.Intent;
import android.os.Environment;
import android.view.LayoutInflater;
import filelog.Log;

/*
 * Copyright 2012 Kulikov Dmitriy, Naik
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package javax.microedition.util;



public class ContextHolder {

	private static final String tag = "ContextHolder";


	private static MainActivity context;
