// Path: app/src/test/java/android/util/Log.java
// public class Log {
// 	public static int d(String tag, String msg) {
// 		System.out.println("D " + tag + ": " + msg);
// 		return 0;
// 	}
// 
// 	public static int i(String tag, String msg) {
// 		System.out.println("I " + tag + ": " + msg);
// 		return 0;
// 	}
// 
// 	public static int w(String tag, String msg) {
// 		System.out.println("W " + tag + ": " + msg);
// 		return 0;
// 	}
// 
// 	public static int e(String tag, String msg) {
// 		System.out.println("E " + tag + ": " + msg);
// 		return 0;
// 	}
// }
// 
// Path: app/src/main/java/net/gaast/giggity/Db.java
// public class DbSchedule {
// 	private int id;
// 	private String url, title;
// 	private Date start, end;
// 	private String timezone;
// 	private int refresh_interval;  // Number of seconds before checking server for new schedule info.
// 	private Date atime;  // Access time, set by setSchedule above, used as sorting key in Chooser.
// 	private Date rtime;  // Refresh time, last time Fetcher claimed the server sent new data.
// 	private Date itime;  // Index time, last time it was added to the FTS index.
// 
// 	public DbSchedule(Cursor q) {
// 		id = q.getInt(q.getColumnIndexOrThrow("sch_id"));
// 		url = q.getString(q.getColumnIndexOrThrow("sch_url"));
// 		title = q.getString(q.getColumnIndexOrThrow("sch_title"));
// 		start = new Date(q.getLong(q.getColumnIndexOrThrow("sch_start")) * 1000);
// 		refresh_interval = q.getInt(q.getColumnIndexOrThrow("sch_refresh_interval"));
// 		end = new Date(q.getLong(q.getColumnIndexOrThrow("sch_end")) * 1000);
// 		timezone = q.getString(q.getColumnIndexOrThrow("sch_timezone"));
// 		atime = new Date(q.getLong(q.getColumnIndexOrThrow("sch_atime")) * 1000);
// 		rtime = new Date(q.getLong(q.getColumnIndexOrThrow("sch_rtime")) * 1000);
// 		itime = new Date(q.getLong(q.getColumnIndexOrThrow("sch_itime")) * 1000);
// 	}
// 		
// 	public String getUrl() {
// 		return url;
// 	}
// 		
// 	public String getTitle() {
// 		if (title != null)
// 			return title;
// 		else
// 			return url;
// 	}
// 		
// 	public Date getStart() {
// 		return start;
// 	}
// 		
// 	public Date getEnd() {
// 		return end;
// 	}
// 
// 	public String getTimezone() {
// 		return timezone;
// 	}
// 
// 	public Date getAtime() {
// 		return atime;
// 	}
// 
// 	public boolean refreshNow() {
// 		// TODO: Stop this and all other uses of the decrepit Date API.
// 		Date now = new Date();
// 		int interval = (refresh_interval > 0) ? refresh_interval : 86400;
// 		return now.getTime() > (rtime.getTime() + interval * 1000);
// 	}
// 
// 	public void flushHidden() {
// 		Connection db = getConnection();
// 		db.flushHidden(id);
// 	}
// }


