include $(CLEAR_VARS)
-SUPERUSER_EMBEDDED := true
ifdef SUPERUSER_EMBEDDED
SUPERUSER_PACKAGE := com.android.settings
-endif
-
+else
ifeq ($(SUPERUSER_PACKAGE),)
SUPERUSER_PACKAGE := com.thirdparty.superuser
endif
+include $(LOCAL_PATH)/Superuser/Android.mk
+endif
+
LOCAL_MODULE := su
LOCAL_FORCE_STATIC_EXECUTABLE := true
LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
include $(BUILD_EXECUTABLE)
-include $(LOCAL_PATH)/Superuser/Android.mk
\ No newline at end of file
-ifndef SUPERUSER_EMBEDDED
-
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_AAPT_FLAGS := --extra-packages com.koushikdutta.widgets -S $(LOCAL_PATH)/../../Widgets/Widgets/res --auto-add-overlay --rename-manifest-package $(SUPERUSER_PACKAGE)
include $(BUILD_PACKAGE)
-
-endif
<resources>
<string name="superuser">Superuser</string>
- <string name="app_name">Superuser</string>
<string name="allow">Gewähren</string>
<string name="deny">Verweigern</string>
<string name="status_incoming">Eingehende Superuser-Anfrage\u2026</string>
package com.koushikdutta.superuser;
import android.content.Context;
+import android.os.Bundle;
import android.view.ContextThemeWrapper;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
import com.koushikdutta.widgets.NativeFragment;
public class LogNativeFragment extends NativeFragment<LogFragmentInternal> {
+ ContextThemeWrapper mWrapper;
+ public Context getContext(Context ctx) {
+ if (mWrapper != null)
+ return mWrapper;
+ mWrapper = new ContextThemeWrapper(ctx, R.style.SuperuserDark);
+ return mWrapper;
+ }
@Override
public LogFragmentInternal createFragmentInterface() {
return new LogFragmentInternal(this) {
@Override
- void onDelete() {
- super.onDelete();
- LogNativeFragment.this.onDelete();
+ public Context getContext() {
+ return LogNativeFragment.this.getContext(super.getContext());
}
- ContextThemeWrapper mWrapper;
+
@Override
- public Context getContext() {
- if (mWrapper != null)
- return mWrapper;
- Context ctx = super.getContext();
- mWrapper = new ContextThemeWrapper(ctx, R.style.SuperuserDark);
- return mWrapper;
+ protected void setPadding() {
+ super.setPadding();
+ getListView().setPadding(0, 0, 0, 0);
}
};
}
-
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ return super.onCreateView((LayoutInflater)getContext(inflater.getContext()).getSystemService(Context.LAYOUT_INFLATER_SERVICE), container, savedInstanceState);
+ }
void onDelete() {
}
package com.koushikdutta.superuser;
import android.content.Context;
+import android.os.Bundle;
import android.view.ContextThemeWrapper;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
import com.koushikdutta.widgets.NativeFragment;
public class PolicyNativeFragment extends NativeFragment<PolicyFragmentInternal> {
+ ContextThemeWrapper mWrapper;
+ public Context getContext(Context ctx) {
+ if (mWrapper != null)
+ return mWrapper;
+ mWrapper = new ContextThemeWrapper(ctx, R.style.SuperuserDark);
+ return mWrapper;
+ }
@Override
public PolicyFragmentInternal createFragmentInterface() {
return new PolicyFragmentInternal(this) {
- ContextThemeWrapper mWrapper;
@Override
public Context getContext() {
- if (mWrapper != null)
- return mWrapper;
- Context ctx = super.getContext();
- mWrapper = new ContextThemeWrapper(ctx, R.style.SuperuserDark);
- return mWrapper;
+ return PolicyNativeFragment.this.getContext(super.getContext());
+ }
+
+ @Override
+ protected void setPadding() {
+ getListView().setPadding(0, 0, 0, 0);
+ getContainer().setPadding(0, 0, 0, 0);
}
};
}
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ return super.onCreateView((LayoutInflater)getContext(inflater.getContext()).getSystemService(Context.LAYOUT_INFLATER_SERVICE), container, savedInstanceState);
+ }
}
package com.koushikdutta.superuser;
import android.content.Context;
+import android.content.res.Configuration;
+import android.os.Bundle;
import android.view.ContextThemeWrapper;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
import com.koushikdutta.widgets.NativeFragment;
public class SettingsNativeFragment extends NativeFragment<SettingsFragmentInternal> {
+ ContextThemeWrapper mWrapper;
+ public Context getContext(Context ctx) {
+ if (mWrapper != null)
+ return mWrapper;
+ mWrapper = new ContextThemeWrapper(ctx, R.style.SuperuserDark);
+ return mWrapper;
+ }
+
@Override
public SettingsFragmentInternal createFragmentInterface() {
return new SettingsFragmentInternal(this) {
- ContextThemeWrapper mWrapper;
@Override
public Context getContext() {
- if (mWrapper != null)
- return mWrapper;
- Context ctx = super.getContext();
- mWrapper = new ContextThemeWrapper(ctx, R.style.SuperuserDark);
- return mWrapper;
+ return SettingsNativeFragment.this.getContext(super.getContext());
}
};
}
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ return super.onCreateView((LayoutInflater)getContext(inflater.getContext()).getSystemService(Context.LAYOUT_INFLATER_SERVICE), container, savedInstanceState);
+ }
}