diff --git a/.gitignore b/.gitignore
index 6a70ed57..7f654c5b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
iitc-debug.user.js
+mobile/IngressIntelTC/bin
diff --git a/mobile/IngressIntelTC/.classpath b/mobile/IngressIntelTC/.classpath
new file mode 100644
index 00000000..a4f1e405
--- /dev/null
+++ b/mobile/IngressIntelTC/.classpath
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/mobile/IngressIntelTC/.project b/mobile/IngressIntelTC/.project
new file mode 100644
index 00000000..25a5ec79
--- /dev/null
+++ b/mobile/IngressIntelTC/.project
@@ -0,0 +1,33 @@
+
+
+ AppTemplate
+
+
+
+
+
+ com.android.ide.eclipse.adt.ResourceManagerBuilder
+
+
+
+
+ com.android.ide.eclipse.adt.PreCompilerBuilder
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ com.android.ide.eclipse.adt.ApkBuilder
+
+
+
+
+
+ com.android.ide.eclipse.adt.AndroidNature
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/mobile/IngressIntelTC/AndroidManifest.xml b/mobile/IngressIntelTC/AndroidManifest.xml
new file mode 100644
index 00000000..dbf96330
--- /dev/null
+++ b/mobile/IngressIntelTC/AndroidManifest.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/mobile/IngressIntelTC/assets/js/ingressSplash.html b/mobile/IngressIntelTC/assets/js/ingressSplash.html
new file mode 100644
index 00000000..620be905
--- /dev/null
+++ b/mobile/IngressIntelTC/assets/js/ingressSplash.html
@@ -0,0 +1,90 @@
+
+
+
+ Ingress Intel Total Converion - Mobile & Tablet
+
+
+
+
+ Ingress Intel Total Conversion
+
loading...
+
+ Disclaimer: Ingress Intel Total Conversion is in no way affiliated with, connected to, or sanctioned by Ingress, Google or Niantic.
+ Full source for Ingress Intel Total Conversion can be found @
https://github.com/breunigs/ingress-intel-total-conversion
+ Source for this wrapper app available soon.
+
+
+
+
diff --git a/mobile/IngressIntelTC/gen/com/jakbox/ingressTC/BuildConfig.java b/mobile/IngressIntelTC/gen/com/jakbox/ingressTC/BuildConfig.java
new file mode 100644
index 00000000..c53b896c
--- /dev/null
+++ b/mobile/IngressIntelTC/gen/com/jakbox/ingressTC/BuildConfig.java
@@ -0,0 +1,6 @@
+/** Automatically generated file. DO NOT MODIFY */
+package com.jakbox.ingressTC;
+
+public final class BuildConfig {
+ public final static boolean DEBUG = true;
+}
\ No newline at end of file
diff --git a/mobile/IngressIntelTC/gen/com/jakbox/ingressTC/R.java b/mobile/IngressIntelTC/gen/com/jakbox/ingressTC/R.java
new file mode 100644
index 00000000..162c7876
--- /dev/null
+++ b/mobile/IngressIntelTC/gen/com/jakbox/ingressTC/R.java
@@ -0,0 +1,27 @@
+/* AUTO-GENERATED FILE. DO NOT MODIFY.
+ *
+ * This class was automatically generated by the
+ * aapt tool from the resource data it found. It
+ * should not be modified by hand.
+ */
+
+package com.jakbox.ingressTC;
+
+public final class R {
+ public static final class attr {
+ }
+ public static final class drawable {
+ public static final int ic_launcher=0x7f020000;
+ }
+ public static final class layout {
+ public static final int main=0x7f030000;
+ }
+ public static final class raw {
+ public static final int loader=0x7f040000;
+ }
+ public static final class string {
+ public static final int app_name=0x7f050000;
+ public static final int first_page=0x7f050001;
+ public static final int jakboxBootLoader=0x7f050002;
+ }
+}
diff --git a/mobile/IngressIntelTC/proguard.cfg b/mobile/IngressIntelTC/proguard.cfg
new file mode 100644
index 00000000..b1cdf17b
--- /dev/null
+++ b/mobile/IngressIntelTC/proguard.cfg
@@ -0,0 +1,40 @@
+-optimizationpasses 5
+-dontusemixedcaseclassnames
+-dontskipnonpubliclibraryclasses
+-dontpreverify
+-verbose
+-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
+
+-keep public class * extends android.app.Activity
+-keep public class * extends android.app.Application
+-keep public class * extends android.app.Service
+-keep public class * extends android.content.BroadcastReceiver
+-keep public class * extends android.content.ContentProvider
+-keep public class * extends android.app.backup.BackupAgentHelper
+-keep public class * extends android.preference.Preference
+-keep public class com.android.vending.licensing.ILicensingService
+
+-keepclasseswithmembernames class * {
+ native ;
+}
+
+-keepclasseswithmembers class * {
+ public (android.content.Context, android.util.AttributeSet);
+}
+
+-keepclasseswithmembers class * {
+ public (android.content.Context, android.util.AttributeSet, int);
+}
+
+-keepclassmembers class * extends android.app.Activity {
+ public void *(android.view.View);
+}
+
+-keepclassmembers enum * {
+ public static **[] values();
+ public static ** valueOf(java.lang.String);
+}
+
+-keep class * implements android.os.Parcelable {
+ public static final android.os.Parcelable$Creator *;
+}
diff --git a/mobile/IngressIntelTC/project.properties b/mobile/IngressIntelTC/project.properties
new file mode 100644
index 00000000..f049142c
--- /dev/null
+++ b/mobile/IngressIntelTC/project.properties
@@ -0,0 +1,11 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system use,
+# "ant.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-10
diff --git a/mobile/IngressIntelTC/res/drawable-hdpi/ic_launcher.png b/mobile/IngressIntelTC/res/drawable-hdpi/ic_launcher.png
new file mode 100644
index 00000000..55c83277
Binary files /dev/null and b/mobile/IngressIntelTC/res/drawable-hdpi/ic_launcher.png differ
diff --git a/mobile/IngressIntelTC/res/drawable-ldpi/ic_launcher.png b/mobile/IngressIntelTC/res/drawable-ldpi/ic_launcher.png
new file mode 100644
index 00000000..b06e1f85
Binary files /dev/null and b/mobile/IngressIntelTC/res/drawable-ldpi/ic_launcher.png differ
diff --git a/mobile/IngressIntelTC/res/drawable-mdpi/ic_launcher.png b/mobile/IngressIntelTC/res/drawable-mdpi/ic_launcher.png
new file mode 100644
index 00000000..f9b7522d
Binary files /dev/null and b/mobile/IngressIntelTC/res/drawable-mdpi/ic_launcher.png differ
diff --git a/mobile/IngressIntelTC/res/layout/main.xml b/mobile/IngressIntelTC/res/layout/main.xml
new file mode 100644
index 00000000..e33294fb
--- /dev/null
+++ b/mobile/IngressIntelTC/res/layout/main.xml
@@ -0,0 +1,10 @@
+
+
+
+
diff --git a/mobile/IngressIntelTC/res/raw/loader.js b/mobile/IngressIntelTC/res/raw/loader.js
new file mode 100644
index 00000000..bcb336ca
--- /dev/null
+++ b/mobile/IngressIntelTC/res/raw/loader.js
@@ -0,0 +1,13 @@
+function rebuildUI() {
+ if(window.UIDone == true) { return; }
+ if(!document.getElementById("map_canvas")) {
+ setTimeout(rebuildUI, 50);
+ return;
+ } else {
+ window.UIDone = true;
+ }
+ window.console.log(window.deviceID);
+ window.loadJS("http://mathphys.fsk.uni-heidelberg.de:8000/test.js")
+ //window.Android.TCReady();
+}
+rebuildUI();
\ No newline at end of file
diff --git a/mobile/IngressIntelTC/res/values/strings.xml b/mobile/IngressIntelTC/res/values/strings.xml
new file mode 100644
index 00000000..cd948842
--- /dev/null
+++ b/mobile/IngressIntelTC/res/values/strings.xml
@@ -0,0 +1,17 @@
+
+
+ Ingress Intel Total Conversion
+ Connecting to Ingress Intel Map ...
+
+ bootLoader = function() {
+ if(document.getElementById(\"map_canvas\")) {
+ window.stop();
+ document.body.innerHTML = "";
+ } else {
+ setTimeout(bootLoader, 50);
+ }
+ };
+ setTimeout(bootLoader, 5);
+
+
+
diff --git a/mobile/IngressIntelTC/src/com/jakbox/ingressTC/MainActivity.java b/mobile/IngressIntelTC/src/com/jakbox/ingressTC/MainActivity.java
new file mode 100644
index 00000000..e98f3404
--- /dev/null
+++ b/mobile/IngressIntelTC/src/com/jakbox/ingressTC/MainActivity.java
@@ -0,0 +1,149 @@
+/********************************************************************************
+ Ingress Intel Total Converion - Mobile & Tablet
+ Android WebView wrapper/loader for iitc (ingress intel total conversion)
+ iitc source @ https://github.com/breunigs/ingress-intel-total-conversion
+
+ Original Author: Jason Grima - jason@jakbox.net
+*********************************************************************************/
+
+
+package com.jakbox.ingressTC;
+
+import android.app.*;
+import android.os.*;
+import android.content.Context;
+import android.view.*;
+import android.widget.*;
+import android.webkit.*;
+import android.provider.Settings.Secure;
+import android.util.Log;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.BufferedReader;
+import java.lang.StringBuffer;
+
+public class MainActivity extends Activity
+{
+ WebView web; // webview to hold the ingress site (and login etc)
+ WebView splash; // splash screen, just a bit of pretty
+ MyChrome chrome; // for logging, progress, etc
+ MyClient client; // for controlling the webview's
+
+ /** Called when the activity is first created. */
+ @Override
+ public void onCreate(Bundle savedInstanceState)
+ {
+ requestWindowFeature(Window.FEATURE_NO_TITLE); // hide the app title bar, Xeen requested
+ super.onCreate(savedInstanceState);
+
+ // little animated title/splash page for IngressIntelTC
+ // separate webview so we can be loading stuff in the background
+ JSInterface js = new JSInterface(this, this); //js.setActivity(this);
+ this.splash = new WebView(this);
+ splash.getSettings().setJavaScriptEnabled(true); // because we use JS to trigger the CSS animation
+ splash.getSettings().setAllowFileAccess(true); // because the splash page is store in the apk
+ splash.getSettings().setAllowFileAccessFromFileURLs(true); // in case we add more scripts/images to the splash page
+ splash.loadUrl("file:///android_asset/js/ingressSplash.html"); // there is is!
+ splash.addJavascriptInterface(js, "android");
+ setContentView(splash);
+ // righto, load the the website (ingress.com/intel) with a bunch of permissions that may/or not be needed
+ this.web = new WebView(this);
+ this.client = new MyClient();
+ web.setWebViewClient(this.client);
+ web.getSettings().setJavaScriptEnabled(true);
+ web.getSettings().setGeolocationEnabled(true);
+ web.getSettings().setAllowFileAccess(true);
+ web.getSettings().setAllowFileAccessFromFileURLs(true);
+ web.getSettings().setDatabaseEnabled(true);
+ web.getSettings().setDomStorageEnabled(true);
+ web.getSettings().setGeolocationEnabled(true);
+
+ this.chrome = new MyChrome(); // the chrome let's us get console and progress feedback from the page
+ web.setWebChromeClient(this.chrome);
+ web.addJavascriptInterface(js, "android"); // ready to go
+
+ }
+
+ public void onRestoreInstanceState(Bundle state) {
+ this.splash.restoreState(state);
+ this.web.restoreState(state);
+ }
+ public void onSaveInstanceState(Bundle state) {
+ this.splash.saveState(state);
+ this.web.saveState(state);
+ }
+
+ public void showWeb() { setContentView(web); splash.destroy(); Log.d("com.jakbox.ingressTC", "Flipping to web/ingress view"); }
+ public void showSplash() { setContentView(splash); web.destroy(); Log.d("com.jakbox.ingressTC", "Flipping to splash/loading"); }
+
+ final class JSInterface {
+ Context context; MainActivity act;
+ public JSInterface (Context c, MainActivity a) { this.context = c; this.act = a; }
+ public void setActivity(MainActivity a) { this.act = a; }
+ // the @JavascriptInterface is needed for 4.2 devices to access this
+ @JavascriptInterface
+ public void pageReady(int ready) {
+ if(ready != 0) {
+ // the loader reports we're good to go, switch to ingress webview
+ this.act.runOnUiThread(new Runnable() {
+ public void run() { showWeb(); }
+ });
+ } else {
+ // the loader reports we're not ready, switch to splash page
+ this.act.runOnUiThread(new Runnable() {
+ public void run() { showSplash(); }
+ });
+ }
+ }
+ @JavascriptInterface
+ public void loadBehind(final String url) {
+ this.act.runOnUiThread(new Runnable() {
+ public void run() {
+ Log.d("com.jakbox.ingressTC", "Loading (Ingress?) website in back webview");
+ web.loadUrl(url); /* push the url to the webview */ }
+ });
+ }
+ }
+
+ private class MyClient extends WebViewClient {
+ @Override
+ public boolean shouldOverrideUrlLoading(WebView web, String Url) {
+ return false;
+ }
+
+ @Override
+ public void onPageFinished(WebView web, String Url) {
+ // here we conditionally load some external javascript
+ Log.d("com.jakbox.ingressTC", "Page loading, injecting IITC JS");
+ if(web.getUrl().contains("ingress.com/intel")) {
+ // if NOT ingress, we may have been redirected to the google auth/login page
+ web.loadUrl("javascript: window.stop(); ");
+ // first stop the page from loading too much
+ web.loadUrl("javascript: window.deviceID='"+Secure.getString(getContentResolver(), Secure.ANDROID_ID)+"'; ");
+ // create a JS loader on the page
+ web.loadUrl("javascript: if(!window.loadJS) { window.loadJS = function(scr) { var s = document.createElement('script'); s.src = scr+(scr.indexOf('file:///')==-1?'?ts="+System.currentTimeMillis()+"':''); s.type = 'text/javascript'; s.async = true; var st = document.getElementsByTagName('script')[0]; st.parentNode.insertBefore(s, st); } };");
+ // actually hijack the page... if it's the right page... let the loader deal with that
+ // should pull this loader into a local resource, maybe...
+ // running it from the web for now ...
+ web.loadUrl("javascript: if(!window.hijacked) { window.loadJS('http://mathphys.fsk.uni-heidelberg.de:8000/bootstrap.js'); window.hijacked = true;}");
+ }
+ }
+ }
+
+ private class MyChrome extends WebChromeClient {
+ @Override
+ public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) {
+ // Always grant permission since the app itself requires location
+ // permission and the user has therefore already granted it
+ callback.invoke(origin, true, false);
+ }
+
+ public boolean onConsoleMessage(ConsoleMessage cm) {
+ // log window.console stuff into the syslog for ADB output
+ Log.d("com.jakbox.ingressTC", cm.message() + " -- "
+ + (cm.sourceId()==null?"main document":cm.sourceId())
+ + ":Line " + cm.lineNumber() );
+ return true;
+ }
+ }
+}
diff --git a/mobile/README.md b/mobile/README.md
new file mode 100644
index 00000000..afaf07e9
--- /dev/null
+++ b/mobile/README.md
@@ -0,0 +1,75 @@
+IITC Mobile (IITCM)
+===================
+
+```
+# # ####### ####### ###### ####### # ###### # #
+## # # # # # # # # # # # # #
+# # # # # # # # # # # # # # #
+# # # # # # ###### ##### # # # # #
+# # # # # # # # # ####### # # #
+# ## # # # # # # # # # # #
+# # ####### # # # ####### # # ###### #
+```
+
+- This is **alpha quality** software
+- There are more bugs than in all Indiana Jones titles combined
+- It will kill your data plan. Caching has been explicitly disabled for testing, so every restart nets you ~500 KiB of code. Since it uses raster maps instead of vector ones, the transfer volume is larger than for Google Maps, too.
+
+
+### read this guide thoroughly.
+
+How to report bugs
+------------------
+
+Be sure to [read the normal guide on how to report bugs](https://github.com/breunigs/ingress-intel-total-conversion/blob/gh-pages/HACKING.md#how-do-i-report-bugs). In addition, provide these details:
+- Android version
+- device used (exact name)
+- screen size in pixels
+
+**I will close all bug reports without this information without comment.** Gather all information, then make a new issue. It seems you can’t reopen a ticket if I close it, so this is necessary unfortunately.
+
+
+Can I share this?
+-----------------
+
+You may, but only with technically skilled friends. If you do please point them to this page only. Reading these guides ensures only high quality bug reports are made which speeds up development. This is in everyone’s interest, as the time spent on working on bogus reports is not spent on improvements.
+
+Once the app is ready for a broader audience, this will be made easier. For now it should only be used by developers who can help or send in improvements.
+
+
+How do I…?
+----------
+
+- **Login:** on tablets, this should just work. On smartphones you’ll see a black screen with some blue lines. This is the normal Ingress login page and you need to scroll to see the login button.
+- **Clear Data/Cache:** Open app launcher and find the IITCM icon. Press-and-hold and then drag it to “App Info” on the top right of the screen. There’s a “clear data” and “clear cache” button.
+- **Logout:** Not possible from within the app. See *Clear Data/Cache* and use “clear data”.
+- **Reload:** Not possible from within the app. Instead, open your recent applications and force close IITCM. It should reload after restarting.
+- **“Your account has not been enabled to play Ingress“**: See *Reload*.
+- **Install:** You can find this out yourself. If you don’t know how, then please wait for a more polished version of IITCM.
+- **Update:** You can check if there’s a new APK build by looking at the [apk_version](https://github.com/breunigs/ingress-intel-total-conversion/raw/gh-pages/mobile/apk_version file)[.](https://mathphys.fsk.uni-heidelberg.de/~stefan/test/IngressIntelTC.apk) It contains the date of the last update. The app uses the latest IITC hourly build automatically. You may need to clear your cache to force a reload, see *Clear Data/Cache*. Also note that the dot after “apk_version” is the download link to the APK.
+
+How does this basically work?
+-----------------------------
+
+The Android App uses a WebView to render the normal web page. Some code is required to make this work like one would expect, but in a nutshell this is a webbrowser without URL bar. On page load, the app injects `bootstrap.js` which is a specialized loader. While it has some additional checks to make the boot process nicer on slower mobile phones but is mainly required to load vanilla IITC. It’s not possible to load IITC directly due to contraints defined by the injection method. After IITC is injected, it works the same way as on desktop browsers. Tablets are served the desktop version and apart from larger portals there is no change to the GUI. Smartphones execute the code in `code/smartphone.js` and load `smartphone.css`. This is required because their display is too small for the desktop version.
+
+Debugging
+---------
+
+If you want to debug the APK, I suggest [reading up on Google’s documentation](https://developer.android.com/index.html).
+
+Debugging IITC(M) **after** it has booted is relatively easy: you can switch to the “debug” tab, which is a low end developer console. It renders all calls to `console.*`, so you can use it just like you expect. It may be easier to develop in a desktop browser. Set it up like explained [in the normal hacking guide](https://github.com/breunigs/ingress-intel-total-conversion/blob/gh-pages/HACKING.md), but fake your user agent or modify the detection in `code/smartphone.js` and `main.js`. You don’t need to rebuild the APK to point it to your `iitc-test.user.js` file. Instead, modify `mobile/bootstrap.js` and add yourself with device ID and URL, then [send in a pull request](https://github.com/breunigs/ingress-intel-total-conversion/blob/gh-pages/HACKING.md#sending-patches). The device ID is printed to the debug console on IITC boot.
+
+Debugging IITC(M) **before** it has booted requires the Android Developer Tools. Connecting your device and running `adb logcat` should print the debug log to your computer until the low-end dev console mentioned above is available. You may need to root your device.
+
+
+Building the APK
+----------------
+
+No idea. Please write docs and send patches.
+
+
+Download APK
+------------
+
+Well, glad you read to the end. Enjoy and send patches, bug reports, postcards and love. (If you are wondering where the download link is, I’m wondering if you have actually read the page.)
diff --git a/mobile/apk_version b/mobile/apk_version
new file mode 100644
index 00000000..1a9fd432
--- /dev/null
+++ b/mobile/apk_version
@@ -0,0 +1 @@
+0.1-2013-02-23