import android.app.Activity;
import android.app.ActivityOptions;
import android.app.AlertDialog;
import android.content.ActivityNotFoundException;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.graphics.Typeface;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.preference.PreferenceManager;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import android.text.InputType;
import android.transition.Explode;
import android.util.Log;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnCreateContextMenuListener;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.AdapterView;
import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.BaseAdapter;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import net.gaast.giggity.Db.DbSchedule;
import java.util.AbstractList;
import java.util.ArrayList;
import java.util.Date;
import java.util.zip.DataFormatException;

			seedRefreshMenu = new Handler() {
				@Override
				public void handleMessage(Message msg) {
					if (msg.what == 1) {
						Editor p = pref.edit();
						p.putLong("last_menu_seed_ts", System.currentTimeMillis());
						p.commit();

						lista = new ScheduleAdapter(db.getScheduleList());
						list.setAdapter(lista);
					} else {
						// TODO: Error never gets reported because the built-in file fallback should just work.
						Toast.makeText(ChooserActivity.this,
								getResources().getString(R.string.refresh_failed),
								Toast.LENGTH_SHORT).show();
					}
					setProgressBarIndeterminateVisibility(false);
					setProgressBarVisibility(false);
					refresher.setRefreshing(false);
				}
			};

			loader = new Thread() {
				@Override
				public void run() {
					boolean ok = db.refreshScheduleList();
					if (seedRefreshMenu != null) {
						seedRefreshMenu.sendEmptyMessage(ok ? 1 : 0);
					} else {
// Path: app/src/test/java/android/util/Log.java
// public class Log {
// 	public static int d(String tag, String msg) {
// 		System.out.println("D " + tag + ": " + msg);
// 		return 0;
// 	}
// 
// 	public static int i(String tag, String msg) {
// 		System.out.println("I " + tag + ": " + msg);
// 		return 0;
// 	}
// 
// 	public static int w(String tag, String msg) {
// 		System.out.println("W " + tag + ": " + msg);
// 		return 0;
// 	}
// 
// 	public static int e(String tag, String msg) {
// 		System.out.println("E " + tag + ": " + msg);
// 		return 0;
// 	}
// }
// 
// Path: app/src/main/java/net/gaast/giggity/Db.java
// public class DbSchedule {
// 	private int id;
// 	private String url, title;
// 	private Date start, end;
// 	private String timezone;
// 	private int refresh_interval;  // Number of seconds before checking server for new schedule info.
// 	private Date atime;  // Access time, set by setSchedule above, used as sorting key in Chooser.
// 	private Date rtime;  // Refresh time, last time Fetcher claimed the server sent new data.
// 	private Date itime;  // Index time, last time it was added to the FTS index.
// 
// 	public DbSchedule(Cursor q) {
// 		id = q.getInt(q.getColumnIndexOrThrow("sch_id"));
// 		url = q.getString(q.getColumnIndexOrThrow("sch_url"));
// 		title = q.getString(q.getColumnIndexOrThrow("sch_title"));
// 		start = new Date(q.getLong(q.getColumnIndexOrThrow("sch_start")) * 1000);
// 		refresh_interval = q.getInt(q.getColumnIndexOrThrow("sch_refresh_interval"));
// 		end = new Date(q.getLong(q.getColumnIndexOrThrow("sch_end")) * 1000);
// 		timezone = q.getString(q.getColumnIndexOrThrow("sch_timezone"));
// 		atime = new Date(q.getLong(q.getColumnIndexOrThrow("sch_atime")) * 1000);
// 		rtime = new Date(q.getLong(q.getColumnIndexOrThrow("sch_rtime")) * 1000);
// 		itime = new Date(q.getLong(q.getColumnIndexOrThrow("sch_itime")) * 1000);
// 	}
// 		
// 	public String getUrl() {
// 		return url;
// 	}
// 		
// 	public String getTitle() {
// 		if (title != null)
// 			return title;
// 		else
// 			return url;
// 	}
// 		
// 	public Date getStart() {
// 		return start;
// 	}
// 		
// 	public Date getEnd() {
// 		return end;
// 	}
// 
// 	public String getTimezone() {
// 		return timezone;
// 	}
// 
// 	public Date getAtime() {
// 		return atime;
// 	}
// 
// 	public boolean refreshNow() {
// 		// TODO: Stop this and all other uses of the decrepit Date API.
// 		Date now = new Date();
// 		int interval = (refresh_interval > 0) ? refresh_interval : 86400;
// 		return now.getTime() > (rtime.getTime() + interval * 1000);
// 	}
// 
// 	public void flushHidden() {
// 		Connection db = getConnection();
// 		db.flushHidden(id);
// 	}
// }


// Path: app/src/main/java/net/gaast/giggity/ChooserActivity.java
import android.app.Activity;
import android.app.ActivityOptions;
import android.app.AlertDialog;
import android.content.ActivityNotFoundException;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.graphics.Typeface;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.preference.PreferenceManager;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import android.text.InputType;
import android.transition.Explode;
import android.util.Log;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnCreateContextMenuListener;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.AdapterView;
import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.BaseAdapter;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import net.gaast.giggity.Db.DbSchedule;
import java.util.AbstractList;
import java.util.ArrayList;
import java.util.Date;
import java.util.zip.DataFormatException;


			seedRefreshMenu = new Handler() {
				@Override
				public void handleMessage(Message msg) {
					if (msg.what == 1) {
						Editor p = pref.edit();
						p.putLong("last_menu_seed_ts", System.currentTimeMillis());
						p.commit();

						lista = new ScheduleAdapter(db.getScheduleList());
						list.setAdapter(lista);
					} else {
						// TODO: Error never gets reported because the built-in file fallback should just work.
						Toast.makeText(ChooserActivity.this,
								getResources().getString(R.string.refresh_failed),
								Toast.LENGTH_SHORT).show();
					}
					setProgressBarIndeterminateVisibility(false);
					setProgressBarVisibility(false);
					refresher.setRefreshing(false);
				}
			};

			loader = new Thread() {
				@Override
				public void run() {
					boolean ok = db.refreshScheduleList();
					if (seedRefreshMenu != null) {
						seedRefreshMenu.sendEmptyMessage(ok ? 1 : 0);
					} else {
						Log.d("Chooser", "I had a handler but you eated it");