diff --git a/mobile/.idea/copyright/profiles_settings.xml b/mobile/.idea/copyright/profiles_settings.xml index 3572571a..e7bedf33 100644 --- a/mobile/.idea/copyright/profiles_settings.xml +++ b/mobile/.idea/copyright/profiles_settings.xml @@ -1,5 +1,3 @@ - - - + \ No newline at end of file diff --git a/mobile/HACKING.md b/mobile/HACKING.md index 403fc7f3..e1f5a146 100644 --- a/mobile/HACKING.md +++ b/mobile/HACKING.md @@ -1,9 +1,8 @@ How does this basically work? ----------------------------- -At the moment, the Android App is a WebView which renders the normal web page. The IITC script is injected by calling ```iitc_view.loadIITC_JS(Context)```. The app uses a local version of the script, which is located in the assets folder, if no external source is given (see "pref\_iitc\_source"). - -Communication from app to script is handled by loading Javascript function calls. For example: ```iitc_view.loadUrl("javascript: window.goBack();");``` +At the moment, the Android App is a WebView which renders the normal web page. The IITC script is injected by calling ```iitc_view.loadIITC_JS(Context)```. The app uses a local version of the script, which is located in the assets folder. +Communication from app to script is handled by loading Javascript function calls. For example: ```iitc_view.loadUrl("javascript: window.alert('foo');");``` Communication from script to app is handled by the JavascriptInterface (see /mobile/src/com/cradle/iitc\_mobile/IITC_JSInterface.java). If a method ```foo(String)``` is defined in JSInterface, it can be called by ```android.foo("Hello World")``` in the IITC script. diff --git a/mobile/README.md b/mobile/README.md index 6d4b7e21..136db28e 100644 --- a/mobile/README.md +++ b/mobile/README.md @@ -1,11 +1,13 @@ -ingress intel total conversion mobile (IITCM) +ingress intel total conversion mobile (IITCm) ===================================== The Android App behaves like the desktop version, but uses the mobile view, which is optimized for mobile devices, as default. Furthermore, there are some nice additions: - it should be much faster than the standard mobile ingress intel map -- plugin support +- supports all official IITC plugins + +- easy installation of unofficial plugins (installation via plugin preference, click on *.user.js file or URL, email attachement etc.) - show users current location @@ -13,17 +15,13 @@ The Android App behaves like the desktop version, but uses the mobile view, whic - a geolocate button (you have to enable GPS satellites + location access to use this feature) -- possibility to use a custom IITC script source - -- a click on Portal link copies it to clipboard - -- in-app layer chooser - -- in-app IITC buttons - - in-app search -- support for unofficial plugins. Just copy the *.user.js files to ```/IITC_Mobile/plugins/``` and they should appear at the top of the plugin list. Note: For every option a new persistent database entry is created. If you want to remove a plugin from your external storage you want to ensure that it is disabled in the settings, otherwise IITCM will always try to load it on start-up. If you messed this up you can wipe app data or add the plugin back to storage, disable it and remove it. Another option would be: Do nothing...it should work even so. +- configurable fullscreen modes (includes immersive mode on Android 4.4+) + +- navigation drawers for IITC views, layer chooser and highlighters + +- in-app screenshots - developer mode: all script source will be loaded from ```/IITC_Mobile/dev/``` diff --git a/mobile/src/com/cradle/iitc_mobile/IITC_WebViewClient.java b/mobile/src/com/cradle/iitc_mobile/IITC_WebViewClient.java index d9e27563..84886807 100644 --- a/mobile/src/com/cradle/iitc_mobile/IITC_WebViewClient.java +++ b/mobile/src/com/cradle/iitc_mobile/IITC_WebViewClient.java @@ -16,6 +16,7 @@ import java.io.ByteArrayInputStream; import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.TreeMap; public class IITC_WebViewClient extends WebViewClient { @@ -57,11 +58,9 @@ public class IITC_WebViewClient extends WebViewClient { private void loadScripts(final IITC_WebView view) { final List scripts = new LinkedList(); - scripts.add("script" + DOMAIN + "/total-conversion-build.user.js"); - // get the plugin preferences final SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(mIitc); - final Map all_prefs = sharedPref.getAll(); + final TreeMap all_prefs = new TreeMap(sharedPref.getAll()); // iterate through all plugins for (final Map.Entry entry : all_prefs.entrySet()) { @@ -80,6 +79,8 @@ public class IITC_WebViewClient extends WebViewClient { scripts.add("script" + DOMAIN + "/user-location.user.js"); } + scripts.add("script" + DOMAIN + "/total-conversion-build.user.js"); + final String js = "(function(){['" + TextUtils.join("','", scripts) + "'].forEach(function(src) {" + "var script = document.createElement('script');script.src = '//'+src;" + "(document.body || document.head || document.documentElement).appendChild(script);" +