diff --git a/build.py b/build.py
index 55ac2f0a..055c2ef8 100755
--- a/build.py
+++ b/build.py
@@ -220,7 +220,7 @@ if buildMobile:
os.makedirs("mobile/assets")
except:
pass
- shutil.copy(os.path.join(outDir,"total-conversion-build.user.js"), "mobile/assets/iitc.js")
+ shutil.copy(os.path.join(outDir,"total-conversion-build.user.js"), "mobile/assets/total-conversion-build.user.js")
# copy the user location script into the mobile folder.
shutil.copy(os.path.join(outDir,"user-location.user.js"), "mobile/assets/user-location.user.js")
diff --git a/mobile/HACKING.md b/mobile/HACKING.md
index 76d8d54e..a3250ddb 100644
--- a/mobile/HACKING.md
+++ b/mobile/HACKING.md
@@ -7,6 +7,11 @@ Communication from app to script is handled by loading Javascript function calls
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.
+Developing IITC and Plugins for IITC Mobile
+-------------------------------------------
+
+The developer mode can be enabled in the settings. Create a folder ```IITC_Mobile/dev/``` on your external storage of your Android device and copy the sources from ```$IITC_folder/build/mobile/``` to it. If the developer mode is enabled all sources will be loaded from there.
+
Debugging
---------
diff --git a/mobile/README.md b/mobile/README.md
index 24bed1fc..074034ff 100644
--- a/mobile/README.md
+++ b/mobile/README.md
@@ -5,7 +5,9 @@ The Android App behaves like the desktop version, but uses the mobile view, whic
- it should be much faster than the standard mobile ingress intel map
-- a gmaps intent is sent, when a portals Map link is clicked (lets you navigate to portals)
+- plugin support
+
+- a geo intent is sent, when a portals Map link is clicked (lets you navigate to portals)
- a geolocate button (you have to enable GPS satellites + location access to use this feature)
diff --git a/mobile/res/values/strings.xml b/mobile/res/values/strings.xml
index 42e7f276..26a51274 100644
--- a/mobile/res/values/strings.xml
+++ b/mobile/res/values/strings.xml
@@ -25,13 +25,12 @@
is continued on a fork of jonatkins.
Website:
http://iitc.jonatkins.com/
- Fork github:
- https://github.com/jonatkins/ingress-intel-total-conversion
- Old github:
- https://github.com/breunigs/ingress-intel-total-conversion]]>
+ IITC on Github:
+ https://github.com/jonatkins/ingress-intel-total-conversion]]>
UI
+ Misc
Plugins
Available plugins
Force desktop mode
@@ -39,6 +38,9 @@
Display user location
Show users position on map
Developer options
+ Enable developer mode
+ If enabled, all IITC sources will be loaded from external storage of the Android device.
+ Please copy all sources from $IITC_folder/build/mobile/ to /sdcard/IITC_Mobile/dev/.
IITC source
\ No newline at end of file
diff --git a/mobile/res/xml/preferences.xml b/mobile/res/xml/preferences.xml
index e485de40..432b0eab 100644
--- a/mobile/res/xml/preferences.xml
+++ b/mobile/res/xml/preferences.xml
@@ -12,31 +12,41 @@
-
-
-
+
+
+
+
+
+
+
-
+
plugin_list = sharedPref.getStringSet("pref_plugins", null);
+ boolean dev_enabled = sharedPref.getBoolean("pref_dev_checkbox", true);
// iterate through all enabled plugins and load them
if (plugin_list != null) {
@@ -114,7 +141,14 @@ public class IITC_WebViewClient extends WebViewClient {
Scanner s = null;
String src = "";
try {
- s = new Scanner(am.open("plugins/" + plugin_array[i])).useDelimiter("\\A");
+ // load plugins from external storage if dev mode are enabled
+ if (dev_enabled) {
+ File js_file = new File(dev_path + "plugins/" + plugin_array[i]);
+ s = new Scanner(js_file).useDelimiter("\\A");
+ }
+ else
+ // load plugins from asset folder
+ s = new Scanner(am.open("plugins/" + plugin_array[i])).useDelimiter("\\A");
} catch (IOException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
@@ -127,16 +161,23 @@ public class IITC_WebViewClient extends WebViewClient {
// inject the user location script if enabled in settings
if (sharedPref.getBoolean("pref_user_loc", false))
- enableTracking(view);
+ enableTracking(view, dev_enabled);
}
- public void enableTracking(WebView view) {
+ public void enableTracking(WebView view, boolean dev_enabled) {
Log.d("iitcm", "enable tracking...");
AssetManager am = context.getAssets();
Scanner s = null;
String src = "";
try {
- s = new Scanner(am.open("user-location.user.js")).useDelimiter("\\A");
+ // load plugin from external storage if dev mode are enabled
+ if (dev_enabled) {
+ File js_file = new File(dev_path + "user-location.user.js");
+ s = new Scanner(js_file).useDelimiter("\\A");
+ }
+ else
+ // load plugin from asset folder
+ s = new Scanner(am.open("user-location.user.js")).useDelimiter("\\A");
} catch (IOException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();