}
public synchronized boolean _loadModule() throws NotRootedException,ShellException {
+ Log.i(TAG, "Loading module");
+
if (isLoaded()) {
+ Log.i(TAG, "Module already loaded");
return true;
}
if (!insmod.exists()) {
insmod = new File("/system/xbin/insmod");
if (!insmod.exists()) {
+ Log.e(TAG, "insmod not found");
return false;
}
}
try {
Thread.sleep(100);
} catch (Exception e) {
+ Log.e(TAG, "Got Exception: " + e.getMessage() + " (" + e.getCause() + ")");
return false;
}
cnt--;
}
if (!isLoaded()) {
+ Log.e(TAG, "Module doesn't appear to be correctly loaded");
return false;
}
editor.putBoolean("safe_to_load", true);
editor.commit();
+ Log.i(TAG, "Module loaded successfully");
return true;
}
public synchronized void unloadModule() throws NotRootedException,ShellException {
+ Log.i(TAG, "Unloading module");
+
+ if (!isLoaded()) {
+ Log.i(TAG, "Module not loaded");
+ return;
+ }
+
File rmmod = new File("/system/bin/rmmod");
if (!rmmod.exists()) {
rmmod = new File("/system/xbin/rmmod");
if (!rmmod.exists()) {
+ Log.e(TAG, "rmmod not found");
return;
}
}