├── .gitignore ├── .gitmodules ├── Android.mk ├── LICENSE ├── README.md ├── SELinux └── Policy.md ├── Superuser ├── .classpath ├── .project ├── AndroidManifest.xml ├── Superuser-Superuser.iml ├── Superuser.iml ├── assets │ ├── images │ │ └── svg │ │ │ └── SuperuserIcon.svg │ ├── install-recovery.sh │ └── update-binary ├── build-zip.sh ├── build.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── jni │ ├── Android.mk │ ├── Application.mk │ ├── libselinux │ │ ├── Android.mk │ │ ├── NOTICE │ │ ├── include │ │ │ └── selinux │ │ │ │ ├── android.h │ │ │ │ ├── avc.h │ │ │ │ ├── context.h │ │ │ │ ├── label.h │ │ │ │ └── selinux.h │ │ └── src │ │ │ ├── android.c │ │ │ ├── avc.c │ │ │ ├── avc_internal.c │ │ │ ├── avc_internal.h │ │ │ ├── avc_sidtab.c │ │ │ ├── avc_sidtab.h │ │ │ ├── booleans.c │ │ │ ├── callbacks.c │ │ │ ├── callbacks.h │ │ │ ├── canonicalize_context.c │ │ │ ├── checkAccess.c │ │ │ ├── check_context.c │ │ │ ├── compute_av.c │ │ │ ├── compute_create.c │ │ │ ├── context.c │ │ │ ├── context_internal.h │ │ │ ├── deny_unknown.c │ │ │ ├── disable.c │ │ │ ├── dso.h │ │ │ ├── enabled.c │ │ │ ├── fgetfilecon.c │ │ │ ├── freecon.c │ │ │ ├── fsetfilecon.c │ │ │ ├── get_initial_context.c │ │ │ ├── getenforce.c │ │ │ ├── getfilecon.c │ │ │ ├── getpeercon.c │ │ │ ├── init.c │ │ │ ├── label.c │ │ │ ├── label_android_property.c │ │ │ ├── label_file.c │ │ │ ├── label_internal.h │ │ │ ├── lgetfilecon.c │ │ │ ├── load_policy.c │ │ │ ├── lsetfilecon.c │ │ │ ├── mapping.c │ │ │ ├── mapping.h │ │ │ ├── policy.h │ │ │ ├── policyvers.c │ │ │ ├── procattr.c │ │ │ ├── selinux_internal.h │ │ │ ├── selinux_netlink.h │ │ │ ├── sestatus.c │ │ │ ├── setenforce.c │ │ │ ├── setfilecon.c │ │ │ └── stringrep.c │ ├── libsepol │ │ ├── .Android.mk.swp │ │ ├── .gitignore │ │ ├── Android.mk │ │ ├── COPYING │ │ ├── ChangeLog │ │ ├── Makefile │ │ ├── VERSION │ │ ├── include │ │ │ ├── Makefile │ │ │ └── sepol │ │ │ │ ├── boolean_record.h │ │ │ │ ├── booleans.h │ │ │ │ ├── context.h │ │ │ │ ├── context_record.h │ │ │ │ ├── debug.h │ │ │ │ ├── errcodes.h │ │ │ │ ├── handle.h │ │ │ │ ├── iface_record.h │ │ │ │ ├── interfaces.h │ │ │ │ ├── module.h │ │ │ │ ├── node_record.h │ │ │ │ ├── nodes.h │ │ │ │ ├── policydb.h │ │ │ │ ├── policydb │ │ │ │ ├── avrule_block.h │ │ │ │ ├── avtab.h │ │ │ │ ├── conditional.h │ │ │ │ ├── constraint.h │ │ │ │ ├── context.h │ │ │ │ ├── ebitmap.h │ │ │ │ ├── expand.h │ │ │ │ ├── flask.h │ │ │ │ ├── flask_types.h │ │ │ │ ├── hashtab.h │ │ │ │ ├── hierarchy.h │ │ │ │ ├── link.h │ │ │ │ ├── mls_types.h │ │ │ │ ├── module.h │ │ │ │ ├── polcaps.h │ │ │ │ ├── policydb.h │ │ │ │ ├── services.h │ │ │ │ ├── sidtab.h │ │ │ │ ├── symtab.h │ │ │ │ └── util.h │ │ │ │ ├── port_record.h │ │ │ │ ├── ports.h │ │ │ │ ├── roles.h │ │ │ │ ├── sepol.h │ │ │ │ ├── user_record.h │ │ │ │ └── users.h │ │ ├── man │ │ │ ├── Makefile │ │ │ ├── man3 │ │ │ │ ├── sepol_check_context.3 │ │ │ │ ├── sepol_genbools.3 │ │ │ │ └── sepol_genusers.3 │ │ │ └── man8 │ │ │ │ ├── chkcon.8 │ │ │ │ ├── genpolbools.8 │ │ │ │ └── genpolusers.8 │ │ ├── src │ │ │ ├── Makefile │ │ │ ├── assertion.c │ │ │ ├── assertion.lo │ │ │ ├── assertion.o │ │ │ ├── av_permissions.h │ │ │ ├── avrule_block.c │ │ │ ├── avrule_block.lo │ │ │ ├── avrule_block.o │ │ │ ├── avtab.c │ │ │ ├── avtab.lo │ │ │ ├── avtab.o │ │ │ ├── boolean_internal.h │ │ │ ├── boolean_record.c │ │ │ ├── boolean_record.lo │ │ │ ├── boolean_record.o │ │ │ ├── booleans.c │ │ │ ├── booleans.lo │ │ │ ├── booleans.o │ │ │ ├── conditional.c │ │ │ ├── conditional.lo │ │ │ ├── conditional.o │ │ │ ├── constraint.c │ │ │ ├── constraint.lo │ │ │ ├── constraint.o │ │ │ ├── context.c │ │ │ ├── context.h │ │ │ ├── context.lo │ │ │ ├── context.o │ │ │ ├── context_internal.h │ │ │ ├── context_record.c │ │ │ ├── context_record.lo │ │ │ ├── context_record.o │ │ │ ├── debug.c │ │ │ ├── debug.h │ │ │ ├── debug.lo │ │ │ ├── debug.o │ │ │ ├── dso.h │ │ │ ├── ebitmap.c │ │ │ ├── ebitmap.lo │ │ │ ├── ebitmap.o │ │ │ ├── expand.c │ │ │ ├── expand.lo │ │ │ ├── expand.o │ │ │ ├── genbools.c │ │ │ ├── genbools.lo │ │ │ ├── genbools.o │ │ │ ├── genusers.c │ │ │ ├── genusers.lo │ │ │ ├── genusers.o │ │ │ ├── handle.c │ │ │ ├── handle.h │ │ │ ├── handle.lo │ │ │ ├── handle.o │ │ │ ├── hashtab.c │ │ │ ├── hashtab.lo │ │ │ ├── hashtab.o │ │ │ ├── hierarchy.c │ │ │ ├── hierarchy.lo │ │ │ ├── hierarchy.o │ │ │ ├── iface_internal.h │ │ │ ├── iface_record.c │ │ │ ├── iface_record.lo │ │ │ ├── iface_record.o │ │ │ ├── interfaces.c │ │ │ ├── interfaces.lo │ │ │ ├── interfaces.o │ │ │ ├── libsepol.a │ │ │ ├── libsepol.map │ │ │ ├── libsepol.pc │ │ │ ├── libsepol.pc.in │ │ │ ├── libsepol.so │ │ │ ├── libsepol.so.1 │ │ │ ├── link.c │ │ │ ├── link.lo │ │ │ ├── link.o │ │ │ ├── mls.c │ │ │ ├── mls.h │ │ │ ├── mls.lo │ │ │ ├── mls.o │ │ │ ├── module.c │ │ │ ├── module.lo │ │ │ ├── module.o │ │ │ ├── module_internal.h │ │ │ ├── node_internal.h │ │ │ ├── node_record.c │ │ │ ├── node_record.lo │ │ │ ├── node_record.o │ │ │ ├── nodes.c │ │ │ ├── nodes.lo │ │ │ ├── nodes.o │ │ │ ├── polcaps.c │ │ │ ├── polcaps.lo │ │ │ ├── polcaps.o │ │ │ ├── policydb.c │ │ │ ├── policydb.lo │ │ │ ├── policydb.o │ │ │ ├── policydb_convert.c │ │ │ ├── policydb_convert.lo │ │ │ ├── policydb_convert.o │ │ │ ├── policydb_internal.h │ │ │ ├── policydb_public.c │ │ │ ├── policydb_public.lo │ │ │ ├── policydb_public.o │ │ │ ├── port_internal.h │ │ │ ├── port_record.c │ │ │ ├── port_record.lo │ │ │ ├── port_record.o │ │ │ ├── ports.c │ │ │ ├── ports.lo │ │ │ ├── ports.o │ │ │ ├── private.h │ │ │ ├── roles.c │ │ │ ├── roles.lo │ │ │ ├── roles.o │ │ │ ├── services.c │ │ │ ├── services.lo │ │ │ ├── services.o │ │ │ ├── sidtab.c │ │ │ ├── sidtab.lo │ │ │ ├── sidtab.o │ │ │ ├── symtab.c │ │ │ ├── symtab.lo │ │ │ ├── symtab.o │ │ │ ├── user_internal.h │ │ │ ├── user_record.c │ │ │ ├── user_record.lo │ │ │ ├── user_record.o │ │ │ ├── users.c │ │ │ ├── users.lo │ │ │ ├── users.o │ │ │ ├── util.c │ │ │ ├── util.lo │ │ │ ├── util.o │ │ │ ├── write.c │ │ │ ├── write.lo │ │ │ └── write.o │ │ ├── tests │ │ │ ├── Makefile │ │ │ ├── debug.c │ │ │ ├── debug.h │ │ │ ├── helpers.c │ │ │ ├── helpers.h │ │ │ ├── libsepol-tests.c │ │ │ ├── policies │ │ │ │ ├── support │ │ │ │ │ └── misc_macros.spt │ │ │ │ ├── test-cond │ │ │ │ │ └── refpolicy-base.conf │ │ │ │ ├── test-deps │ │ │ │ │ ├── base-metreq.conf │ │ │ │ │ ├── base-notmetreq.conf │ │ │ │ │ ├── modreq-attr-global.conf │ │ │ │ │ ├── modreq-attr-opt.conf │ │ │ │ │ ├── modreq-bool-global.conf │ │ │ │ │ ├── modreq-bool-opt.conf │ │ │ │ │ ├── modreq-obj-global.conf │ │ │ │ │ ├── modreq-obj-opt.conf │ │ │ │ │ ├── modreq-perm-global.conf │ │ │ │ │ ├── modreq-perm-opt.conf │ │ │ │ │ ├── modreq-role-global.conf │ │ │ │ │ ├── modreq-role-opt.conf │ │ │ │ │ ├── modreq-type-global.conf │ │ │ │ │ ├── modreq-type-opt.conf │ │ │ │ │ ├── module.conf │ │ │ │ │ └── small-base.conf │ │ │ │ ├── test-expander │ │ │ │ │ ├── alias-base.conf │ │ │ │ │ ├── alias-module.conf │ │ │ │ │ ├── base-base-only.conf │ │ │ │ │ ├── module.conf │ │ │ │ │ ├── role-base.conf │ │ │ │ │ ├── role-module.conf │ │ │ │ │ ├── small-base.conf │ │ │ │ │ ├── user-base.conf │ │ │ │ │ └── user-module.conf │ │ │ │ ├── test-hooks │ │ │ │ │ ├── cmp_policy.conf │ │ │ │ │ ├── module_add_role_allow_trans.conf │ │ │ │ │ ├── module_add_symbols.conf │ │ │ │ │ └── small-base.conf │ │ │ │ └── test-linker │ │ │ │ │ ├── module1.conf │ │ │ │ │ ├── module2.conf │ │ │ │ │ └── small-base.conf │ │ │ ├── test-common.c │ │ │ ├── test-common.h │ │ │ ├── test-cond.c │ │ │ ├── test-cond.h │ │ │ ├── test-deps.c │ │ │ ├── test-deps.h │ │ │ ├── test-downgrade.c │ │ │ ├── test-downgrade.h │ │ │ ├── test-expander-attr-map.c │ │ │ ├── test-expander-attr-map.h │ │ │ ├── test-expander-roles.c │ │ │ ├── test-expander-roles.h │ │ │ ├── test-expander-users.c │ │ │ ├── test-expander-users.h │ │ │ ├── test-expander.c │ │ │ ├── test-expander.h │ │ │ ├── test-linker-cond-map.c │ │ │ ├── test-linker-cond-map.h │ │ │ ├── test-linker-roles.c │ │ │ ├── test-linker-roles.h │ │ │ ├── test-linker-types.c │ │ │ ├── test-linker-types.h │ │ │ ├── test-linker.c │ │ │ └── test-linker.h │ │ └── utils │ │ │ ├── Makefile │ │ │ └── chkcon.c │ ├── reboot │ │ └── reboot.c │ ├── sqlite3 │ │ ├── shell.c │ │ ├── sqlite3.c │ │ ├── sqlite3.h │ │ └── sqlite3ext.h │ └── su │ │ ├── activity.c │ │ ├── binds.c │ │ ├── binds.h │ │ ├── daemon.c │ │ ├── db.c │ │ ├── hacks.c │ │ ├── pts.c │ │ ├── pts.h │ │ ├── su.c │ │ ├── su.h │ │ ├── utils.c │ │ └── utils.h ├── lint.xml ├── packageName ├── proguard-project.txt ├── project.properties ├── res │ ├── drawable-hdpi-v11 │ │ └── ic_stat_notification.png │ ├── drawable-hdpi-v9 │ │ └── ic_stat_notification.png │ ├── drawable-hdpi │ │ ├── ic_action_about.png │ │ ├── ic_action_logs.png │ │ ├── ic_action_permission.png │ │ ├── ic_action_settings.png │ │ ├── ic_action_trash.png │ │ ├── ic_alert.png │ │ ├── ic_alert_dark.png │ │ ├── ic_allow.png │ │ ├── ic_delete.png │ │ ├── ic_deny.png │ │ ├── ic_launcher.png │ │ ├── ic_logging.png │ │ ├── ic_logging_dark.png │ │ ├── ic_menu_about.png │ │ ├── ic_menu_logs.png │ │ ├── ic_menu_settings.png │ │ ├── ic_menu_trash.png │ │ ├── ic_notifications.png │ │ ├── ic_notifications_dark.png │ │ ├── ic_protected.png │ │ ├── ic_protected_dark.png │ │ ├── ic_stat_notification.png │ │ ├── ic_theme.png │ │ ├── ic_theme_dark.png │ │ ├── ic_timeout.png │ │ ├── ic_timeout_dark.png │ │ ├── ic_toggle.png │ │ ├── ic_toggle_dark.png │ │ ├── ic_users.png │ │ └── ic_users_dark.png │ ├── drawable-ldpi-v11 │ │ └── ic_stat_notification.png │ ├── drawable-ldpi-v9 │ │ └── ic_stat_notification.png │ ├── drawable-mdpi-v11 │ │ └── ic_stat_notification.png │ ├── drawable-mdpi-v9 │ │ └── ic_stat_notification.png │ ├── drawable-mdpi │ │ ├── ic_action_about.png │ │ ├── ic_action_logs.png │ │ ├── ic_action_permission.png │ │ ├── ic_action_settings.png │ │ ├── ic_action_trash.png │ │ ├── ic_alert.png │ │ ├── ic_alert_dark.png │ │ ├── ic_allow.png │ │ ├── ic_delete.png │ │ ├── ic_deny.png │ │ ├── ic_launcher.png │ │ ├── ic_logging.png │ │ ├── ic_logging_dark.png │ │ ├── ic_menu_about.png │ │ ├── ic_menu_logs.png │ │ ├── ic_menu_settings.png │ │ ├── ic_menu_trash.png │ │ ├── ic_notifications.png │ │ ├── ic_notifications_dark.png │ │ ├── ic_protected.png │ │ ├── ic_protected_dark.png │ │ ├── ic_stat_notification.png │ │ ├── ic_theme.png │ │ ├── ic_theme_dark.png │ │ ├── ic_timeout.png │ │ ├── ic_timeout_dark.png │ │ ├── ic_toggle.png │ │ ├── ic_toggle_dark.png │ │ ├── ic_users.png │ │ └── ic_users_dark.png │ ├── drawable-xhdpi-v11 │ │ └── ic_stat_notification.png │ ├── drawable-xhdpi-v9 │ │ └── ic_stat_notification.png │ ├── drawable-xhdpi │ │ ├── ic_action_about.png │ │ ├── ic_action_logs.png │ │ ├── ic_action_permission.png │ │ ├── ic_action_settings.png │ │ ├── ic_action_trash.png │ │ ├── ic_alert.png │ │ ├── ic_alert_dark.png │ │ ├── ic_allow.png │ │ ├── ic_delete.png │ │ ├── ic_deny.png │ │ ├── ic_launcher.png │ │ ├── ic_logging.png │ │ ├── ic_logging_dark.png │ │ ├── ic_menu_about.png │ │ ├── ic_menu_logs.png │ │ ├── ic_menu_settings.png │ │ ├── ic_menu_trash.png │ │ ├── ic_notifications.png │ │ ├── ic_notifications_dark.png │ │ ├── ic_protected.png │ │ ├── ic_protected_dark.png │ │ ├── ic_stat_notification.png │ │ ├── ic_theme.png │ │ ├── ic_theme_dark.png │ │ ├── ic_timeout.png │ │ ├── ic_timeout_dark.png │ │ ├── ic_toggle.png │ │ ├── ic_toggle_dark.png │ │ ├── ic_users.png │ │ └── ic_users_dark.png │ ├── drawable-xxhdpi │ │ └── ic_launcher.png │ ├── drawable │ │ ├── carbon.png │ │ ├── clockwork512.png │ │ ├── desksms.png │ │ ├── github.png │ │ ├── koush.png │ │ └── tether.png │ ├── layout-land │ │ ├── app_info.xml │ │ ├── app_request.xml │ │ └── log_item.xml │ ├── layout-large-land │ │ └── policy_list_content.xml │ ├── layout-large │ │ ├── app_info.xml │ │ ├── app_request.xml │ │ ├── policy_info.xml │ │ └── policy_list_content.xml │ ├── layout-normal-land │ │ └── policy_info.xml │ ├── layout-v14 │ │ ├── log_toggle.xml │ │ └── notification_toggle.xml │ ├── layout │ │ ├── app_info.xml │ │ ├── app_layout.xml │ │ ├── app_request.xml │ │ ├── empty.xml │ │ ├── log_item.xml │ │ ├── log_item_base.xml │ │ ├── log_toggle.xml │ │ ├── notification_toggle.xml │ │ ├── notify.xml │ │ ├── packageinfo.xml │ │ ├── pin.xml │ │ ├── policy_header.xml │ │ ├── policy_info.xml │ │ ├── policy_list_content.xml │ │ ├── request.xml │ │ ├── request_choices.xml │ │ ├── request_spinner.xml │ │ ├── request_spinner_choice.xml │ │ ├── settings.xml │ │ └── unknown_app.xml │ ├── menu-v11 │ │ ├── app.xml │ │ ├── main.xml │ │ └── policy.xml │ ├── menu │ │ ├── app.xml │ │ ├── main.xml │ │ └── policy.xml │ ├── values-af │ │ └── strings.xml │ ├── values-ar │ │ └── strings.xml │ ├── values-ca │ │ └── strings.xml │ ├── values-cs │ │ └── strings.xml │ ├── values-da │ │ └── strings.xml │ ├── values-de │ │ └── strings.xml │ ├── values-el │ │ └── strings.xml │ ├── values-es-rXA │ │ └── strings.xml │ ├── values-es │ │ └── strings.xml │ ├── values-fi │ │ └── strings.xml │ ├── values-fr │ │ └── strings.xml │ ├── values-gl │ │ └── strings.xml │ ├── values-hr │ │ └── strings.xml │ ├── values-hu │ │ └── strings.xml │ ├── values-it │ │ └── strings.xml │ ├── values-iw │ │ └── strings.xml │ ├── values-ja │ │ └── strings.xml │ ├── values-large-v14 │ │ └── styles.xml │ ├── values-lt │ │ └── strings.xml │ ├── values-nl │ │ └── strings.xml │ ├── values-pl │ │ └── strings.xml │ ├── values-pt-rBR │ │ └── strings.xml │ ├── values-pt-rPT │ │ └── strings.xml │ ├── values-pt │ │ └── strings.xml │ ├── values-ro │ │ └── strings.xml │ ├── values-ru │ │ └── strings.xml │ ├── values-sk │ │ └── strings.xml │ ├── values-sr │ │ └── strings.xml │ ├── values-sv │ │ └── strings.xml │ ├── values-sw600dp │ │ └── dimens.xml │ ├── values-sw720dp-land │ │ └── dimens.xml │ ├── values-tr │ │ └── strings.xml │ ├── values-v14 │ │ └── styles.xml │ ├── values-zh-rCN │ │ └── strings.xml │ ├── values-zh-rHK │ │ └── strings.xml │ ├── values-zh-rSG │ │ └── strings.xml │ ├── values-zh-rTW │ │ └── strings.xml │ ├── values-zh │ │ └── strings.xml │ └── values │ │ ├── attrs.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml ├── settings.gradle └── src │ └── com │ └── koushikdutta │ └── superuser │ ├── AboutFragment.java │ ├── Helper.java │ ├── LogFragment.java │ ├── MainActivity.java │ ├── MultitaskSuRequestActivity.java │ ├── NotifyActivity.java │ ├── PackageChangeReceiver.java │ ├── PinViewHelper.java │ ├── PolicyFragment.java │ ├── RequestActivity.java │ ├── SettingsFragment.java │ ├── SuApplication.java │ ├── SuCheckerReceiver.java │ ├── SuReceiver.java │ ├── db │ ├── LogEntry.java │ ├── SuDatabaseHelper.java │ ├── SuperuserDatabaseHelper.java │ ├── UidCommand.java │ └── UidPolicy.java │ └── util │ ├── ImageCache.java │ ├── Settings.java │ ├── SoftReferenceHashTable.java │ ├── StreamUtility.java │ └── SuHelper.java ├── init.superuser.rc └── local_manifest.xml /.gitignore: -------------------------------------------------------------------------------- 1 | bin 2 | armeabi 3 | x86 4 | obj 5 | local.properties 6 | gen 7 | .DS_Store 8 | .settings 9 | libs 10 | build 11 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Widgets"] 2 | path = Widgets 3 | url = https://github.com/phhusson/Widgets.git 4 | -------------------------------------------------------------------------------- /Android.mk: -------------------------------------------------------------------------------- 1 | # Root AOSP source makefile 2 | # su is built here, and 3 | 4 | my_path := $(call my-dir) 5 | 6 | LOCAL_PATH := $(my_path) 7 | include $(CLEAR_VARS) 8 | 9 | LOCAL_MODULE := su 10 | LOCAL_MODULE_TAGS := eng debug optional 11 | LOCAL_FORCE_STATIC_EXECUTABLE := true 12 | LOCAL_STATIC_LIBRARIES := libc libcutils libselinux 13 | LOCAL_C_INCLUDES := external/sqlite/dist 14 | LOCAL_SRC_FILES := Superuser/jni/su/su.c Superuser/jni/su/daemon.c Superuser/jni/su/activity.c Superuser/jni/su/db.c Superuser/jni/su/utils.c Superuser/jni/su/pts.c Superuser/jni/sqlite3/sqlite3.c 15 | LOCAL_CFLAGS := -DSQLITE_OMIT_LOAD_EXTENSION -DREQUESTOR=\"$(SUPERUSER_PACKAGE)\" 16 | 17 | ifdef SUPERUSER_PACKAGE_PREFIX 18 | LOCAL_CFLAGS += -DREQUESTOR_PREFIX=\"$(SUPERUSER_PACKAGE_PREFIX)\" 19 | endif 20 | 21 | ifdef SUPERUSER_EMBEDDED 22 | LOCAL_CFLAGS += -DSUPERUSER_EMBEDDED 23 | endif 24 | 25 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN) 26 | include $(BUILD_EXECUTABLE) 27 | 28 | include $(CLEAR_VARS) 29 | 30 | ifdef SUPERUSER_EMBEDDED 31 | 32 | SUPERUSER_MARKER := $(TARGET_OUT_ETC)/.has_su_daemon 33 | $(SUPERUSER_MARKER): $(LOCAL_INSTALLED_MODULE) 34 | @mkdir -p $(dir $@) 35 | @rm -rf $@ 36 | $(hide) touch $@ 37 | 38 | ALL_MODULES.$(LOCAL_MODULE).INSTALLED := \ 39 | $(ALL_MODULES.$(LOCAL_MODULE).INSTALLED) $(SUPERUSER_RC) $(SUPERUSER_MARKER) 40 | 41 | endif 42 | -------------------------------------------------------------------------------- /Superuser/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Superuser/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | Superuser 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /Superuser/Superuser.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /Superuser/assets/images/svg/SuperuserIcon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Superuser/assets/install-recovery.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | /system/xbin/su --daemon & 3 | -------------------------------------------------------------------------------- /Superuser/build-zip.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | tmpdir="$(mktemp -d)" 4 | ORIG="$(pwd)" 5 | 6 | rm -f update-su.zip 7 | pushd "$tmpdir" 8 | mkdir -p META-INF/com/google/android 9 | cp "$ORIG"/assets/update-binary META-INF/com/google/android/update-binary 10 | cp "$ORIG"/assets/install-recovery.sh . 11 | cp -R "$ORIG"/libs/{x86,mips,armeabi} . 12 | 13 | zip -r "$ORIG"/update-su.zip * 14 | popd 15 | rm -Rf "$tmpdir" 16 | -------------------------------------------------------------------------------- /Superuser/build.gradle: -------------------------------------------------------------------------------- 1 | task wrapper(type: Wrapper) { 2 | gradleVersion = '2.5' 3 | } 4 | 5 | buildscript { 6 | repositories { 7 | mavenCentral() 8 | } 9 | dependencies { 10 | classpath 'com.android.tools.build:gradle:1.2.3' 11 | } 12 | } 13 | apply plugin: 'com.android.application' 14 | 15 | repositories { 16 | mavenCentral() 17 | } 18 | 19 | dependencies { 20 | compile project(':Widgets') 21 | } 22 | 23 | android { 24 | packagingOptions { 25 | exclude 'META-INF/beans.xml' 26 | } 27 | 28 | signingConfigs { 29 | release { 30 | if(System.getenv("KEYSTORE") != null) { 31 | storeFile file(System.getenv("KEYSTORE")) 32 | storePassword new String(System.console().readPassword("\n\$ Enter store password: ")) 33 | keyAlias "su" 34 | keyPassword new String(System.console().readPassword("\n\$ Enter key password: ")) 35 | } 36 | } 37 | } 38 | 39 | sourceSets { 40 | main { 41 | manifest.srcFile 'AndroidManifest.xml' 42 | jniLibs.srcDirs = ['libs'] 43 | assets.srcDirs = ['assets/'] 44 | res.srcDirs = ['res/'] 45 | java.srcDirs = ['src/'] 46 | aidl.srcDirs = ['src/'] 47 | } 48 | } 49 | 50 | compileSdkVersion 22 51 | buildToolsVersion '22.0.1' 52 | 53 | defaultConfig { 54 | File f = new File("packageName") 55 | minSdkVersion 14 56 | targetSdkVersion 22 57 | if(f.exists()) 58 | applicationId f.text 59 | signingConfig signingConfigs.release 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Superuser/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /Superuser/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Aug 01 17:31:39 CEST 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-bin.zip 7 | -------------------------------------------------------------------------------- /Superuser/jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_ABI := x86 armeabi mips 2 | # NDK_TOOLCHAIN_VERSION=4.8 3 | APP_PIE = true -------------------------------------------------------------------------------- /Superuser/jni/libselinux/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | 3 | common_SRC_FILES := \ 4 | src/booleans.c \ 5 | src/canonicalize_context.c \ 6 | src/disable.c \ 7 | src/enabled.c \ 8 | src/fgetfilecon.c \ 9 | src/fsetfilecon.c \ 10 | src/getenforce.c \ 11 | src/getfilecon.c \ 12 | src/getpeercon.c \ 13 | src/lgetfilecon.c \ 14 | src/load_policy.c \ 15 | src/lsetfilecon.c \ 16 | src/policyvers.c \ 17 | src/procattr.c \ 18 | src/setenforce.c \ 19 | src/setfilecon.c \ 20 | src/context.c \ 21 | src/mapping.c \ 22 | src/stringrep.c \ 23 | src/compute_create.c \ 24 | src/compute_av.c \ 25 | src/avc.c \ 26 | src/avc_internal.c \ 27 | src/avc_sidtab.c \ 28 | src/get_initial_context.c \ 29 | src/checkAccess.c \ 30 | src/sestatus.c \ 31 | src/deny_unknown.c 32 | 33 | common_HOST_FILES := \ 34 | src/callbacks.c \ 35 | src/check_context.c \ 36 | src/freecon.c \ 37 | src/init.c \ 38 | src/label.c \ 39 | src/label_file.c \ 40 | src/label_android_property.c 41 | 42 | 43 | common_COPY_HEADERS_TO := selinux 44 | common_COPY_HEADERS := include/selinux/selinux.h include/selinux/label.h include/selinux/context.h include/selinux/avc.h include/selinux/android.h 45 | 46 | include $(CLEAR_VARS) 47 | #LOCAL_SRC_FILES := $(common_SRC_FILES) $(common_HOST_FILES) src/android.c 48 | LOCAL_SRC_FILES := $(common_SRC_FILES) #src/android.c 49 | LOCAL_MODULE:= libselinux 50 | LOCAL_MODULE_TAGS := eng 51 | LOCAL_STATIC_LIBRARIES := libmincrypt 52 | LOCAL_C_INCLUDES := jni/libselinux/include/ 53 | LOCAL_WHOLE_STATIC_LIBRARIES := libpcre 54 | # 1003 corresponds to auditd, from system/core/logd/event.logtags 55 | LOCAL_CFLAGS := -DAUDITD_LOG_TAG=1003 56 | include $(BUILD_STATIC_LIBRARY) 57 | -------------------------------------------------------------------------------- /Superuser/jni/libselinux/NOTICE: -------------------------------------------------------------------------------- 1 | This library (libselinux) is public domain software, i.e. not copyrighted. 2 | 3 | Warranty Exclusion 4 | ------------------ 5 | You agree that this software is a 6 | non-commercially developed program that may contain "bugs" (as that 7 | term is used in the industry) and that it may not function as intended. 8 | The software is licensed "as is". NSA makes no, and hereby expressly 9 | disclaims all, warranties, express, implied, statutory, or otherwise 10 | with respect to the software, including noninfringement and the implied 11 | warranties of merchantability and fitness for a particular purpose. 12 | 13 | Limitation of Liability 14 | ----------------------- 15 | In no event will NSA be liable for any damages, including loss of data, 16 | lost profits, cost of cover, or other special, incidental, 17 | consequential, direct or indirect damages arising from the software or 18 | the use thereof, however caused and on any theory of liability. This 19 | limitation will apply even if NSA has been advised of the possibility 20 | of such damage. You acknowledge that this is a reasonable allocation of 21 | risk. 22 | -------------------------------------------------------------------------------- /Superuser/jni/libselinux/include/selinux/android.h: -------------------------------------------------------------------------------- 1 | #ifndef _SELINUX_ANDROID_H_ 2 | #define _SELINUX_ANDROID_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | extern struct selabel_handle* selinux_android_file_context_handle(void); 15 | 16 | extern struct selabel_handle* selinux_android_service_context_handle(void); 17 | 18 | extern void selinux_android_set_sehandle(const struct selabel_handle *hndl); 19 | 20 | extern int selinux_android_load_policy(void); 21 | 22 | extern int selinux_android_reload_policy(void); 23 | 24 | extern int selinux_android_setcontext(uid_t uid, 25 | int isSystemServer, 26 | const char *seinfo, 27 | const char *name); 28 | 29 | extern int selinux_android_setfilecon(const char *pkgdir, 30 | const char *pkgname, 31 | const char *seinfo, 32 | uid_t uid); 33 | 34 | extern int selinux_log_callback(int type, const char *fmt, ...) 35 | __attribute__ ((format(printf, 2, 3))); 36 | 37 | #define SELINUX_ANDROID_RESTORECON_NOCHANGE 1 38 | #define SELINUX_ANDROID_RESTORECON_VERBOSE 2 39 | #define SELINUX_ANDROID_RESTORECON_RECURSE 4 40 | #define SELINUX_ANDROID_RESTORECON_FORCE 8 41 | #define SELINUX_ANDROID_RESTORECON_DATADATA 16 42 | extern int selinux_android_restorecon(const char *file, unsigned int flags); 43 | 44 | extern int selinux_android_restorecon_pkgdir(const char *pkgdir, 45 | const char *seinfo, 46 | uid_t uid, 47 | unsigned int flags); 48 | 49 | extern int selinux_android_seapp_context_reload(void); 50 | 51 | extern bool selinux_android_use_data_policy(void); 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | #endif 57 | -------------------------------------------------------------------------------- /Superuser/jni/libselinux/include/selinux/context.h: -------------------------------------------------------------------------------- 1 | #ifndef _SELINUX_CONTEXT_H_ 2 | #define _SELINUX_CONTEXT_H_ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /* 9 | * Functions to deal with security contexts in user space. 10 | */ 11 | 12 | typedef struct { 13 | void *ptr; 14 | } context_s_t; 15 | 16 | typedef context_s_t *context_t; 17 | 18 | /* Return a new context initialized to a context string */ 19 | 20 | extern context_t context_new(const char *); 21 | 22 | /* 23 | * Return a pointer to the string value of the context_t 24 | * Valid until the next call to context_str or context_free 25 | * for the same context_t* 26 | */ 27 | 28 | extern char *context_str(context_t); 29 | 30 | /* Free the storage used by a context */ 31 | extern void context_free(context_t); 32 | 33 | /* Get a pointer to the string value of a context component */ 34 | 35 | extern const char *context_type_get(context_t); 36 | extern const char *context_range_get(context_t); 37 | extern const char *context_role_get(context_t); 38 | extern const char *context_user_get(context_t); 39 | 40 | /* Set a context component. Returns nonzero if unsuccessful */ 41 | 42 | extern int context_type_set(context_t, const char *); 43 | extern int context_range_set(context_t, const char *); 44 | extern int context_role_set(context_t, const char *); 45 | extern int context_user_set(context_t, const char *); 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | #endif 51 | -------------------------------------------------------------------------------- /Superuser/jni/libselinux/src/avc_sidtab.h: -------------------------------------------------------------------------------- 1 | /* 2 | * A security identifier table (sidtab) is a hash table 3 | * of security context structures indexed by SID value. 4 | */ 5 | #ifndef _SELINUX_AVC_SIDTAB_H_ 6 | #define _SELINUX_AVC_SIDTAB_H_ 7 | 8 | #include 9 | #include 10 | #include "dso.h" 11 | 12 | struct sidtab_node { 13 | struct security_id sid_s; 14 | struct sidtab_node *next; 15 | }; 16 | 17 | #define SIDTAB_HASH_BITS 7 18 | #define SIDTAB_HASH_BUCKETS (1 << SIDTAB_HASH_BITS) 19 | #define SIDTAB_HASH_MASK (SIDTAB_HASH_BUCKETS-1) 20 | #define SIDTAB_SIZE SIDTAB_HASH_BUCKETS 21 | 22 | struct sidtab { 23 | struct sidtab_node **htable; 24 | unsigned nel; 25 | }; 26 | 27 | int sidtab_init(struct sidtab *s) hidden; 28 | int sidtab_insert(struct sidtab *s, const char * ctx) hidden; 29 | 30 | int sidtab_context_to_sid(struct sidtab *s, 31 | const char * ctx, security_id_t * sid) hidden; 32 | 33 | void sidtab_sid_stats(struct sidtab *s, char *buf, int buflen) hidden; 34 | void sidtab_destroy(struct sidtab *s) hidden; 35 | 36 | #endif /* _SELINUX_AVC_SIDTAB_H_ */ 37 | -------------------------------------------------------------------------------- /Superuser/jni/libselinux/src/callbacks.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file describes the callbacks passed to selinux_init() and available 3 | * for use from the library code. They all have default implementations. 4 | */ 5 | #ifndef _SELINUX_CALLBACKS_H_ 6 | #define _SELINUX_CALLBACKS_H_ 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include "dso.h" 13 | 14 | /* callback pointers */ 15 | extern int __attribute__ ((format(printf, 2, 3))) 16 | (*selinux_log) (int type, const char *, ...) hidden; 17 | 18 | extern int 19 | (*selinux_audit) (void *, security_class_t, char *, size_t) hidden; 20 | 21 | extern int 22 | (*selinux_validate)(char **ctx) hidden; 23 | 24 | extern int 25 | (*selinux_netlink_setenforce) (int enforcing) hidden; 26 | 27 | extern int 28 | (*selinux_netlink_policyload) (int seqno) hidden; 29 | 30 | #endif /* _SELINUX_CALLBACKS_H_ */ 31 | -------------------------------------------------------------------------------- /Superuser/jni/libselinux/src/canonicalize_context.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "selinux_internal.h" 9 | #include "policy.h" 10 | #include 11 | 12 | int security_canonicalize_context(const char * con, 13 | char ** canoncon) 14 | { 15 | char path[PATH_MAX]; 16 | char *buf; 17 | size_t size; 18 | int fd, ret; 19 | 20 | if (!selinux_mnt) { 21 | errno = ENOENT; 22 | return -1; 23 | } 24 | 25 | snprintf(path, sizeof path, "%s/context", selinux_mnt); 26 | fd = open(path, O_RDWR); 27 | if (fd < 0) 28 | return -1; 29 | 30 | size = selinux_page_size; 31 | buf = malloc(size); 32 | if (!buf) { 33 | ret = -1; 34 | goto out; 35 | } 36 | strncpy(buf, con, size); 37 | 38 | ret = write(fd, buf, strlen(buf) + 1); 39 | if (ret < 0) 40 | goto out2; 41 | 42 | memset(buf, 0, size); 43 | ret = read(fd, buf, size - 1); 44 | if (ret < 0 && errno == EINVAL) { 45 | /* Fall back to the original context for kernels 46 | that do not support the extended interface. */ 47 | strncpy(buf, con, size); 48 | } 49 | 50 | *canoncon = strdup(buf); 51 | if (!(*canoncon)) { 52 | ret = -1; 53 | goto out2; 54 | } 55 | ret = 0; 56 | out2: 57 | free(buf); 58 | out: 59 | close(fd); 60 | return ret; 61 | } 62 | 63 | -------------------------------------------------------------------------------- /Superuser/jni/libselinux/src/checkAccess.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "selinux_internal.h" 6 | #include 7 | 8 | static pthread_once_t once = PTHREAD_ONCE_INIT; 9 | static int selinux_enabled; 10 | 11 | static void avc_init_once(void) 12 | { 13 | selinux_enabled = is_selinux_enabled(); 14 | if (selinux_enabled == 1) 15 | avc_open(NULL, 0); 16 | } 17 | 18 | int selinux_check_access(const char * scon, const char * tcon, const char *class, const char *perm, void *aux) { 19 | int status = -1; 20 | int rc = -1; 21 | security_id_t scon_id; 22 | security_id_t tcon_id; 23 | security_class_t sclass; 24 | access_vector_t av; 25 | 26 | __selinux_once(once, avc_init_once); 27 | 28 | if (selinux_enabled != 1) 29 | return 0; 30 | 31 | if ((rc = avc_context_to_sid(scon, &scon_id)) < 0) return rc; 32 | 33 | if ((rc = avc_context_to_sid(tcon, &tcon_id)) < 0) return rc; 34 | 35 | if ((sclass = string_to_security_class(class)) == 0) return status; 36 | 37 | if ((av = string_to_av_perm(sclass, perm)) == 0) return status; 38 | 39 | return avc_has_perm (scon_id, tcon_id, sclass, av, NULL, aux); 40 | } 41 | 42 | -------------------------------------------------------------------------------- /Superuser/jni/libselinux/src/check_context.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "selinux_internal.h" 9 | #include "policy.h" 10 | #include 11 | 12 | int security_check_context(const char * con) 13 | { 14 | char path[PATH_MAX]; 15 | int fd, ret; 16 | 17 | if (!selinux_mnt) { 18 | errno = ENOENT; 19 | return -1; 20 | } 21 | 22 | snprintf(path, sizeof path, "%s/context", selinux_mnt); 23 | fd = open(path, O_RDWR); 24 | if (fd < 0) 25 | return -1; 26 | 27 | ret = write(fd, con, strlen(con) + 1); 28 | close(fd); 29 | if (ret < 0) 30 | return -1; 31 | return 0; 32 | } 33 | 34 | -------------------------------------------------------------------------------- /Superuser/jni/libselinux/src/compute_av.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "selinux_internal.h" 10 | #include "policy.h" 11 | #include "mapping.h" 12 | 13 | int security_compute_av(const char * scon, 14 | const char * tcon, 15 | security_class_t tclass, 16 | access_vector_t requested, 17 | struct av_decision *avd) 18 | { 19 | char path[PATH_MAX]; 20 | char *buf; 21 | size_t len; 22 | int fd, ret; 23 | 24 | if (!selinux_mnt) { 25 | errno = ENOENT; 26 | return -1; 27 | } 28 | 29 | snprintf(path, sizeof path, "%s/access", selinux_mnt); 30 | fd = open(path, O_RDWR); 31 | if (fd < 0) 32 | return -1; 33 | 34 | len = selinux_page_size; 35 | buf = malloc(len); 36 | if (!buf) { 37 | ret = -1; 38 | goto out; 39 | } 40 | 41 | snprintf(buf, len, "%s %s %hu %x", scon, tcon, 42 | unmap_class(tclass), unmap_perm(tclass, requested)); 43 | 44 | ret = write(fd, buf, strlen(buf)); 45 | if (ret < 0) 46 | goto out2; 47 | 48 | memset(buf, 0, len); 49 | ret = read(fd, buf, len - 1); 50 | if (ret < 0) 51 | goto out2; 52 | 53 | ret = sscanf(buf, "%x %x %x %x %u %x", 54 | &avd->allowed, &avd->decided, 55 | &avd->auditallow, &avd->auditdeny, 56 | &avd->seqno, &avd->flags); 57 | if (ret < 5) { 58 | ret = -1; 59 | goto out2; 60 | } else if (ret < 6) 61 | avd->flags = 0; 62 | 63 | map_decision(tclass, avd); 64 | 65 | ret = 0; 66 | out2: 67 | free(buf); 68 | out: 69 | close(fd); 70 | return ret; 71 | } 72 | 73 | -------------------------------------------------------------------------------- /Superuser/jni/libselinux/src/compute_create.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "selinux_internal.h" 10 | #include "policy.h" 11 | #include "mapping.h" 12 | 13 | int security_compute_create(const char * scon, 14 | const char * tcon, 15 | security_class_t tclass, 16 | char ** newcon) 17 | { 18 | char path[PATH_MAX]; 19 | char *buf; 20 | size_t size; 21 | int fd, ret; 22 | 23 | if (!selinux_mnt) { 24 | errno = ENOENT; 25 | return -1; 26 | } 27 | 28 | snprintf(path, sizeof path, "%s/create", selinux_mnt); 29 | fd = open(path, O_RDWR); 30 | if (fd < 0) 31 | return -1; 32 | 33 | size = selinux_page_size; 34 | buf = malloc(size); 35 | if (!buf) { 36 | ret = -1; 37 | goto out; 38 | } 39 | snprintf(buf, size, "%s %s %hu", scon, tcon, unmap_class(tclass)); 40 | 41 | ret = write(fd, buf, strlen(buf)); 42 | if (ret < 0) 43 | goto out2; 44 | 45 | memset(buf, 0, size); 46 | ret = read(fd, buf, size - 1); 47 | if (ret < 0) 48 | goto out2; 49 | 50 | *newcon = strdup(buf); 51 | if (!(*newcon)) { 52 | ret = -1; 53 | goto out2; 54 | } 55 | ret = 0; 56 | out2: 57 | free(buf); 58 | out: 59 | close(fd); 60 | return ret; 61 | } 62 | -------------------------------------------------------------------------------- /Superuser/jni/libselinux/src/context_internal.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include "dso.h" 3 | 4 | hidden_proto(context_new) 5 | hidden_proto(context_free) 6 | hidden_proto(context_str) 7 | hidden_proto(context_type_set) 8 | hidden_proto(context_type_get) 9 | hidden_proto(context_role_set) 10 | hidden_proto(context_role_get) 11 | hidden_proto(context_user_set) 12 | hidden_proto(context_user_get) 13 | hidden_proto(context_range_set) 14 | hidden_proto(context_range_get) 15 | -------------------------------------------------------------------------------- /Superuser/jni/libselinux/src/deny_unknown.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "selinux_internal.h" 8 | #include "policy.h" 9 | #include 10 | #include 11 | 12 | int security_deny_unknown(void) 13 | { 14 | int fd, ret, deny_unknown = 0; 15 | char path[PATH_MAX]; 16 | char buf[20]; 17 | 18 | if (!selinux_mnt) { 19 | errno = ENOENT; 20 | return -1; 21 | } 22 | 23 | snprintf(path, sizeof(path), "%s/deny_unknown", selinux_mnt); 24 | fd = open(path, O_RDONLY); 25 | if (fd < 0) 26 | return -1; 27 | 28 | memset(buf, 0, sizeof(buf)); 29 | ret = read(fd, buf, sizeof(buf) - 1); 30 | close(fd); 31 | if (ret < 0) 32 | return -1; 33 | 34 | if (sscanf(buf, "%d", &deny_unknown) != 1) 35 | return -1; 36 | 37 | return deny_unknown; 38 | } 39 | 40 | hidden_def(security_deny_unknown); 41 | -------------------------------------------------------------------------------- /Superuser/jni/libselinux/src/disable.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "selinux_internal.h" 8 | #include "policy.h" 9 | #include 10 | #include 11 | 12 | int security_disable(void) 13 | { 14 | int fd, ret; 15 | char path[PATH_MAX]; 16 | char buf[20]; 17 | 18 | if (!selinux_mnt) { 19 | errno = ENOENT; 20 | return -1; 21 | } 22 | 23 | snprintf(path, sizeof path, "%s/disable", selinux_mnt); 24 | fd = open(path, O_WRONLY); 25 | if (fd < 0) 26 | return -1; 27 | 28 | buf[0] = '1'; 29 | buf[1] = '\0'; 30 | ret = write(fd, buf, strlen(buf)); 31 | close(fd); 32 | if (ret < 0) 33 | return -1; 34 | 35 | return 0; 36 | } 37 | 38 | hidden_def(security_disable) 39 | -------------------------------------------------------------------------------- /Superuser/jni/libselinux/src/dso.h: -------------------------------------------------------------------------------- 1 | #ifndef _SELINUX_DSO_H 2 | #define _SELINUX_DSO_H 1 3 | 4 | #ifdef SHARED 5 | # define hidden __attribute__ ((visibility ("hidden"))) 6 | # define hidden_proto(fct) __hidden_proto (fct, fct##_internal) 7 | # define __hidden_proto(fct, internal) \ 8 | extern __typeof (fct) internal; \ 9 | extern __typeof (fct) fct __asm (#internal) hidden; 10 | # if defined(__alpha__) || defined(__mips__) 11 | # define hidden_def(fct) \ 12 | asm (".globl " #fct "\n" #fct " = " #fct "_internal"); 13 | # else 14 | # define hidden_def(fct) \ 15 | asm (".globl " #fct "\n.set " #fct ", " #fct "_internal"); 16 | #endif 17 | #else 18 | # define hidden 19 | # define hidden_proto(fct) 20 | # define hidden_def(fct) 21 | #endif 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /Superuser/jni/libselinux/src/fgetfilecon.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "selinux_internal.h" 8 | #include "policy.h" 9 | 10 | int fgetfilecon(int fd, char ** context) 11 | { 12 | char *buf; 13 | ssize_t size; 14 | ssize_t ret; 15 | 16 | size = INITCONTEXTLEN + 1; 17 | buf = malloc(size); 18 | if (!buf) 19 | return -1; 20 | memset(buf, 0, size); 21 | 22 | ret = fgetxattr(fd, XATTR_NAME_SELINUX, buf, size - 1); 23 | if (ret < 0 && errno == ERANGE) { 24 | char *newbuf; 25 | 26 | size = fgetxattr(fd, XATTR_NAME_SELINUX, NULL, 0); 27 | if (size < 0) 28 | goto out; 29 | 30 | size++; 31 | newbuf = realloc(buf, size); 32 | if (!newbuf) 33 | goto out; 34 | 35 | buf = newbuf; 36 | memset(buf, 0, size); 37 | ret = fgetxattr(fd, XATTR_NAME_SELINUX, buf, size - 1); 38 | } 39 | out: 40 | if (ret == 0) { 41 | /* Re-map empty attribute values to errors. */ 42 | errno = EOPNOTSUPP; 43 | ret = -1; 44 | } 45 | if (ret < 0) 46 | free(buf); 47 | else 48 | *context = buf; 49 | return ret; 50 | } 51 | 52 | -------------------------------------------------------------------------------- /Superuser/jni/libselinux/src/freecon.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "selinux_internal.h" 3 | #include 4 | #include 5 | 6 | void freecon(char * con) 7 | { 8 | free(con); 9 | } 10 | 11 | hidden_def(freecon) 12 | -------------------------------------------------------------------------------- /Superuser/jni/libselinux/src/fsetfilecon.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "selinux_internal.h" 8 | #include "policy.h" 9 | 10 | int fsetfilecon(int fd, const char *context) 11 | { 12 | return fsetxattr(fd, XATTR_NAME_SELINUX, context, strlen(context) + 1, 13 | 0); 14 | } 15 | 16 | -------------------------------------------------------------------------------- /Superuser/jni/libselinux/src/get_initial_context.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "selinux_internal.h" 9 | #include "policy.h" 10 | #include 11 | 12 | #define SELINUX_INITCON_DIR "/initial_contexts/" 13 | 14 | int security_get_initial_context(const char * name, char ** con) 15 | { 16 | char path[PATH_MAX]; 17 | char *buf; 18 | size_t size; 19 | int fd, ret; 20 | 21 | if (!selinux_mnt) { 22 | errno = ENOENT; 23 | return -1; 24 | } 25 | 26 | snprintf(path, sizeof path, "%s%s%s", 27 | selinux_mnt, SELINUX_INITCON_DIR, name); 28 | fd = open(path, O_RDONLY); 29 | if (fd < 0) 30 | return -1; 31 | 32 | size = selinux_page_size; 33 | buf = malloc(size); 34 | if (!buf) { 35 | ret = -1; 36 | goto out; 37 | } 38 | memset(buf, 0, size); 39 | ret = read(fd, buf, size - 1); 40 | if (ret < 0) 41 | goto out2; 42 | 43 | *con = strdup(buf); 44 | if (!(*con)) { 45 | ret = -1; 46 | goto out2; 47 | } 48 | ret = 0; 49 | out2: 50 | free(buf); 51 | out: 52 | close(fd); 53 | return ret; 54 | } 55 | 56 | -------------------------------------------------------------------------------- /Superuser/jni/libselinux/src/getenforce.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "selinux_internal.h" 8 | #include "policy.h" 9 | #include 10 | #include 11 | 12 | int security_getenforce(void) 13 | { 14 | int fd, ret, enforce = 0; 15 | char path[PATH_MAX]; 16 | char buf[20]; 17 | 18 | if (!selinux_mnt) { 19 | errno = ENOENT; 20 | return -1; 21 | } 22 | 23 | snprintf(path, sizeof path, "%s/enforce", selinux_mnt); 24 | fd = open(path, O_RDONLY); 25 | if (fd < 0) 26 | return -1; 27 | 28 | memset(buf, 0, sizeof buf); 29 | ret = read(fd, buf, sizeof buf - 1); 30 | close(fd); 31 | if (ret < 0) 32 | return -1; 33 | 34 | if (sscanf(buf, "%d", &enforce) != 1) 35 | return -1; 36 | 37 | return enforce; 38 | } 39 | 40 | hidden_def(security_getenforce) 41 | -------------------------------------------------------------------------------- /Superuser/jni/libselinux/src/getfilecon.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "selinux_internal.h" 5 | #include 6 | #include 7 | #include 8 | #include "policy.h" 9 | 10 | int getfilecon(const char *path, char ** context) 11 | { 12 | char *buf; 13 | ssize_t size; 14 | ssize_t ret; 15 | 16 | size = INITCONTEXTLEN + 1; 17 | buf = malloc(size); 18 | if (!buf) 19 | return -1; 20 | memset(buf, 0, size); 21 | 22 | ret = getxattr(path, XATTR_NAME_SELINUX, buf, size - 1); 23 | if (ret < 0 && errno == ERANGE) { 24 | char *newbuf; 25 | 26 | size = getxattr(path, XATTR_NAME_SELINUX, NULL, 0); 27 | if (size < 0) 28 | goto out; 29 | 30 | size++; 31 | newbuf = realloc(buf, size); 32 | if (!newbuf) 33 | goto out; 34 | 35 | buf = newbuf; 36 | memset(buf, 0, size); 37 | ret = getxattr(path, XATTR_NAME_SELINUX, buf, size - 1); 38 | } 39 | out: 40 | if (ret == 0) { 41 | /* Re-map empty attribute values to errors. */ 42 | errno = EOPNOTSUPP; 43 | ret = -1; 44 | } 45 | if (ret < 0) 46 | free(buf); 47 | else 48 | *context = buf; 49 | return ret; 50 | } 51 | -------------------------------------------------------------------------------- /Superuser/jni/libselinux/src/getpeercon.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "selinux_internal.h" 8 | #include "policy.h" 9 | 10 | #ifndef SO_PEERSEC 11 | #define SO_PEERSEC 31 12 | #endif 13 | 14 | int getpeercon(int fd, char ** context) 15 | { 16 | char *buf; 17 | socklen_t size; 18 | ssize_t ret; 19 | 20 | size = INITCONTEXTLEN + 1; 21 | buf = malloc(size); 22 | if (!buf) 23 | return -1; 24 | memset(buf, 0, size); 25 | 26 | ret = getsockopt(fd, SOL_SOCKET, SO_PEERSEC, buf, &size); 27 | if (ret < 0 && errno == ERANGE) { 28 | char *newbuf; 29 | 30 | newbuf = realloc(buf, size); 31 | if (!newbuf) 32 | goto out; 33 | 34 | buf = newbuf; 35 | memset(buf, 0, size); 36 | ret = getsockopt(fd, SOL_SOCKET, SO_PEERSEC, buf, &size); 37 | } 38 | out: 39 | if (ret < 0) 40 | free(buf); 41 | else 42 | *context = buf; 43 | return ret; 44 | } 45 | 46 | -------------------------------------------------------------------------------- /Superuser/jni/libselinux/src/lgetfilecon.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "selinux_internal.h" 8 | #include "policy.h" 9 | 10 | int lgetfilecon(const char *path, char ** context) 11 | { 12 | char *buf; 13 | ssize_t size; 14 | ssize_t ret; 15 | 16 | size = INITCONTEXTLEN + 1; 17 | buf = malloc(size); 18 | if (!buf) 19 | return -1; 20 | memset(buf, 0, size); 21 | 22 | ret = lgetxattr(path, XATTR_NAME_SELINUX, buf, size - 1); 23 | if (ret < 0 && errno == ERANGE) { 24 | char *newbuf; 25 | 26 | size = lgetxattr(path, XATTR_NAME_SELINUX, NULL, 0); 27 | if (size < 0) 28 | goto out; 29 | 30 | size++; 31 | newbuf = realloc(buf, size); 32 | if (!newbuf) 33 | goto out; 34 | 35 | buf = newbuf; 36 | memset(buf, 0, size); 37 | ret = lgetxattr(path, XATTR_NAME_SELINUX, buf, size - 1); 38 | } 39 | out: 40 | if (ret == 0) { 41 | /* Re-map empty attribute values to errors. */ 42 | errno = EOPNOTSUPP; 43 | ret = -1; 44 | } 45 | if (ret < 0) 46 | free(buf); 47 | else 48 | *context = buf; 49 | return ret; 50 | } 51 | -------------------------------------------------------------------------------- /Superuser/jni/libselinux/src/load_policy.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include "selinux_internal.h" 14 | #include 15 | #include "policy.h" 16 | #include 17 | #include "callbacks.h" 18 | 19 | int security_load_policy(void *data, size_t len) 20 | { 21 | char path[PATH_MAX]; 22 | int fd, ret; 23 | 24 | if (!selinux_mnt) { 25 | errno = ENOENT; 26 | return -1; 27 | } 28 | 29 | snprintf(path, sizeof path, "%s/load", selinux_mnt); 30 | fd = open(path, O_RDWR); 31 | if (fd < 0) 32 | return -1; 33 | 34 | ret = write(fd, data, len); 35 | close(fd); 36 | if (ret < 0) 37 | return -1; 38 | return 0; 39 | } 40 | 41 | hidden_def(security_load_policy) 42 | -------------------------------------------------------------------------------- /Superuser/jni/libselinux/src/lsetfilecon.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "selinux_internal.h" 8 | #include "policy.h" 9 | 10 | int lsetfilecon(const char *path, const char *context) 11 | { 12 | return lsetxattr(path, XATTR_NAME_SELINUX, context, strlen(context) + 1, 13 | 0); 14 | } 15 | 16 | -------------------------------------------------------------------------------- /Superuser/jni/libselinux/src/mapping.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file describes the class and permission mappings used to 3 | * hide the kernel numbers from userspace by allowing userspace object 4 | * managers to specify a list of classes and permissions. 5 | */ 6 | #ifndef _SELINUX_MAPPING_H_ 7 | #define _SELINUX_MAPPING_H_ 8 | 9 | #include 10 | 11 | /* 12 | * Get real, kernel values from mapped values 13 | */ 14 | 15 | extern security_class_t 16 | unmap_class(security_class_t tclass); 17 | 18 | extern access_vector_t 19 | unmap_perm(security_class_t tclass, access_vector_t tperm); 20 | 21 | /* 22 | * Get mapped values from real, kernel values 23 | */ 24 | 25 | extern security_class_t 26 | map_class(security_class_t kclass); 27 | 28 | extern access_vector_t 29 | map_perm(security_class_t tclass, access_vector_t kperm); 30 | 31 | extern void 32 | map_decision(security_class_t tclass, struct av_decision *avd); 33 | 34 | /*mapping is not used for embedded build*/ 35 | #ifdef DISABLE_AVC 36 | #define unmap_perm(x,y) y 37 | #define unmap_class(x) x 38 | #define map_decision(x,y) 39 | #endif 40 | 41 | #endif /* _SELINUX_MAPPING_H_ */ 42 | -------------------------------------------------------------------------------- /Superuser/jni/libselinux/src/policy.h: -------------------------------------------------------------------------------- 1 | #ifndef _POLICY_H_ 2 | #define _POLICY_H_ 3 | 4 | /* Private definitions used internally by libselinux. */ 5 | 6 | /* xattr name for SELinux attributes. */ 7 | #define XATTR_NAME_SELINUX "security.selinux" 8 | 9 | /* Initial length guess for getting contexts. */ 10 | #define INITCONTEXTLEN 255 11 | 12 | /* selinuxfs magic number */ 13 | #define SELINUX_MAGIC 0xf97cff8c 14 | 15 | /* Preferred selinuxfs mount point directory paths. */ 16 | #define SELINUXMNT "/sys/fs/selinux" 17 | #define OLDSELINUXMNT "/selinux" 18 | 19 | /* selinuxfs filesystem type string. */ 20 | #define SELINUXFS "selinuxfs" 21 | 22 | /* selinuxfs mount point determined at runtime */ 23 | extern char *selinux_mnt; 24 | 25 | /* First version of policy supported in mainline Linux. */ 26 | #define DEFAULT_POLICY_VERSION 15 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /Superuser/jni/libselinux/src/policyvers.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "selinux_internal.h" 8 | #include 9 | #include "policy.h" 10 | #include "dso.h" 11 | #include 12 | 13 | int security_policyvers(void) 14 | { 15 | int fd, ret; 16 | char path[PATH_MAX]; 17 | char buf[20]; 18 | unsigned vers = DEFAULT_POLICY_VERSION; 19 | 20 | if (!selinux_mnt) { 21 | errno = ENOENT; 22 | return -1; 23 | } 24 | 25 | snprintf(path, sizeof path, "%s/policyvers", selinux_mnt); 26 | fd = open(path, O_RDONLY); 27 | if (fd < 0) { 28 | if (errno == ENOENT) 29 | return vers; 30 | else 31 | return -1; 32 | } 33 | memset(buf, 0, sizeof buf); 34 | ret = read(fd, buf, sizeof buf - 1); 35 | close(fd); 36 | if (ret < 0) 37 | return -1; 38 | 39 | if (sscanf(buf, "%u", &vers) != 1) 40 | return -1; 41 | 42 | return vers; 43 | } 44 | 45 | hidden_def(security_policyvers) 46 | -------------------------------------------------------------------------------- /Superuser/jni/libselinux/src/selinux_netlink.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Netlink event notifications for SELinux. 3 | * 4 | * Author: James Morris 5 | */ 6 | #ifndef _LINUX_SELINUX_NETLINK_H 7 | #define _LINUX_SELINUX_NETLINK_H 8 | 9 | /* Message types. */ 10 | #define SELNL_MSG_BASE 0x10 11 | enum { 12 | SELNL_MSG_SETENFORCE = SELNL_MSG_BASE, 13 | SELNL_MSG_POLICYLOAD, 14 | SELNL_MSG_MAX 15 | }; 16 | 17 | /* Multicast groups */ 18 | #define SELNL_GRP_NONE 0x00000000 19 | #define SELNL_GRP_AVC 0x00000001 /* AVC notifications */ 20 | #define SELNL_GRP_ALL 0xffffffff 21 | 22 | /* Message structures */ 23 | struct selnl_msg_setenforce { 24 | int32_t val; 25 | }; 26 | 27 | struct selnl_msg_policyload { 28 | uint32_t seqno; 29 | }; 30 | 31 | #endif /* _LINUX_SELINUX_NETLINK_H */ 32 | -------------------------------------------------------------------------------- /Superuser/jni/libselinux/src/setenforce.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "selinux_internal.h" 8 | #include "policy.h" 9 | #include 10 | #include 11 | 12 | int security_setenforce(int value) 13 | { 14 | int fd, ret; 15 | char path[PATH_MAX]; 16 | char buf[20]; 17 | 18 | if (!selinux_mnt) { 19 | errno = ENOENT; 20 | return -1; 21 | } 22 | 23 | snprintf(path, sizeof path, "%s/enforce", selinux_mnt); 24 | fd = open(path, O_RDWR); 25 | if (fd < 0) 26 | return -1; 27 | 28 | snprintf(buf, sizeof buf, "%d", value); 29 | ret = write(fd, buf, strlen(buf)); 30 | close(fd); 31 | if (ret < 0) 32 | return -1; 33 | 34 | return 0; 35 | } 36 | 37 | hidden_def(security_setenforce) 38 | -------------------------------------------------------------------------------- /Superuser/jni/libselinux/src/setfilecon.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "selinux_internal.h" 8 | #include "policy.h" 9 | 10 | int setfilecon(const char *path, const char *context) 11 | { 12 | return setxattr(path, XATTR_NAME_SELINUX, context, strlen(context) + 1, 13 | 0); 14 | } 15 | 16 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/.Android.mk.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/.Android.mk.swp -------------------------------------------------------------------------------- /Superuser/jni/libsepol/.gitignore: -------------------------------------------------------------------------------- 1 | utils/chkcon 2 | libsepol.map 3 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | 3 | base_src_files := \ 4 | src/assertion.c \ 5 | src/avrule_block.c \ 6 | src/avtab.c \ 7 | src/boolean_record.c \ 8 | src/booleans.c \ 9 | src/conditional.c \ 10 | src/constraint.c \ 11 | src/context.c \ 12 | src/context_record.c \ 13 | src/debug.c \ 14 | src/ebitmap.c \ 15 | src/expand.c \ 16 | src/genbools.c \ 17 | src/handle.c \ 18 | src/hashtab.c \ 19 | src/hierarchy.c \ 20 | src/iface_record.c \ 21 | src/interfaces.c \ 22 | src/link.c \ 23 | src/mls.c \ 24 | src/module.c \ 25 | src/node_record.c \ 26 | src/nodes.c \ 27 | src/polcaps.c \ 28 | src/policydb.c \ 29 | src/policydb_convert.c \ 30 | src/policydb_public.c \ 31 | src/port_record.c \ 32 | src/ports.c \ 33 | src/roles.c \ 34 | src/services.c \ 35 | src/sidtab.c \ 36 | src/symtab.c \ 37 | src/user_record.c \ 38 | src/users.c \ 39 | src/util.c \ 40 | src/write.c 41 | 42 | common_src_files := $(base_src_files) \ 43 | src/genusers.c 44 | 45 | common_cflags := \ 46 | -Wall -W -Wundef \ 47 | -Wshadow -Wmissing-noreturn \ 48 | -Wmissing-format-attribute 49 | 50 | common_includes := \ 51 | $(LOCAL_PATH)/include/ \ 52 | $(LOCAL_PATH)/src/ 53 | 54 | include $(CLEAR_VARS) 55 | 56 | LOCAL_MODULE := libsepol 57 | LOCAL_MODULE_TAGS := optional 58 | LOCAL_C_INCLUDES := $(common_includes) 59 | LOCAL_CFLAGS := $(common_cflags) 60 | LOCAL_SRC_FILES := $(base_src_files) 61 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES 62 | 63 | include $(BUILD_STATIC_LIBRARY) 64 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/Makefile: -------------------------------------------------------------------------------- 1 | DISABLE_CIL ?= n 2 | 3 | export DISABLE_CIL 4 | 5 | all: 6 | $(MAKE) -C src 7 | $(MAKE) -C utils 8 | 9 | install: 10 | $(MAKE) -C include install 11 | $(MAKE) -C src install 12 | $(MAKE) -C utils install 13 | $(MAKE) -C man install 14 | 15 | relabel: 16 | $(MAKE) -C src relabel 17 | 18 | clean: 19 | $(MAKE) -C src clean 20 | $(MAKE) -C utils clean 21 | $(MAKE) -C tests clean 22 | 23 | indent: 24 | $(MAKE) -C src $@ 25 | $(MAKE) -C include $@ 26 | $(MAKE) -C utils $@ 27 | 28 | test: 29 | $(MAKE) -C tests test 30 | 31 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/VERSION: -------------------------------------------------------------------------------- 1 | 2.4 2 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/include/Makefile: -------------------------------------------------------------------------------- 1 | # Installation directories. 2 | PREFIX ?= $(DESTDIR)/usr 3 | INCDIR ?= $(PREFIX)/include/sepol 4 | CILDIR ?= ../cil 5 | 6 | all: 7 | 8 | install: all 9 | test -d $(INCDIR) || install -m 755 -d $(INCDIR) 10 | test -d $(INCDIR)/policydb || install -m 755 -d $(INCDIR)/policydb 11 | test -d $(INCDIR)/cil || install -m 755 -d $(INCDIR)/cil 12 | install -m 644 $(wildcard sepol/*.h) $(INCDIR) 13 | install -m 644 $(wildcard sepol/policydb/*.h) $(INCDIR)/policydb 14 | install -m 644 $(wildcard $(CILDIR)/include/cil/*.h) $(INCDIR)/cil 15 | 16 | indent: 17 | ../../scripts/Lindent $(wildcard sepol/*.h) 18 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/include/sepol/boolean_record.h: -------------------------------------------------------------------------------- 1 | #ifndef _SEPOL_BOOLEAN_RECORD_H_ 2 | #define _SEPOL_BOOLEAN_RECORD_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | __BEGIN_DECLS 9 | 10 | struct sepol_bool; 11 | struct sepol_bool_key; 12 | typedef struct sepol_bool sepol_bool_t; 13 | typedef struct sepol_bool_key sepol_bool_key_t; 14 | 15 | /* Key */ 16 | extern int sepol_bool_key_create(sepol_handle_t * handle, 17 | const char *name, sepol_bool_key_t ** key); 18 | 19 | extern void sepol_bool_key_unpack(const sepol_bool_key_t * key, 20 | const char **name); 21 | 22 | extern int sepol_bool_key_extract(sepol_handle_t * handle, 23 | const sepol_bool_t * boolean, 24 | sepol_bool_key_t ** key_ptr); 25 | 26 | extern void sepol_bool_key_free(sepol_bool_key_t * key); 27 | 28 | extern int sepol_bool_compare(const sepol_bool_t * boolean, 29 | const sepol_bool_key_t * key); 30 | 31 | extern int sepol_bool_compare2(const sepol_bool_t * boolean, 32 | const sepol_bool_t * boolean2); 33 | 34 | /* Name */ 35 | extern const char *sepol_bool_get_name(const sepol_bool_t * boolean); 36 | 37 | extern int sepol_bool_set_name(sepol_handle_t * handle, 38 | sepol_bool_t * boolean, const char *name); 39 | 40 | /* Value */ 41 | extern int sepol_bool_get_value(const sepol_bool_t * boolean); 42 | 43 | extern void sepol_bool_set_value(sepol_bool_t * boolean, int value); 44 | 45 | /* Create/Clone/Destroy */ 46 | extern int sepol_bool_create(sepol_handle_t * handle, sepol_bool_t ** bool_ptr); 47 | 48 | extern int sepol_bool_clone(sepol_handle_t * handle, 49 | const sepol_bool_t * boolean, 50 | sepol_bool_t ** bool_ptr); 51 | 52 | extern void sepol_bool_free(sepol_bool_t * boolean); 53 | 54 | __END_DECLS 55 | #endif 56 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/include/sepol/context.h: -------------------------------------------------------------------------------- 1 | #ifndef _SEPOL_CONTEXT_H_ 2 | #define _SEPOL_CONTEXT_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | __BEGIN_DECLS 10 | 11 | /* -- Deprecated -- */ 12 | 13 | extern int sepol_check_context(const char *context); 14 | 15 | /* -- End deprecated -- */ 16 | 17 | extern int sepol_context_check(sepol_handle_t * handle, 18 | const sepol_policydb_t * policydb, 19 | const sepol_context_t * context); 20 | 21 | extern int sepol_mls_contains(sepol_handle_t * handle, 22 | const sepol_policydb_t * policydb, 23 | const char *mls1, 24 | const char *mls2, int *response); 25 | 26 | extern int sepol_mls_check(sepol_handle_t * handle, 27 | const sepol_policydb_t * policydb, const char *mls); 28 | 29 | __END_DECLS 30 | #endif 31 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/include/sepol/context_record.h: -------------------------------------------------------------------------------- 1 | #ifndef _SEPOL_CONTEXT_RECORD_H_ 2 | #define _SEPOL_CONTEXT_RECORD_H_ 3 | 4 | #include 5 | #include 6 | 7 | __BEGIN_DECLS 8 | 9 | struct sepol_context; 10 | typedef struct sepol_context sepol_context_t; 11 | 12 | /* We don't need a key, because the context is never stored 13 | * in a data collection by itself */ 14 | 15 | /* User */ 16 | extern const char *sepol_context_get_user(const sepol_context_t * con); 17 | 18 | extern int sepol_context_set_user(sepol_handle_t * handle, 19 | sepol_context_t * con, const char *user); 20 | 21 | /* Role */ 22 | extern const char *sepol_context_get_role(const sepol_context_t * con); 23 | 24 | extern int sepol_context_set_role(sepol_handle_t * handle, 25 | sepol_context_t * con, const char *role); 26 | 27 | /* Type */ 28 | extern const char *sepol_context_get_type(const sepol_context_t * con); 29 | 30 | extern int sepol_context_set_type(sepol_handle_t * handle, 31 | sepol_context_t * con, const char *type); 32 | 33 | /* MLS */ 34 | extern const char *sepol_context_get_mls(const sepol_context_t * con); 35 | 36 | extern int sepol_context_set_mls(sepol_handle_t * handle, 37 | sepol_context_t * con, const char *mls_range); 38 | 39 | /* Create/Clone/Destroy */ 40 | extern int sepol_context_create(sepol_handle_t * handle, 41 | sepol_context_t ** con_ptr); 42 | 43 | extern int sepol_context_clone(sepol_handle_t * handle, 44 | const sepol_context_t * con, 45 | sepol_context_t ** con_ptr); 46 | 47 | extern void sepol_context_free(sepol_context_t * con); 48 | 49 | /* Parse to/from string */ 50 | extern int sepol_context_from_string(sepol_handle_t * handle, 51 | const char *str, sepol_context_t ** con); 52 | 53 | extern int sepol_context_to_string(sepol_handle_t * handle, 54 | const sepol_context_t * con, char **str_ptr); 55 | 56 | __END_DECLS 57 | #endif 58 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/include/sepol/debug.h: -------------------------------------------------------------------------------- 1 | #ifndef _SEPOL_DEBUG_H_ 2 | #define _SEPOL_DEBUG_H_ 3 | 4 | #include 5 | #include 6 | 7 | __BEGIN_DECLS 8 | 9 | /* Deprecated */ 10 | extern void sepol_debug(int on); 11 | /* End deprecated */ 12 | 13 | #define SEPOL_MSG_ERR 1 14 | #define SEPOL_MSG_WARN 2 15 | #define SEPOL_MSG_INFO 3 16 | 17 | extern int sepol_msg_get_level(sepol_handle_t * handle); 18 | 19 | extern const char *sepol_msg_get_channel(sepol_handle_t * handle); 20 | 21 | extern const char *sepol_msg_get_fname(sepol_handle_t * handle); 22 | 23 | /* Set the messaging callback. 24 | * By the default, the callback will print 25 | * the message on standard output, in a 26 | * particular format. Passing NULL here 27 | * indicates that messaging should be suppressed */ 28 | extern void sepol_msg_set_callback(sepol_handle_t * handle, 29 | #ifdef __GNUC__ 30 | __attribute__ ((format(printf, 3, 4))) 31 | #endif 32 | void (*msg_callback) (void *varg, 33 | sepol_handle_t * 34 | handle, 35 | const char *fmt, ...), 36 | void *msg_callback_arg); 37 | 38 | __END_DECLS 39 | #endif 40 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/include/sepol/errcodes.h: -------------------------------------------------------------------------------- 1 | /* Author: Karl MacMillan */ 2 | 3 | #ifndef __sepol_errno_h__ 4 | #define __sepol_errno_h__ 5 | 6 | #include 7 | #include 8 | 9 | __BEGIN_DECLS 10 | 11 | #define SEPOL_OK 0 12 | 13 | /* These first error codes are defined for compatibility with 14 | * previous version of libsepol. In the future, custome error 15 | * codes that don't map to system error codes should be defined 16 | * outside of the range of system error codes. 17 | */ 18 | #define SEPOL_ERR -1 19 | #define SEPOL_ENOTSUP -2 /* feature not supported in module language */ 20 | #define SEPOL_EREQ -3 /* requirements not met */ 21 | 22 | /* Error codes that map to system error codes */ 23 | #define SEPOL_ENOMEM -ENOMEM 24 | #define SEPOL_ERANGE -ERANGE 25 | #define SEPOL_EEXIST -EEXIST 26 | #define SEPOL_ENOENT -ENOENT 27 | 28 | __END_DECLS 29 | #endif 30 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/include/sepol/handle.h: -------------------------------------------------------------------------------- 1 | #ifndef _SEPOL_HANDLE_H_ 2 | #define _SEPOL_HANDLE_H_ 3 | 4 | #include 5 | 6 | __BEGIN_DECLS 7 | 8 | struct sepol_handle; 9 | typedef struct sepol_handle sepol_handle_t; 10 | 11 | /* Create and return a sepol handle. */ 12 | sepol_handle_t *sepol_handle_create(void); 13 | 14 | /* Get whether or not dontaudits will be disabled, same values as 15 | * specified by set_disable_dontaudit. This value reflects the state 16 | * your system will be set to upon commit, not necessarily its 17 | * current state.*/ 18 | int sepol_get_disable_dontaudit(sepol_handle_t * sh); 19 | 20 | /* Set whether or not to disable dontaudits, 0 is default and does 21 | * not disable dontaudits, 1 disables them */ 22 | void sepol_set_disable_dontaudit(sepol_handle_t * sh, int disable_dontaudit); 23 | 24 | /* Set whether module_expand() should consume the base policy passed in. 25 | * This should reduce the amount of memory required to expand the policy. */ 26 | void sepol_set_expand_consume_base(sepol_handle_t * sh, int consume_base); 27 | 28 | /* Destroy a sepol handle. */ 29 | void sepol_handle_destroy(sepol_handle_t *); 30 | 31 | /* Get whether or not needless unused branch of tunables would be preserved */ 32 | int sepol_get_preserve_tunables(sepol_handle_t * sh); 33 | 34 | /* Set whether or not to preserve the needless unused branch of tunables, 35 | * 0 is default and discard such branch, 1 preserves them */ 36 | void sepol_set_preserve_tunables(sepol_handle_t * sh, int preserve_tunables); 37 | 38 | __END_DECLS 39 | #endif 40 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/include/sepol/interfaces.h: -------------------------------------------------------------------------------- 1 | #ifndef __SEPOL_INTERFACES_H_ 2 | #define __SEPOL_INTERFACES_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | __BEGIN_DECLS 10 | 11 | /* Return the number of interfaces */ 12 | extern int sepol_iface_count(sepol_handle_t * handle, 13 | const sepol_policydb_t * policydb, 14 | unsigned int *response); 15 | 16 | /* Check if an interface exists */ 17 | extern int sepol_iface_exists(sepol_handle_t * handle, 18 | const sepol_policydb_t * policydb, 19 | const sepol_iface_key_t * key, int *response); 20 | 21 | /* Query an interface - returns the interface, 22 | * or NULL if not found */ 23 | extern int sepol_iface_query(sepol_handle_t * handle, 24 | const sepol_policydb_t * policydb, 25 | const sepol_iface_key_t * key, 26 | sepol_iface_t ** response); 27 | 28 | /* Modify an interface, or add it, if the key 29 | * is not found */ 30 | extern int sepol_iface_modify(sepol_handle_t * handle, 31 | sepol_policydb_t * policydb, 32 | const sepol_iface_key_t * key, 33 | const sepol_iface_t * data); 34 | 35 | /* Iterate the interfaces 36 | * The handler may return: 37 | * -1 to signal an error condition, 38 | * 1 to signal successful exit 39 | * 0 to signal continue */ 40 | 41 | extern int sepol_iface_iterate(sepol_handle_t * handle, 42 | const sepol_policydb_t * policydb, 43 | int (*fn) (const sepol_iface_t * iface, 44 | void *fn_arg), void *arg); 45 | 46 | __END_DECLS 47 | #endif 48 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/include/sepol/nodes.h: -------------------------------------------------------------------------------- 1 | #ifndef _SEPOL_NODES_H_ 2 | #define _SEPOL_NODES_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | __BEGIN_DECLS 10 | 11 | /* Return the number of nodes */ 12 | extern int sepol_node_count(sepol_handle_t * handle, 13 | const sepol_policydb_t * p, unsigned int *response); 14 | 15 | /* Check if a node exists */ 16 | extern int sepol_node_exists(sepol_handle_t * handle, 17 | const sepol_policydb_t * policydb, 18 | const sepol_node_key_t * key, int *response); 19 | 20 | /* Query a node - returns the node, or NULL if not found */ 21 | extern int sepol_node_query(sepol_handle_t * handle, 22 | const sepol_policydb_t * policydb, 23 | const sepol_node_key_t * key, 24 | sepol_node_t ** response); 25 | 26 | /* Modify a node, or add it, if the key is not found */ 27 | extern int sepol_node_modify(sepol_handle_t * handle, 28 | sepol_policydb_t * policydb, 29 | const sepol_node_key_t * key, 30 | const sepol_node_t * data); 31 | 32 | /* Iterate the nodes 33 | * The handler may return: 34 | * -1 to signal an error condition, 35 | * 1 to signal successful exit 36 | * 0 to signal continue */ 37 | 38 | extern int sepol_node_iterate(sepol_handle_t * handle, 39 | const sepol_policydb_t * policydb, 40 | int (*fn) (const sepol_node_t * node, 41 | void *fn_arg), void *arg); 42 | 43 | __END_DECLS 44 | #endif 45 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/include/sepol/policydb/avrule_block.h: -------------------------------------------------------------------------------- 1 | /* Authors: Jason Tang 2 | * 3 | * Copyright (C) 2005 Tresys Technology, LLC 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef _SEPOL_AVRULE_BLOCK_H_ 21 | #define _SEPOL_AVRULE_BLOCK_H_ 22 | 23 | #include 24 | #include 25 | 26 | __BEGIN_DECLS 27 | 28 | extern avrule_block_t *avrule_block_create(void); 29 | extern void avrule_block_destroy(avrule_block_t * x); 30 | extern avrule_decl_t *avrule_decl_create(uint32_t decl_id); 31 | extern void avrule_decl_destroy(avrule_decl_t * x); 32 | extern void avrule_block_list_destroy(avrule_block_t * x); 33 | extern avrule_decl_t *get_avrule_decl(policydb_t * p, uint32_t decl_id); 34 | extern cond_list_t *get_decl_cond_list(policydb_t * p, 35 | avrule_decl_t * decl, 36 | cond_list_t * cond); 37 | extern int is_id_enabled(char *id, policydb_t * p, int symbol_table); 38 | extern int is_perm_enabled(char *class_id, char *perm_id, policydb_t * p); 39 | 40 | __END_DECLS 41 | #endif 42 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/include/sepol/policydb/hierarchy.h: -------------------------------------------------------------------------------- 1 | /* Authors: Jason Tang 2 | * Joshua Brindle 3 | * Karl MacMillan 4 | * 5 | * A set of utility functions that aid policy decision when dealing 6 | * with hierarchal items. 7 | * 8 | * Copyright (C) 2005 Tresys Technology, LLC 9 | * 10 | * This library is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU Lesser General Public 12 | * License as published by the Free Software Foundation; either 13 | * version 2.1 of the License, or (at your option) any later version. 14 | * 15 | * This library is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | * Lesser General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Lesser General Public 21 | * License along with this library; if not, write to the Free Software 22 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 23 | */ 24 | 25 | #ifndef _SEPOL_POLICYDB_HIERARCHY_H_ 26 | #define _SEPOL_POLICYDB_HIERARCHY_H_ 27 | 28 | #include 29 | #include 30 | 31 | __BEGIN_DECLS 32 | 33 | extern int hierarchy_check_constraints(sepol_handle_t * handle, policydb_t * p); 34 | 35 | __END_DECLS 36 | #endif 37 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/include/sepol/policydb/link.h: -------------------------------------------------------------------------------- 1 | /* Authors: Jason Tang 2 | * Joshua Brindle 3 | * Karl MacMillan 4 | */ 5 | 6 | #ifndef _SEPOL_POLICYDB_LINK_H 7 | #define _SEPOL_POLICYDB_LINK_H 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | 14 | #include 15 | #include 16 | 17 | __BEGIN_DECLS 18 | 19 | extern int link_modules(sepol_handle_t * handle, 20 | policydb_t * b, policydb_t ** mods, int len, 21 | int verbose); 22 | 23 | __END_DECLS 24 | #endif 25 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/include/sepol/policydb/module.h: -------------------------------------------------------------------------------- 1 | /* Author: Karl MacMillan 2 | * 3 | * Copyright (C) 2004-2005 Tresys Technology, LLC 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef _SEPOL_POLICYDB_MODULE_H_ 21 | #define _SEPOL_POLICYDB_MODULE_H_ 22 | 23 | #include 24 | #include 25 | 26 | #include 27 | 28 | #include 29 | #include 30 | #include 31 | 32 | #define SEPOL_MODULE_PACKAGE_MAGIC 0xf97cff8f 33 | 34 | __BEGIN_DECLS 35 | 36 | struct sepol_module_package { 37 | sepol_policydb_t *policy; 38 | uint32_t version; 39 | char *file_contexts; 40 | size_t file_contexts_len; 41 | char *seusers; 42 | size_t seusers_len; 43 | char *user_extra; 44 | size_t user_extra_len; 45 | char *netfilter_contexts; 46 | size_t netfilter_contexts_len; 47 | }; 48 | 49 | extern int sepol_module_package_init(sepol_module_package_t * p); 50 | 51 | __END_DECLS 52 | #endif 53 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/include/sepol/policydb/polcaps.h: -------------------------------------------------------------------------------- 1 | #ifndef _SEPOL_POLICYDB_POLCAPS_H_ 2 | #define _SEPOL_POLICYDB_POLCAPS_H_ 3 | 4 | #include 5 | 6 | __BEGIN_DECLS 7 | 8 | /* Policy capabilities */ 9 | enum { 10 | POLICYDB_CAPABILITY_NETPEER, 11 | POLICYDB_CAPABILITY_OPENPERM, 12 | POLICYDB_CAPABILITY_REDHAT1, /* reserved for RH testing of ptrace_child */ 13 | POLICYDB_CAPABILITY_ALWAYSNETWORK, 14 | __POLICYDB_CAPABILITY_MAX 15 | }; 16 | #define POLICYDB_CAPABILITY_MAX (__POLICYDB_CAPABILITY_MAX - 1) 17 | 18 | /* Convert a capability name to number. */ 19 | extern int sepol_polcap_getnum(const char *name); 20 | 21 | /* Convert a capability number to name. */ 22 | extern const char *sepol_polcap_getname(int capnum); 23 | 24 | __END_DECLS 25 | #endif /* _SEPOL_POLICYDB_POLCAPS_H_ */ 26 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/include/sepol/policydb/symtab.h: -------------------------------------------------------------------------------- 1 | 2 | /* Author : Stephen Smalley, */ 3 | 4 | /* FLASK */ 5 | 6 | /* 7 | * A symbol table (symtab) maintains associations between symbol 8 | * strings and datum values. The type of the datum values 9 | * is arbitrary. The symbol table type is implemented 10 | * using the hash table type (hashtab). 11 | */ 12 | 13 | #ifndef _SEPOL_POLICYDB_SYMTAB_H_ 14 | #define _SEPOL_POLICYDB_SYMTAB_H_ 15 | 16 | #include 17 | #include 18 | 19 | __BEGIN_DECLS 20 | 21 | /* The symtab_datum struct stores the common information for 22 | * all symtab datums. It should the first element in every 23 | * struct that will be used in a symtab to allow the specific 24 | * datum types to be freely cast to this type. 25 | * 26 | * The values start at 1 - 0 is never a valid value. 27 | */ 28 | typedef struct symtab_datum { 29 | uint32_t value; 30 | } symtab_datum_t; 31 | 32 | typedef struct { 33 | hashtab_t table; /* hash table (keyed on a string) */ 34 | uint32_t nprim; /* number of primary names in table */ 35 | } symtab_t; 36 | 37 | extern int symtab_init(symtab_t *, unsigned int size); 38 | extern void symtab_destroy(symtab_t *); 39 | 40 | __END_DECLS 41 | #endif /* _SYMTAB_H_ */ 42 | 43 | /* FLASK */ 44 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/include/sepol/policydb/util.h: -------------------------------------------------------------------------------- 1 | /* Authors: Karl MacMillan 2 | * 3 | * A set of utility functions that aid policy decision when dealing 4 | * with hierarchal namespaces. 5 | * 6 | * Copyright (C) 2006 Tresys Technology, LLC 7 | * 8 | * This library is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef __SEPOL_UTIL_H__ 24 | #define __SEPOL_UTIL_H__ 25 | 26 | #include 27 | 28 | __BEGIN_DECLS 29 | 30 | extern int add_i_to_a(uint32_t i, uint32_t * cnt, uint32_t ** a); 31 | 32 | extern char *sepol_av_to_string(policydb_t * policydbp, uint32_t tclass, 33 | sepol_access_vector_t av); 34 | 35 | __END_DECLS 36 | #endif 37 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/include/sepol/ports.h: -------------------------------------------------------------------------------- 1 | #ifndef _SEPOL_PORTS_H_ 2 | #define _SEPOL_PORTS_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | __BEGIN_DECLS 10 | 11 | /* Return the number of ports */ 12 | extern int sepol_port_count(sepol_handle_t * handle, 13 | const sepol_policydb_t * p, unsigned int *response); 14 | 15 | /* Check if a port exists */ 16 | extern int sepol_port_exists(sepol_handle_t * handle, 17 | const sepol_policydb_t * policydb, 18 | const sepol_port_key_t * key, int *response); 19 | 20 | /* Query a port - returns the port, or NULL if not found */ 21 | extern int sepol_port_query(sepol_handle_t * handle, 22 | const sepol_policydb_t * policydb, 23 | const sepol_port_key_t * key, 24 | sepol_port_t ** response); 25 | 26 | /* Modify a port, or add it, if the key is not found */ 27 | extern int sepol_port_modify(sepol_handle_t * handle, 28 | sepol_policydb_t * policydb, 29 | const sepol_port_key_t * key, 30 | const sepol_port_t * data); 31 | 32 | /* Iterate the ports 33 | * The handler may return: 34 | * -1 to signal an error condition, 35 | * 1 to signal successful exit 36 | * 0 to signal continue */ 37 | 38 | extern int sepol_port_iterate(sepol_handle_t * handle, 39 | const sepol_policydb_t * policydb, 40 | int (*fn) (const sepol_port_t * port, 41 | void *fn_arg), void *arg); 42 | 43 | __END_DECLS 44 | #endif 45 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/include/sepol/roles.h: -------------------------------------------------------------------------------- 1 | #ifndef _SEPOL_ROLES_H_ 2 | #define _SEPOL_ROLES_H_ 3 | 4 | #include 5 | 6 | __BEGIN_DECLS 7 | 8 | extern int sepol_role_exists(const sepol_policydb_t * policydb, 9 | const char *role, int *response); 10 | 11 | extern int sepol_role_list(const sepol_policydb_t * policydb, 12 | char ***roles, unsigned int *nroles); 13 | 14 | __END_DECLS 15 | #endif 16 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/include/sepol/sepol.h: -------------------------------------------------------------------------------- 1 | #ifndef _SEPOL_H_ 2 | #define _SEPOL_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | __BEGIN_DECLS 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | /* Set internal policydb from a file for subsequent service calls. */ 29 | extern int sepol_set_policydb_from_file(FILE * fp); 30 | 31 | __END_DECLS 32 | #endif 33 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/man/Makefile: -------------------------------------------------------------------------------- 1 | # Installation directories. 2 | MAN8DIR ?= $(DESTDIR)/usr/share/man/man8 3 | MAN3DIR ?= $(DESTDIR)/usr/share/man/man3 4 | 5 | all: 6 | 7 | install: all 8 | mkdir -p $(MAN3DIR) 9 | mkdir -p $(MAN8DIR) 10 | install -m 644 man3/*.3 $(MAN3DIR) 11 | install -m 644 man8/*.8 $(MAN8DIR) 12 | 13 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/man/man3/sepol_check_context.3: -------------------------------------------------------------------------------- 1 | .TH "sepol_check_context" "3" "15 March 2005" "sds@tycho.nsa.gov" "SE Linux binary policy API documentation" 2 | .SH "NAME" 3 | sepol_check_context \- Check the validity of a security context against a binary policy. 4 | .SH "SYNOPSIS" 5 | .B #include 6 | .sp 7 | .BI "int sepol_check_context(const char *" context ");" 8 | .sp 9 | .BI "int sepol_set_policydb_from_file(FILE *" fp ");" 10 | 11 | .SH "DESCRIPTION" 12 | .B sepol_check_context 13 | checks the validity of a security context against a binary policy 14 | previously loaded from a file via 15 | .B sepol_set_policydb_from_file. 16 | It is used by 17 | .B setfiles -c 18 | to validate a file contexts configuration against the binary policy 19 | upon policy builds. For validating a context against the active 20 | policy on a SELinux system, use 21 | .B security_check_context 22 | from libselinux instead. 23 | 24 | .SH "RETURN VALUE" 25 | Returns 0 on success or \-1 with errno set otherwise. 26 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/man/man3/sepol_genbools.3: -------------------------------------------------------------------------------- 1 | .TH "sepol_genbools" "3" "11 August 2004" "sds@epoch.ncsc.mil" "SE Linux binary policy API documentation" 2 | .SH "NAME" 3 | sepol_genbools \- Rewrite a binary policy with different boolean settings 4 | .SH "SYNOPSIS" 5 | .B #include 6 | .sp 7 | .BI "int sepol_genbools(void *" data ", size_t "len ", char *" boolpath ); 8 | .br 9 | .BI "int sepol_genbools_array(void *" data ", size_t " len ", char **" names ", int *" values ", int " nel ); 10 | 11 | .SH "DESCRIPTION" 12 | .B sepol_genbools 13 | rewrites a binary policy stored in the memory region described by 14 | (data, len) to use the boolean settings specified in the file named by 15 | boolpath. The boolean settings are specified by name=value lines 16 | where value may be 0 or false to disable or 1 or true to enable. The 17 | binary policy is rewritten in place in memory. 18 | 19 | .B sepol_genbools_array 20 | does likewise, but obtains the boolean settings from the parallel arrays 21 | (names, values) with nel elements each. 22 | 23 | .SH "RETURN VALUE" 24 | Returns 0 on success or \-1 otherwise, with errno set appropriately. 25 | An errno of ENOENT indicates that the boolean file did not exist. 26 | An errno of EINVAL indicates that one or more booleans listed in the 27 | boolean file was undefined in the policy or had an invalid value specified; 28 | in this case, the binary policy is still rewritten but any invalid 29 | boolean settings are ignored. 30 | 31 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/man/man8/chkcon.8: -------------------------------------------------------------------------------- 1 | .\" Hey, Emacs! This is an -*- nroff -*- source file. 2 | .\" Copyright (c) 1997 Manoj Srivastava 3 | .\" 4 | .\" This is free documentation; you can redistribute it and/or 5 | .\" modify it under the terms of the GNU General Public License as 6 | .\" published by the Free Software Foundation; either version 2 of 7 | .\" the License, or (at your option) any later version. 8 | .\" 9 | .\" The GNU General Public License's references to "object code" 10 | .\" and "executables" are to be interpreted as the output of any 11 | .\" document formatting or typesetting system, including 12 | .\" intermediate and printed output. 13 | .\" 14 | .\" This manual is distributed in the hope that it will be useful, 15 | .\" but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | .\" GNU General Public License for more details. 18 | .\" 19 | .\" You should have received a copy of the GNU General Public 20 | .\" License along with this manual; if not, write to the Free 21 | .\" Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, 22 | .\" USA. 23 | .\" 24 | .TH CHKCON 8 "Mar 12 2005" "SELinux" "SELinux Command Line documentation" 25 | .SH NAME 26 | chkcon \- determine if a security context is valid for a given binary policy 27 | .SH SYNOPSIS 28 | chkcon policy_file context 29 | .SH DESCRIPTION 30 | This utility validates (the string representation of) a security context 31 | specified by the argument 32 | .I context 33 | against configuration data read in from a policy database binary 34 | representation file specified by the argument 35 | .I policy_file. 36 | .SH FILES 37 | policy file 38 | .SH AUTHOR 39 | This manual page (and just the manual page) was written by Manoj 40 | Srivastava . 41 | 42 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/man/man8/genpolbools.8: -------------------------------------------------------------------------------- 1 | .TH "genpolbools" "8" "11 August 2004" "sds@epoch.ncsc.mil" "SELinux Command Line documentation" 2 | .SH "NAME" 3 | genpolbools \- Rewrite a binary policy with different boolean settings 4 | .SH "SYNOPSIS" 5 | .B genpolbools oldpolicy booleans newpolicy 6 | 7 | .SH "DESCRIPTION" 8 | .B genpolbools 9 | rewrites an existing binary policy with different boolean settings, 10 | generating a new binary policy. The booleans file specifies the 11 | different boolean settings using name=value lines, where value 12 | can be 0 or false to disable the boolean or 1 or true to enable it. 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/man/man8/genpolusers.8: -------------------------------------------------------------------------------- 1 | .\" Hey, Emacs! This is an -*- nroff -*- source file. 2 | .\" Copyright (c) 1997 Manoj Srivastava 3 | .\" 4 | .\" This is free documentation; you can redistribute it and/or 5 | .\" modify it under the terms of the GNU General Public License as 6 | .\" published by the Free Software Foundation; either version 2 of 7 | .\" the License, or (at your option) any later version. 8 | .\" 9 | .\" The GNU General Public License's references to "object code" 10 | .\" and "executables" are to be interpreted as the output of any 11 | .\" document formatting or typesetting system, including 12 | .\" intermediate and printed output. 13 | .\" 14 | .\" This manual is distributed in the hope that it will be useful, 15 | .\" but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | .\" GNU General Public License for more details. 18 | .\" 19 | .\" You should have received a copy of the GNU General Public 20 | .\" License along with this manual; if not, write to the Free 21 | .\" Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, 22 | .\" USA. 23 | .\" 24 | .TH GENPOLUSERS 8 "Mar 12 2005" "SELinux" "SELinux Command Line documentation" 25 | .SH NAME 26 | genpolusers \- Generate new binary policy with updated user configuration 27 | .SH SYNOPSIS 28 | genpolusers in-policy usersdir out-policy 29 | .SH DESCRIPTION 30 | Given an existing binary policy file 31 | .I in\-policy, 32 | generate a new binary policy 33 | .I out\-policy 34 | with an updated user configuration based on any 35 | .B system.users 36 | and 37 | .B local.users 38 | files in the specified 39 | .I usersdir. 40 | .SH AUTHOR 41 | This manual page (and just the manual page) was written by Manoj 42 | Srivastava . 43 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/assertion.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/assertion.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/assertion.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/assertion.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/av_permissions.h: -------------------------------------------------------------------------------- 1 | /* Used by security_compute_av. */ 2 | #define PROCESS__TRANSITION 0x00000002UL 3 | #define PROCESS__DYNTRANSITION 0x00800000UL 4 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/avrule_block.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/avrule_block.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/avrule_block.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/avrule_block.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/avtab.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/avtab.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/avtab.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/avtab.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/boolean_internal.h: -------------------------------------------------------------------------------- 1 | #ifndef _SEPOL_BOOLEAN_INTERNAL_H_ 2 | #define _SEPOL_BOOLEAN_INTERNAL_H_ 3 | 4 | #include 5 | #include 6 | #include "dso.h" 7 | 8 | hidden_proto(sepol_bool_key_create) 9 | hidden_proto(sepol_bool_key_unpack) 10 | hidden_proto(sepol_bool_get_name) 11 | hidden_proto(sepol_bool_set_name) 12 | hidden_proto(sepol_bool_get_value) 13 | hidden_proto(sepol_bool_set_value) 14 | hidden_proto(sepol_bool_create) 15 | hidden_proto(sepol_bool_free) 16 | #endif 17 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/boolean_record.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/boolean_record.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/boolean_record.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/boolean_record.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/booleans.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/booleans.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/booleans.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/booleans.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/conditional.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/conditional.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/conditional.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/conditional.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/constraint.c: -------------------------------------------------------------------------------- 1 | /* Authors: Jason Tang 2 | * 3 | * Copyright (C) 2005 Tresys Technology, LLC 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #include 26 | #include 27 | 28 | int constraint_expr_init(constraint_expr_t * expr) 29 | { 30 | memset(expr, 0, sizeof(*expr)); 31 | ebitmap_init(&expr->names); 32 | if ((expr->type_names = malloc(sizeof(*expr->type_names))) == NULL) { 33 | return -1; 34 | } 35 | type_set_init(expr->type_names); 36 | return 0; 37 | } 38 | 39 | void constraint_expr_destroy(constraint_expr_t * expr) 40 | { 41 | if (expr != NULL) { 42 | ebitmap_destroy(&expr->names); 43 | type_set_destroy(expr->type_names); 44 | free(expr->type_names); 45 | free(expr); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/constraint.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/constraint.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/constraint.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/constraint.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/context.h: -------------------------------------------------------------------------------- 1 | #ifndef _SEPOL_INTERNAL_CONTEXT_H_ 2 | #define _SEPOL_INTERNAL_CONTEXT_H_ 3 | 4 | #include 5 | #include "context_internal.h" 6 | #include 7 | #include 8 | #include 9 | 10 | /* Create a context structure from high level representation */ 11 | extern int context_from_record(sepol_handle_t * handle, 12 | const policydb_t * policydb, 13 | context_struct_t ** cptr, 14 | const sepol_context_t * data); 15 | 16 | extern int context_to_record(sepol_handle_t * handle, 17 | const policydb_t * policydb, 18 | const context_struct_t * context, 19 | sepol_context_t ** record); 20 | 21 | /* Create a context structure from string representation */ 22 | extern int context_from_string(sepol_handle_t * handle, 23 | const policydb_t * policydb, 24 | context_struct_t ** cptr, 25 | const char *con_str, size_t con_str_len); 26 | 27 | /* Check if the provided context is valid for this policy */ 28 | extern int context_is_valid(const policydb_t * policydb, 29 | const context_struct_t * context); 30 | 31 | /* Extract the context as string */ 32 | extern int context_to_string(sepol_handle_t * handle, 33 | const policydb_t * policydb, 34 | const context_struct_t * context, 35 | char **result, size_t * result_len); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/context.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/context.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/context.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/context.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/context_internal.h: -------------------------------------------------------------------------------- 1 | #ifndef _SEPOL_CONTEXT_INTERNAL_H_ 2 | #define _SEPOL_CONTEXT_INTERNAL_H_ 3 | 4 | #include 5 | #include "dso.h" 6 | 7 | hidden_proto(sepol_context_clone) 8 | hidden_proto(sepol_context_create) 9 | hidden_proto(sepol_context_free) 10 | hidden_proto(sepol_context_from_string) 11 | hidden_proto(sepol_context_get_mls) 12 | hidden_proto(sepol_context_get_role) 13 | hidden_proto(sepol_context_get_type) 14 | hidden_proto(sepol_context_get_user) 15 | hidden_proto(sepol_context_set_mls) 16 | hidden_proto(sepol_context_set_role) 17 | hidden_proto(sepol_context_set_type) 18 | hidden_proto(sepol_context_set_user) 19 | #endif 20 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/context_record.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/context_record.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/context_record.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/context_record.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/debug.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/debug.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/debug.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/debug.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/dso.h: -------------------------------------------------------------------------------- 1 | #ifndef _SEPOL_DSO_H 2 | #define _SEPOL_DSO_H 1 3 | 4 | #if !defined(SHARED) || defined(ANDROID) 5 | #define DISABLE_SYMVER 1 6 | #endif 7 | 8 | #ifdef SHARED 9 | # define hidden __attribute__ ((visibility ("hidden"))) 10 | # define hidden_proto(fct) __hidden_proto (fct, fct##_internal) 11 | # define __hidden_proto(fct, internal) \ 12 | extern __typeof (fct) internal; \ 13 | extern __typeof (fct) fct __asm (#internal) hidden; 14 | # if defined(__alpha__) || defined(__mips__) 15 | # define hidden_def(fct) \ 16 | asm (".globl " #fct "\n" #fct " = " #fct "_internal"); 17 | # else 18 | # define hidden_def(fct) \ 19 | asm (".globl " #fct "\n.set " #fct ", " #fct "_internal"); 20 | #endif 21 | #else 22 | # define hidden 23 | # define hidden_proto(fct) 24 | # define hidden_def(fct) 25 | #endif 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/ebitmap.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/ebitmap.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/ebitmap.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/ebitmap.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/expand.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/expand.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/expand.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/expand.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/genbools.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/genbools.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/genbools.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/genbools.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/genusers.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/genusers.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/genusers.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/genusers.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/handle.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "handle.h" 4 | #include "debug.h" 5 | 6 | sepol_handle_t *sepol_handle_create(void) 7 | { 8 | 9 | sepol_handle_t *sh = malloc(sizeof(sepol_handle_t)); 10 | if (sh == NULL) 11 | return NULL; 12 | 13 | /* Set callback */ 14 | sh->msg_callback = sepol_msg_default_handler; 15 | sh->msg_callback_arg = NULL; 16 | 17 | /* by default do not disable dontaudits */ 18 | sh->disable_dontaudit = 0; 19 | sh->expand_consume_base = 0; 20 | 21 | /* by default needless unused branch of tunables would be discarded */ 22 | sh->preserve_tunables = 0; 23 | 24 | return sh; 25 | } 26 | 27 | int sepol_get_preserve_tunables(sepol_handle_t *sh) 28 | { 29 | assert(sh != NULL); 30 | return sh->preserve_tunables; 31 | } 32 | 33 | void sepol_set_preserve_tunables(sepol_handle_t * sh, int preserve_tunables) 34 | { 35 | assert(sh !=NULL); 36 | sh->preserve_tunables = preserve_tunables; 37 | } 38 | 39 | int sepol_get_disable_dontaudit(sepol_handle_t *sh) 40 | { 41 | assert(sh !=NULL); 42 | return sh->disable_dontaudit; 43 | } 44 | 45 | void sepol_set_disable_dontaudit(sepol_handle_t * sh, int disable_dontaudit) 46 | { 47 | assert(sh !=NULL); 48 | sh->disable_dontaudit = disable_dontaudit; 49 | } 50 | 51 | void sepol_set_expand_consume_base(sepol_handle_t *sh, int consume_base) 52 | { 53 | assert(sh != NULL); 54 | sh->expand_consume_base = consume_base; 55 | } 56 | 57 | void sepol_handle_destroy(sepol_handle_t * sh) 58 | { 59 | free(sh); 60 | } 61 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/handle.h: -------------------------------------------------------------------------------- 1 | #ifndef _SEPOL_INTERNAL_HANDLE_H_ 2 | #define _SEPOL_INTERNAL_HANDLE_H_ 3 | 4 | #include 5 | 6 | struct sepol_handle { 7 | /* Error handling */ 8 | int msg_level; 9 | const char *msg_channel; 10 | const char *msg_fname; 11 | #ifdef __GNUC__ 12 | __attribute__ ((format(printf, 3, 4))) 13 | #endif 14 | void (*msg_callback) (void *varg, 15 | sepol_handle_t * handle, const char *fmt, ...); 16 | void *msg_callback_arg; 17 | 18 | int disable_dontaudit; 19 | int expand_consume_base; 20 | int preserve_tunables; 21 | }; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/handle.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/handle.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/handle.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/handle.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/hashtab.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/hashtab.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/hashtab.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/hashtab.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/hierarchy.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/hierarchy.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/hierarchy.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/hierarchy.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/iface_internal.h: -------------------------------------------------------------------------------- 1 | #ifndef _SEPOL_IFACE_INTERNAL_H_ 2 | #define _SEPOL_IFACE_INTERNAL_H_ 3 | 4 | #include 5 | #include 6 | #include "dso.h" 7 | 8 | hidden_proto(sepol_iface_create) 9 | hidden_proto(sepol_iface_free) 10 | hidden_proto(sepol_iface_get_ifcon) 11 | hidden_proto(sepol_iface_get_msgcon) 12 | hidden_proto(sepol_iface_get_name) 13 | hidden_proto(sepol_iface_key_create) 14 | hidden_proto(sepol_iface_key_unpack) 15 | hidden_proto(sepol_iface_set_ifcon) 16 | hidden_proto(sepol_iface_set_msgcon) 17 | hidden_proto(sepol_iface_set_name) 18 | #endif 19 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/iface_record.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/iface_record.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/iface_record.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/iface_record.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/interfaces.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/interfaces.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/interfaces.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/interfaces.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/libsepol.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/libsepol.a -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/libsepol.map: -------------------------------------------------------------------------------- 1 | { 2 | global: 3 | expand_module_avrules; 4 | sepol_module_package_*; sepol_link_modules; sepol_expand_module; sepol_link_packages; 5 | sepol_bool_*; sepol_genbools*; 6 | sepol_context_*; sepol_mls_*; sepol_check_context; 7 | sepol_iface_*; 8 | sepol_port_*; 9 | sepol_node_*; 10 | sepol_user_*; sepol_genusers; sepol_set_delusers; 11 | sepol_msg_*; sepol_debug; 12 | sepol_handle_*; 13 | sepol_policydb_*; sepol_set_policydb_from_file; 14 | sepol_policy_kern_*; 15 | sepol_policy_file_*; 16 | sepol_get_disable_dontaudit; 17 | sepol_set_disable_dontaudit; 18 | sepol_set_expand_consume_base; 19 | sepol_get_preserve_tunables; sepol_set_preserve_tunables; 20 | local: *; 21 | }; 22 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/libsepol.pc: -------------------------------------------------------------------------------- 1 | prefix=/usr 2 | exec_prefix=${prefix} 3 | libdir=${exec_prefix}/lib 4 | includedir=/usr/include 5 | 6 | Name: libsepol 7 | Description: SELinux policy library 8 | Version: 2.2 9 | URL: http://userspace.selinuxproject.org/ 10 | Libs: -L${libdir} -lsepol 11 | Cflags: -I${includedir} 12 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/libsepol.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=${prefix} 3 | libdir=${exec_prefix}/@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: libsepol 7 | Description: SELinux policy library 8 | Version: @VERSION@ 9 | URL: http://userspace.selinuxproject.org/ 10 | Libs: -L${libdir} -lsepol 11 | Cflags: -I${includedir} 12 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/libsepol.so: -------------------------------------------------------------------------------- 1 | libsepol.so.1 -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/libsepol.so.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/libsepol.so.1 -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/link.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/link.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/link.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/link.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/mls.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/mls.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/mls.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/mls.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/module.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/module.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/module.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/module.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/module_internal.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include "dso.h" 3 | 4 | hidden_proto(sepol_module_package_create) 5 | hidden_proto(sepol_module_package_free) 6 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/node_internal.h: -------------------------------------------------------------------------------- 1 | #ifndef _SEPOL_NODE_INTERNAL_H_ 2 | #define _SEPOL_NODE_INTERNAL_H_ 3 | 4 | #include 5 | #include 6 | #include "dso.h" 7 | 8 | hidden_proto(sepol_node_create) 9 | hidden_proto(sepol_node_key_free) 10 | hidden_proto(sepol_node_free) 11 | hidden_proto(sepol_node_get_con) 12 | hidden_proto(sepol_node_get_addr) 13 | hidden_proto(sepol_node_get_addr_bytes) 14 | hidden_proto(sepol_node_get_mask) 15 | hidden_proto(sepol_node_get_mask_bytes) 16 | hidden_proto(sepol_node_get_proto) 17 | hidden_proto(sepol_node_get_proto_str) 18 | hidden_proto(sepol_node_key_create) 19 | hidden_proto(sepol_node_key_unpack) 20 | hidden_proto(sepol_node_set_con) 21 | hidden_proto(sepol_node_set_addr) 22 | hidden_proto(sepol_node_set_addr_bytes) 23 | hidden_proto(sepol_node_set_mask) 24 | hidden_proto(sepol_node_set_mask_bytes) 25 | hidden_proto(sepol_node_set_proto) 26 | #endif 27 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/node_record.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/node_record.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/node_record.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/node_record.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/nodes.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/nodes.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/nodes.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/nodes.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/polcaps.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Policy capability support functions 3 | */ 4 | 5 | #include 6 | #include 7 | 8 | static const char *polcap_names[] = { 9 | "network_peer_controls", /* POLICYDB_CAPABILITY_NETPEER */ 10 | "open_perms", /* POLICYDB_CAPABILITY_OPENPERM */ 11 | "redhat1", /* POLICYDB_CAPABILITY_REDHAT1, aka ptrace_child */ 12 | "always_check_network", /* POLICYDB_CAPABILITY_ALWAYSNETWORK */ 13 | NULL 14 | }; 15 | 16 | int sepol_polcap_getnum(const char *name) 17 | { 18 | int capnum; 19 | 20 | for (capnum = 0; capnum <= POLICYDB_CAPABILITY_MAX; capnum++) { 21 | if (polcap_names[capnum] == NULL) 22 | continue; 23 | if (strcasecmp(polcap_names[capnum], name) == 0) 24 | return capnum; 25 | } 26 | return -1; 27 | } 28 | 29 | const char *sepol_polcap_getname(int capnum) 30 | { 31 | if (capnum > POLICYDB_CAPABILITY_MAX) 32 | return NULL; 33 | 34 | return polcap_names[capnum]; 35 | } 36 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/polcaps.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/polcaps.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/polcaps.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/polcaps.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/policydb.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/policydb.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/policydb.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/policydb.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/policydb_convert.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/policydb_convert.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/policydb_convert.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/policydb_convert.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/policydb_internal.h: -------------------------------------------------------------------------------- 1 | #ifndef _SEPOL_POLICYDB_INTERNAL_H_ 2 | #define _SEPOL_POLICYDB_INTERNAL_H_ 3 | 4 | #include 5 | #include "dso.h" 6 | 7 | hidden_proto(sepol_policydb_create) 8 | hidden_proto(sepol_policydb_free) 9 | extern const char *policydb_target_strings[]; 10 | #endif 11 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/policydb_public.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/policydb_public.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/policydb_public.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/policydb_public.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/port_internal.h: -------------------------------------------------------------------------------- 1 | #ifndef _SEPOL_PORT_INTERNAL_H_ 2 | #define _SEPOL_PORT_INTERNAL_H_ 3 | 4 | #include 5 | #include 6 | #include "dso.h" 7 | 8 | hidden_proto(sepol_port_create) 9 | hidden_proto(sepol_port_free) 10 | hidden_proto(sepol_port_get_con) 11 | hidden_proto(sepol_port_get_high) 12 | hidden_proto(sepol_port_get_low) 13 | hidden_proto(sepol_port_get_proto) 14 | hidden_proto(sepol_port_get_proto_str) 15 | hidden_proto(sepol_port_key_create) 16 | hidden_proto(sepol_port_key_unpack) 17 | hidden_proto(sepol_port_set_con) 18 | hidden_proto(sepol_port_set_proto) 19 | hidden_proto(sepol_port_set_range) 20 | #endif 21 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/port_record.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/port_record.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/port_record.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/port_record.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/ports.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/ports.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/ports.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/ports.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/private.h: -------------------------------------------------------------------------------- 1 | /* Private definitions for libsepol. */ 2 | 3 | /* Endian conversion for reading and writing binary policies */ 4 | 5 | #include 6 | 7 | 8 | #ifdef DARWIN 9 | #include 10 | #include 11 | #else 12 | #include 13 | #include 14 | #endif 15 | 16 | #include 17 | #include 18 | 19 | #ifdef DARWIN 20 | #define __BYTE_ORDER BYTE_ORDER 21 | #define __LITTLE_ENDIAN LITTLE_ENDIAN 22 | #endif 23 | 24 | #if __BYTE_ORDER == __LITTLE_ENDIAN 25 | #define cpu_to_le16(x) (x) 26 | #define le16_to_cpu(x) (x) 27 | #define cpu_to_le32(x) (x) 28 | #define le32_to_cpu(x) (x) 29 | #define cpu_to_le64(x) (x) 30 | #define le64_to_cpu(x) (x) 31 | #else 32 | #define cpu_to_le16(x) bswap_16(x) 33 | #define le16_to_cpu(x) bswap_16(x) 34 | #define cpu_to_le32(x) bswap_32(x) 35 | #define le32_to_cpu(x) bswap_32(x) 36 | #define cpu_to_le64(x) bswap_64(x) 37 | #define le64_to_cpu(x) bswap_64(x) 38 | #endif 39 | 40 | #undef min 41 | #define min(a,b) (((a) < (b)) ? (a) : (b)) 42 | 43 | #undef max 44 | #define max(a,b) ((a) >= (b) ? (a) : (b)) 45 | 46 | #define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0])) 47 | 48 | /* Policy compatibility information. */ 49 | struct policydb_compat_info { 50 | unsigned int type; 51 | unsigned int version; 52 | unsigned int sym_num; 53 | unsigned int ocon_num; 54 | unsigned int target_platform; 55 | }; 56 | 57 | extern struct policydb_compat_info *policydb_lookup_compat(unsigned int version, 58 | unsigned int type, 59 | unsigned int target_platform); 60 | 61 | /* Reading from a policy "file". */ 62 | extern int next_entry(void *buf, struct policy_file *fp, size_t bytes) hidden; 63 | extern size_t put_entry(const void *ptr, size_t size, size_t n, 64 | struct policy_file *fp) hidden; 65 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/roles.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | #include "debug.h" 8 | #include "handle.h" 9 | 10 | /* Check if a role exists */ 11 | int sepol_role_exists(sepol_handle_t * handle __attribute__ ((unused)), 12 | sepol_policydb_t * p, const char *role, int *response) 13 | { 14 | 15 | policydb_t *policydb = &p->p; 16 | *response = (hashtab_search(policydb->p_roles.table, 17 | (const hashtab_key_t)role) != NULL); 18 | 19 | handle = NULL; 20 | return STATUS_SUCCESS; 21 | } 22 | 23 | /* Fill an array with all valid roles */ 24 | int sepol_role_list(sepol_handle_t * handle, 25 | sepol_policydb_t * p, char ***roles, unsigned int *nroles) 26 | { 27 | 28 | policydb_t *policydb = &p->p; 29 | unsigned int tmp_nroles = policydb->p_roles.nprim; 30 | char **tmp_roles = (char **)malloc(tmp_nroles * sizeof(char *)); 31 | char **ptr; 32 | unsigned int i; 33 | if (!tmp_roles) 34 | goto omem; 35 | 36 | for (i = 0; i < tmp_nroles; i++) { 37 | tmp_roles[i] = strdup(policydb->p_role_val_to_name[i]); 38 | if (!tmp_roles[i]) 39 | goto omem; 40 | } 41 | 42 | *nroles = tmp_nroles; 43 | *roles = tmp_roles; 44 | 45 | return STATUS_SUCCESS; 46 | 47 | omem: 48 | ERR(handle, "out of memory, could not list roles"); 49 | 50 | ptr = tmp_roles; 51 | while (ptr && *ptr) 52 | free(*ptr++); 53 | free(tmp_roles); 54 | return STATUS_ERR; 55 | } 56 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/roles.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/roles.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/roles.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/roles.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/services.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/services.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/services.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/services.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/sidtab.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/sidtab.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/sidtab.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/sidtab.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/symtab.c: -------------------------------------------------------------------------------- 1 | 2 | /* Author : Stephen Smalley, */ 3 | 4 | /* FLASK */ 5 | 6 | /* 7 | * Implementation of the symbol table type. 8 | */ 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | static unsigned int symhash(hashtab_t h, hashtab_key_t key) 15 | { 16 | char *p, *keyp; 17 | size_t size; 18 | unsigned int val; 19 | 20 | val = 0; 21 | keyp = (char *)key; 22 | size = strlen(keyp); 23 | for (p = keyp; ((size_t) (p - keyp)) < size; p++) 24 | val = 25 | (val << 4 | (val >> (8 * sizeof(unsigned int) - 4))) ^ (*p); 26 | return val & (h->size - 1); 27 | } 28 | 29 | static int symcmp(hashtab_t h 30 | __attribute__ ((unused)), hashtab_key_t key1, 31 | hashtab_key_t key2) 32 | { 33 | char *keyp1, *keyp2; 34 | 35 | keyp1 = (char *)key1; 36 | keyp2 = (char *)key2; 37 | return strcmp(keyp1, keyp2); 38 | } 39 | 40 | int symtab_init(symtab_t * s, unsigned int size) 41 | { 42 | s->table = hashtab_create(symhash, symcmp, size); 43 | if (!s->table) 44 | return -1; 45 | s->nprim = 0; 46 | return 0; 47 | } 48 | 49 | void symtab_destroy(symtab_t * s) 50 | { 51 | if (!s) 52 | return; 53 | if (s->table) 54 | hashtab_destroy(s->table); 55 | return; 56 | } 57 | /* FLASK */ 58 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/symtab.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/symtab.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/symtab.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/symtab.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/user_internal.h: -------------------------------------------------------------------------------- 1 | #ifndef _SEPOL_USER_INTERNAL_H_ 2 | #define _SEPOL_USER_INTERNAL_H_ 3 | 4 | #include 5 | #include 6 | #include "dso.h" 7 | 8 | hidden_proto(sepol_user_add_role) 9 | hidden_proto(sepol_user_create) 10 | hidden_proto(sepol_user_free) 11 | hidden_proto(sepol_user_get_mlslevel) 12 | hidden_proto(sepol_user_get_mlsrange) 13 | hidden_proto(sepol_user_get_roles) 14 | hidden_proto(sepol_user_has_role) 15 | hidden_proto(sepol_user_key_create) 16 | hidden_proto(sepol_user_key_unpack) 17 | hidden_proto(sepol_user_set_mlslevel) 18 | hidden_proto(sepol_user_set_mlsrange) 19 | hidden_proto(sepol_user_set_name) 20 | #endif 21 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/user_record.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/user_record.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/user_record.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/user_record.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/users.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/users.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/users.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/users.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/util.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/util.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/util.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/util.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/write.lo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/write.lo -------------------------------------------------------------------------------- /Superuser/jni/libsepol/src/write.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/jni/libsepol/src/write.o -------------------------------------------------------------------------------- /Superuser/jni/libsepol/tests/debug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Joshua Brindle 3 | * 4 | * Copyright (C) 2006 Tresys Technology, LLC 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | /* This includes functions used to debug tests (display bitmaps, conditional expressions, etc */ 22 | 23 | #include 24 | #include 25 | 26 | extern void print_ebitmap(ebitmap_t * bitmap, FILE * fp); 27 | extern void display_expr(policydb_t * p, cond_expr_t * exp, FILE * fp); 28 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/tests/policies/support/misc_macros.spt: -------------------------------------------------------------------------------- 1 | 2 | ######################################## 3 | # 4 | # Helper macros 5 | # 6 | 7 | ######################################## 8 | # 9 | # gen_user(username, prefix, role_set, mls_defaultlevel, mls_range, [mcs_categories]) 10 | # 11 | define(`gen_user',`dnl 12 | ifdef(`users_extra',`dnl 13 | ifelse(`$2',,,`user $1 prefix $2;') 14 | ',`dnl 15 | user $1 roles { $3 }`'ifdef(`enable_mls', ` level $4 range $5')`'ifdef(`enable_mcs',` level s0 range s0`'ifelse(`$6',,,` - s0:$6')'); 16 | ')dnl 17 | ') 18 | 19 | ######################################## 20 | # 21 | # gen_context(context,mls_sensitivity,[mcs_categories]) 22 | # 23 | define(`gen_context',`$1`'ifdef(`enable_mls',`:$2')`'ifdef(`enable_mcs',`:s0`'ifelse(`$3',,,`:$3')')') dnl 24 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/tests/policies/test-deps/modreq-attr-global.conf: -------------------------------------------------------------------------------- 1 | module modreq_attr_global 1.0; 2 | 3 | require { 4 | attribute attr_req; 5 | } 6 | 7 | type mod_global_t; 8 | 9 | type new_t, attr_req; 10 | 11 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/tests/policies/test-deps/modreq-attr-opt.conf: -------------------------------------------------------------------------------- 1 | module modreq_attr_opt 1.0; 2 | 3 | require { 4 | class file {read write}; 5 | 6 | } 7 | 8 | type mod_global_t; 9 | 10 | optional { 11 | require { 12 | attribute attr_req; 13 | } 14 | type mod_opt_t; 15 | type new_t, attr_req; 16 | } 17 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/tests/policies/test-deps/modreq-bool-global.conf: -------------------------------------------------------------------------------- 1 | module modreq_bool_global 1.0; 2 | 3 | require { 4 | bool bool_req; 5 | class file { read write }; 6 | } 7 | 8 | type mod_global_t; 9 | 10 | type a_t; 11 | type b_t; 12 | 13 | if (bool_req) { 14 | allow a_t b_t : file { read write }; 15 | } 16 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/tests/policies/test-deps/modreq-bool-opt.conf: -------------------------------------------------------------------------------- 1 | module modreq_bool_opt 1.0; 2 | 3 | require { 4 | class file {read write}; 5 | 6 | } 7 | 8 | type mod_global_t; 9 | 10 | optional { 11 | require { 12 | bool bool_req; 13 | } 14 | 15 | type a_t; 16 | type b_t; 17 | type mod_opt_t; 18 | 19 | if (bool_req) { 20 | allow a_t b_t : file { read write }; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/tests/policies/test-deps/modreq-obj-global.conf: -------------------------------------------------------------------------------- 1 | module modreq_obj_global 1.0; 2 | 3 | require { 4 | class sem { create destroy }; 5 | } 6 | 7 | type mod_global_t; 8 | 9 | type mod_foo_t; 10 | type mod_bar_t; 11 | 12 | allow mod_foo_t mod_bar_t : sem { create destroy }; 13 | 14 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/tests/policies/test-deps/modreq-obj-opt.conf: -------------------------------------------------------------------------------- 1 | module modreq_obj_global 1.0; 2 | 3 | require { 4 | class file { read }; 5 | } 6 | 7 | type mod_global_t; 8 | 9 | type mod_foo_t; 10 | type mod_bar_t; 11 | 12 | optional { 13 | require { 14 | class sem { create destroy }; 15 | } 16 | 17 | type mod_opt_t; 18 | 19 | allow mod_foo_t mod_bar_t : sem { create destroy }; 20 | } 21 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/tests/policies/test-deps/modreq-perm-global.conf: -------------------------------------------------------------------------------- 1 | module modreq_perm_global 1.0; 2 | 3 | require { 4 | class msg { send receive }; 5 | } 6 | 7 | type mod_global_t; 8 | type a_t; 9 | type b_t; 10 | allow a_t b_t: msg { send receive }; 11 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/tests/policies/test-deps/modreq-perm-opt.conf: -------------------------------------------------------------------------------- 1 | module modreq_perm_opt 1.0; 2 | 3 | require { 4 | class file { read write }; 5 | } 6 | 7 | type mod_global_t; 8 | 9 | optional { 10 | require { 11 | class msg { send receive }; 12 | } 13 | 14 | type mod_opt_t; 15 | type a_mod_t; 16 | type b_mod_t; 17 | allow a_mod_t b_mod_t: msg { send receive }; 18 | } 19 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/tests/policies/test-deps/modreq-role-global.conf: -------------------------------------------------------------------------------- 1 | module modreq_role_global 1.0; 2 | 3 | require { 4 | role role_req_r, user_r; 5 | } 6 | 7 | type mod_global_t; 8 | 9 | type a_t; 10 | 11 | # role role_req_r types a_t; 12 | allow role_req_r user_r; 13 | 14 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/tests/policies/test-deps/modreq-role-opt.conf: -------------------------------------------------------------------------------- 1 | module modreq_role_opt 1.0; 2 | 3 | require { 4 | class file {read write}; 5 | 6 | } 7 | 8 | type mod_global_t; 9 | 10 | optional { 11 | require { 12 | role role_req_r, user_r; 13 | } 14 | type mod_opt_t; 15 | 16 | allow role_req_r user_r; 17 | } 18 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/tests/policies/test-deps/modreq-type-global.conf: -------------------------------------------------------------------------------- 1 | module modreq_type_global 1.0; 2 | 3 | require { 4 | type type_req_t; 5 | class file { read write }; 6 | } 7 | 8 | type mod_global_t; 9 | 10 | type test_t; 11 | 12 | allow test_t type_req_t : file { read write }; 13 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/tests/policies/test-deps/modreq-type-opt.conf: -------------------------------------------------------------------------------- 1 | module modreq_type_opt 1.0; 2 | 3 | require { 4 | type file_t; 5 | class file { read write }; 6 | } 7 | 8 | type mod_global_t; 9 | 10 | optional { 11 | require { 12 | type type_req_t; 13 | } 14 | type mod_opt_t; 15 | allow type_req_t file_t : file { read write }; 16 | } -------------------------------------------------------------------------------- /Superuser/jni/libsepol/tests/policies/test-deps/module.conf: -------------------------------------------------------------------------------- 1 | module my_module 1.0; 2 | 3 | require { 4 | bool secure_mode; 5 | type system_t, sysadm_t, file_t; 6 | attribute domain; 7 | role system_r; 8 | class file {read write}; 9 | 10 | } 11 | 12 | type new_t, domain; 13 | role system_r types new_t; 14 | 15 | allow system_t file_t : file { read write }; 16 | 17 | if (secure_mode) 18 | { 19 | allow sysadm_t file_t : file { read write }; 20 | } 21 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/tests/policies/test-expander/alias-module.conf: -------------------------------------------------------------------------------- 1 | module my_module 1.0; 2 | 3 | require { 4 | type alias_check_3_t; 5 | } 6 | 7 | typealias alias_check_3_t alias alias_check_3_a; 8 | 9 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/tests/policies/test-expander/base-base-only.conf: -------------------------------------------------------------------------------- 1 | class security 2 | class file 3 | 4 | sid kernel 5 | 6 | common file 7 | { 8 | read 9 | } 10 | 11 | class file 12 | inherits file 13 | { 14 | entrypoint 15 | } 16 | 17 | class security 18 | { 19 | compute_av 20 | } 21 | 22 | ifdef(`enable_mls',` 23 | sensitivity s0; 24 | 25 | dominance { s0 } 26 | 27 | category c0; 28 | 29 | level s0:c0; 30 | 31 | mlsconstrain file { read } 32 | ( h1 dom h2 ); 33 | ') 34 | 35 | attribute myattr; 36 | type mytype_t; 37 | role myrole_r; 38 | role myrole_r types mytype_t; 39 | bool mybool true; 40 | gen_user(myuser_u,, myrole_r, s0, s0 - s0:c0) 41 | 42 | sid kernel gen_context(myuser_u:myrole_r:mytype_t, s0) 43 | 44 | 45 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/tests/policies/test-expander/role-module.conf: -------------------------------------------------------------------------------- 1 | module my_module 1.0; 2 | 3 | require { 4 | class file {read write}; 5 | role role_check_1; 6 | } 7 | 8 | type role_check_1_2_t; 9 | role role_check_1 types role_check_1_2_t; 10 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/tests/policies/test-expander/user-module.conf: -------------------------------------------------------------------------------- 1 | module my_module 1.0; 2 | 3 | require { 4 | class file {read write}; 5 | ifdef(`enable_mls',` 6 | user user_check_1; 7 | ') 8 | } 9 | 10 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/tests/policies/test-hooks/module_add_role_allow_trans.conf: -------------------------------------------------------------------------------- 1 | module add_symbol_test 1.0; 2 | 3 | require { class file { read }; } 4 | 5 | role role_a_1; 6 | role role_a_2; 7 | role role_t_1; 8 | role role_t_2; 9 | 10 | type type_rt_1; 11 | 12 | 13 | allow role_a_1 role_a_2; 14 | 15 | role_transition role_t_1 type_rt_1 role_t_2; 16 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/tests/policies/test-hooks/module_add_symbols.conf: -------------------------------------------------------------------------------- 1 | module add_symbol_test 1.0; 2 | 3 | require { class file { read write }; } 4 | 5 | type type_add_1; 6 | attribute attrib_add_1; 7 | role role_add_1; 8 | bool bool_add_1 false; 9 | 10 | ifdef(`enable_mls',`',` 11 | user user_add_1 roles { role_add_1 }; 12 | ') 13 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/tests/policies/test-linker/module2.conf: -------------------------------------------------------------------------------- 1 | module linker_test_2 1.0; 2 | 3 | require { 4 | class file { read write }; 5 | class lnk_file { unlink }; 6 | attribute g_b_attr_5; 7 | attribute g_b_attr_6; 8 | attribute g_m1_attr_3; 9 | attribute o3_m1_attr_2; 10 | } 11 | 12 | type tag_g_m2; 13 | 14 | type g_m2_type_1; 15 | role g_m2_role_1; 16 | role g_m2_role_1 types g_m2_type_1; 17 | 18 | type g_m2_type_4, g_b_attr_5; 19 | type g_m2_type_5, g_b_attr_6; 20 | 21 | #add types to role declared in base test 22 | type g_m2_type_2; 23 | role g_b_role_3; 24 | role g_b_role_3 types g_m2_type_2; 25 | 26 | #optional base role w/ adds in 2 modules 27 | role o4_b_role_1; 28 | role o4_b_role_1 types g_m2_type_1; 29 | 30 | # attr a added to in base optional, declared/added to in module, added to in other module 31 | type g_m2_type_3, g_m1_attr_3; 32 | 33 | # attr a added to in base optional, declared/added in module optional, added to in other module 34 | type g_m2_type_6, o3_m1_attr_2; 35 | 36 | # cond mapping tests 37 | bool g_m2_bool_1 true; 38 | bool g_m2_bool_2 false; 39 | if (g_m2_bool_1 && g_m2_bool_2) { 40 | allow g_m2_type_1 g_m2_type_2 : lnk_file unlink; 41 | } 42 | 43 | optional { 44 | require { 45 | type optional_type; 46 | } 47 | 48 | type tag_o1_m2; 49 | 50 | type o1_m2_type_1; 51 | role o1_m2_role_1; 52 | role o1_m2_role_1 types o1_m2_type_1; 53 | } 54 | 55 | 56 | optional { 57 | require { 58 | attribute g_m1_attr_4; 59 | attribute o4_m1_attr_1; 60 | } 61 | type tag_o2_m2; 62 | 63 | type o2_m2_type_1, g_m1_attr_4; 64 | type o2_m2_type_2, o4_m1_attr_1; 65 | 66 | } 67 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/tests/test-cond.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Karl MacMillan 3 | * 4 | * Copyright (C) 2006 Tresys Technology, LLC 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef __TEST_COND_H__ 22 | #define __TEST_COND_H__ 23 | 24 | #include 25 | 26 | int cond_test_init(void); 27 | int cond_test_cleanup(void); 28 | int cond_add_tests(CU_pSuite suite); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/tests/test-deps.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Karl MacMillan 3 | * 4 | * Copyright (C) 2006 Tresys Technology, LLC 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef __TEST_DEPS_H__ 22 | #define __TEST_DEPS_H__ 23 | 24 | #include 25 | 26 | int deps_test_init(void); 27 | int deps_test_cleanup(void); 28 | int deps_add_tests(CU_pSuite suite); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/tests/test-expander-attr-map.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Joshua Brindle 3 | * 4 | * Copyright (C) 2006 Tresys Technology, LLC 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef __TEST_EXPANDER__ATTR_MAP_H__ 22 | #define __TEST_EXPANDER__ATTR_MAP_H__ 23 | 24 | void test_expander_attr_mapping(void); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/tests/test-expander-roles.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Authors: Chad Sellers 3 | * Joshua Brindle 4 | * Chris PeBenito 5 | * 6 | * Copyright (C) 2006 Tresys Technology, LLC 7 | * 8 | * This library is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #include "test-expander-roles.h" 24 | #include "test-common.h" 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | extern policydb_t role_expanded; 31 | 32 | void test_expander_role_mapping(void) 33 | { 34 | char *types1[] = { "role_check_1_1_t", "role_check_1_2_t" }; 35 | 36 | test_role_type_set(&role_expanded, "role_check_1", NULL, types1, 2, 0); 37 | } 38 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/tests/test-expander-roles.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Joshua Brindle 3 | * Author: Chris PeBenito 4 | * 5 | * Copyright (C) 2006 Tresys Technology, LLC 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef __TEST_EXPANDER_ROLE_H__ 23 | #define __TEST_EXPANDER_ROLE_H__ 24 | 25 | void test_expander_role_mapping(void); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/tests/test-expander-users.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Joshua Brindle 3 | * Author: Chris PeBenito 4 | * 5 | * Copyright (C) 2006 Tresys Technology, LLC 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef __TEST_EXPANDER_USER_H__ 23 | #define __TEST_EXPANDER_USER_H__ 24 | 25 | void test_expander_user_mapping(void); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/tests/test-expander.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Joshua Brindle 3 | * 4 | * Copyright (C) 2006 Tresys Technology, LLC 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef __TEST_EXPANDER_H__ 22 | #define __TEST_EXPANDER_H__ 23 | 24 | #include 25 | 26 | int expander_test_init(void); 27 | int expander_test_cleanup(void); 28 | int expander_add_tests(CU_pSuite suite); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/tests/test-linker-cond-map.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Joshua Brindle 3 | * 4 | * Copyright (C) 2006 Tresys Technology, LLC 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef __TEST_LINKER_COND_MAP_H__ 22 | #define __TEST_LINKER_COND_MAP_H__ 23 | 24 | extern void base_cond_tests(policydb_t * base); 25 | extern void module_cond_tests(policydb_t * base); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/tests/test-linker-roles.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Joshua Brindle 3 | * 4 | * Copyright (C) 2006 Tresys Technology, LLC 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef __TEST_LINKER_ROLES_H__ 22 | #define __TEST_LINKER_ROLES_H__ 23 | 24 | #include 25 | 26 | extern void base_role_tests(policydb_t * base); 27 | extern void module_role_tests(policydb_t * base); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/tests/test-linker-types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Joshua Brindle 3 | * 4 | * Copyright (C) 2006 Tresys Technology, LLC 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef __TEST_LINKER_TYPES_H__ 22 | #define __TEST_LINKER_TYPES_H__ 23 | 24 | extern void base_type_tests(policydb_t * base); 25 | extern void module_type_tests(policydb_t * base); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/tests/test-linker.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Joshua Brindle 3 | * 4 | * Copyright (C) 2006 Tresys Technology, LLC 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef __TEST_LINKER_H__ 22 | #define __TEST_LINKER_H__ 23 | 24 | #include 25 | 26 | int linker_test_init(void); 27 | int linker_test_cleanup(void); 28 | int linker_add_tests(CU_pSuite suite); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/utils/Makefile: -------------------------------------------------------------------------------- 1 | # Installation directories. 2 | PREFIX ?= $(DESTDIR)/usr 3 | BINDIR ?= $(PREFIX)/bin 4 | 5 | CFLAGS ?= -Wall -Werror 6 | override CFLAGS += -I../include 7 | LDLIBS += -L../src -lsepol 8 | 9 | TARGETS=$(patsubst %.c,%,$(wildcard *.c)) 10 | 11 | all: $(TARGETS) 12 | 13 | install: all 14 | -mkdir -p $(BINDIR) 15 | install -m 755 $(TARGETS) $(BINDIR) 16 | 17 | clean: 18 | -rm -f $(TARGETS) *.o 19 | 20 | indent: 21 | ../../scripts/Lindent $(wildcard *.[ch]) 22 | 23 | relabel: 24 | 25 | -------------------------------------------------------------------------------- /Superuser/jni/libsepol/utils/chkcon.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | void usage(char*) __attribute__((noreturn)); 10 | 11 | void usage(char *progname) 12 | { 13 | printf("usage: %s policy context\n", progname); 14 | exit(1); 15 | } 16 | 17 | int main(int argc, char **argv) 18 | { 19 | FILE *fp; 20 | 21 | if (argc != 3) 22 | usage(argv[0]); 23 | 24 | fp = fopen(argv[1], "r"); 25 | if (!fp) { 26 | fprintf(stderr, "Can't open '%s': %s\n", 27 | argv[1], strerror(errno)); 28 | exit(1); 29 | } 30 | if (sepol_set_policydb_from_file(fp) < 0) { 31 | fprintf(stderr, "Error while processing %s: %s\n", 32 | argv[1], strerror(errno)); 33 | exit(1); 34 | } 35 | fclose(fp); 36 | 37 | if (sepol_check_context(argv[2]) < 0) { 38 | fprintf(stderr, "%s is not valid\n", argv[2]); 39 | exit(1); 40 | } 41 | 42 | printf("%s is valid\n", argv[2]); 43 | exit(0); 44 | } 45 | -------------------------------------------------------------------------------- /Superuser/jni/su/binds.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2016, Pierre-Hugues Husson 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 3 of the License, or 7 | (at your option) any later version. 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software Foundation, 14 | Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 15 | */ 16 | 17 | #ifndef BINDS_H 18 | #define BINDS_H 19 | 20 | #define BINDS_PATH "/data/su/binds" 21 | #define BINDS_TMP_PATH "/data/su/binds.new" 22 | 23 | typedef void (*bind_cb)(void *arg, int uid, const char *src, const char *dst); 24 | extern int bind_foreach(bind_cb cb, void* arg); 25 | extern int bind_uniq_dst(const char *dst); 26 | extern int bind_remove(const char *path, int uid); 27 | extern void bind_ls(int uid); 28 | 29 | typedef void (*init_cb)(void *arg, int uid, const char *path); 30 | extern int init_foreach(init_cb cb, void* arg); 31 | extern int init_uniq(const char *dst); 32 | extern int init_remove(const char *path, int uid); 33 | extern void init_ls(int uid); 34 | 35 | 36 | #endif /* BINDS_H */ 37 | -------------------------------------------------------------------------------- /Superuser/jni/su/hacks.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "su.h" 6 | #include "utils.h" 7 | 8 | enum { 9 | H_NO_CONTEXT = 0x0001, 10 | }; 11 | 12 | static struct { 13 | const char *package; 14 | int flags; 15 | int uid; 16 | } apps_list[] = { 17 | { "com.keramidas.TitaniumBackup", H_NO_CONTEXT, }, 18 | }; 19 | 20 | void hacks_init() { 21 | char oldCwd[512]; 22 | getcwd(oldCwd, sizeof(oldCwd)); 23 | chdir("/data/data"); 24 | for(int i=0; i<(sizeof(apps_list)/sizeof(apps_list[0])); ++i) { 25 | apps_list[i].uid = -1; 26 | struct stat st_buf; 27 | int ret = stat(apps_list[i].package, &st_buf); 28 | LOGW("hacks: Testing (%s:%d:%d)", apps_list[i].package, ret, st_buf.st_uid); 29 | if(ret) 30 | continue; 31 | apps_list[i].uid = st_buf.st_uid; 32 | } 33 | } 34 | 35 | void hacks_update_context(struct su_context* ctxt) { 36 | for(int i=0; i<(sizeof(apps_list)/sizeof(apps_list[0])); ++i) { 37 | LOGW("hacks: Testing (%s:%d), %d", apps_list[i].package, ctxt->from.uid); 38 | if(apps_list[i].uid != ctxt->from.uid) 39 | continue; 40 | 41 | LOGW("hacks: Found app (%s:%d)", apps_list[i].package, ctxt->from.uid); 42 | if(apps_list[i].flags & H_NO_CONTEXT) { 43 | LOGW("hacks: Disabling context (%s:%d)", apps_list[i].package, ctxt->from.uid); 44 | ctxt->to.context = NULL; 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Superuser/jni/su/utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright 2012, The CyanogenMod Project 3 | ** 4 | ** Licensed under the Apache License, Version 2.0 (the "License"); 5 | ** you may not use this file except in compliance with the License. 6 | ** You may obtain a copy of the License at 7 | ** 8 | ** http://www.apache.org/licenses/LICENSE-2.0 9 | ** 10 | ** Unless required by applicable law or agreed to in writing, software 11 | ** distributed under the License is distributed on an "AS IS" BASIS, 12 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ** See the License for the specific language governing permissions and 14 | ** limitations under the License. 15 | */ 16 | 17 | #ifndef _UTILS_H_ 18 | #define _UTILS_H_ 19 | 20 | #ifndef PROPERTY_VALUE_MAX 21 | #define PROPERTY_VALUE_MAX 92 22 | #endif 23 | 24 | /* reads a file, making sure it is terminated with \n \0 */ 25 | extern char* read_file(const char *fn); 26 | 27 | extern int get_property(const char *data, char *found, const char *searchkey, 28 | const char *not_found); 29 | extern int check_property(const char *data, const char *prefix); 30 | #endif 31 | -------------------------------------------------------------------------------- /Superuser/lint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Superuser/packageName: -------------------------------------------------------------------------------- 1 | me.phh.superuser -------------------------------------------------------------------------------- /Superuser/proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /Superuser/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-22 15 | android.library.reference.1=../Widgets/Widgets 16 | -------------------------------------------------------------------------------- /Superuser/res/drawable-hdpi-v11/ic_stat_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-hdpi-v11/ic_stat_notification.png -------------------------------------------------------------------------------- /Superuser/res/drawable-hdpi-v9/ic_stat_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-hdpi-v9/ic_stat_notification.png -------------------------------------------------------------------------------- /Superuser/res/drawable-hdpi/ic_action_about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-hdpi/ic_action_about.png -------------------------------------------------------------------------------- /Superuser/res/drawable-hdpi/ic_action_logs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-hdpi/ic_action_logs.png -------------------------------------------------------------------------------- /Superuser/res/drawable-hdpi/ic_action_permission.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-hdpi/ic_action_permission.png -------------------------------------------------------------------------------- /Superuser/res/drawable-hdpi/ic_action_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-hdpi/ic_action_settings.png -------------------------------------------------------------------------------- /Superuser/res/drawable-hdpi/ic_action_trash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-hdpi/ic_action_trash.png -------------------------------------------------------------------------------- /Superuser/res/drawable-hdpi/ic_alert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-hdpi/ic_alert.png -------------------------------------------------------------------------------- /Superuser/res/drawable-hdpi/ic_alert_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-hdpi/ic_alert_dark.png -------------------------------------------------------------------------------- /Superuser/res/drawable-hdpi/ic_allow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-hdpi/ic_allow.png -------------------------------------------------------------------------------- /Superuser/res/drawable-hdpi/ic_delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-hdpi/ic_delete.png -------------------------------------------------------------------------------- /Superuser/res/drawable-hdpi/ic_deny.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-hdpi/ic_deny.png -------------------------------------------------------------------------------- /Superuser/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /Superuser/res/drawable-hdpi/ic_logging.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-hdpi/ic_logging.png -------------------------------------------------------------------------------- /Superuser/res/drawable-hdpi/ic_logging_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-hdpi/ic_logging_dark.png -------------------------------------------------------------------------------- /Superuser/res/drawable-hdpi/ic_menu_about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-hdpi/ic_menu_about.png -------------------------------------------------------------------------------- /Superuser/res/drawable-hdpi/ic_menu_logs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-hdpi/ic_menu_logs.png -------------------------------------------------------------------------------- /Superuser/res/drawable-hdpi/ic_menu_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-hdpi/ic_menu_settings.png -------------------------------------------------------------------------------- /Superuser/res/drawable-hdpi/ic_menu_trash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-hdpi/ic_menu_trash.png -------------------------------------------------------------------------------- /Superuser/res/drawable-hdpi/ic_notifications.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-hdpi/ic_notifications.png -------------------------------------------------------------------------------- /Superuser/res/drawable-hdpi/ic_notifications_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-hdpi/ic_notifications_dark.png -------------------------------------------------------------------------------- /Superuser/res/drawable-hdpi/ic_protected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-hdpi/ic_protected.png -------------------------------------------------------------------------------- /Superuser/res/drawable-hdpi/ic_protected_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-hdpi/ic_protected_dark.png -------------------------------------------------------------------------------- /Superuser/res/drawable-hdpi/ic_stat_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-hdpi/ic_stat_notification.png -------------------------------------------------------------------------------- /Superuser/res/drawable-hdpi/ic_theme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-hdpi/ic_theme.png -------------------------------------------------------------------------------- /Superuser/res/drawable-hdpi/ic_theme_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-hdpi/ic_theme_dark.png -------------------------------------------------------------------------------- /Superuser/res/drawable-hdpi/ic_timeout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-hdpi/ic_timeout.png -------------------------------------------------------------------------------- /Superuser/res/drawable-hdpi/ic_timeout_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-hdpi/ic_timeout_dark.png -------------------------------------------------------------------------------- /Superuser/res/drawable-hdpi/ic_toggle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-hdpi/ic_toggle.png -------------------------------------------------------------------------------- /Superuser/res/drawable-hdpi/ic_toggle_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-hdpi/ic_toggle_dark.png -------------------------------------------------------------------------------- /Superuser/res/drawable-hdpi/ic_users.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-hdpi/ic_users.png -------------------------------------------------------------------------------- /Superuser/res/drawable-hdpi/ic_users_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-hdpi/ic_users_dark.png -------------------------------------------------------------------------------- /Superuser/res/drawable-ldpi-v11/ic_stat_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-ldpi-v11/ic_stat_notification.png -------------------------------------------------------------------------------- /Superuser/res/drawable-ldpi-v9/ic_stat_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-ldpi-v9/ic_stat_notification.png -------------------------------------------------------------------------------- /Superuser/res/drawable-mdpi-v11/ic_stat_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-mdpi-v11/ic_stat_notification.png -------------------------------------------------------------------------------- /Superuser/res/drawable-mdpi-v9/ic_stat_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-mdpi-v9/ic_stat_notification.png -------------------------------------------------------------------------------- /Superuser/res/drawable-mdpi/ic_action_about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-mdpi/ic_action_about.png -------------------------------------------------------------------------------- /Superuser/res/drawable-mdpi/ic_action_logs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-mdpi/ic_action_logs.png -------------------------------------------------------------------------------- /Superuser/res/drawable-mdpi/ic_action_permission.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-mdpi/ic_action_permission.png -------------------------------------------------------------------------------- /Superuser/res/drawable-mdpi/ic_action_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-mdpi/ic_action_settings.png -------------------------------------------------------------------------------- /Superuser/res/drawable-mdpi/ic_action_trash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-mdpi/ic_action_trash.png -------------------------------------------------------------------------------- /Superuser/res/drawable-mdpi/ic_alert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-mdpi/ic_alert.png -------------------------------------------------------------------------------- /Superuser/res/drawable-mdpi/ic_alert_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-mdpi/ic_alert_dark.png -------------------------------------------------------------------------------- /Superuser/res/drawable-mdpi/ic_allow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-mdpi/ic_allow.png -------------------------------------------------------------------------------- /Superuser/res/drawable-mdpi/ic_delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-mdpi/ic_delete.png -------------------------------------------------------------------------------- /Superuser/res/drawable-mdpi/ic_deny.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-mdpi/ic_deny.png -------------------------------------------------------------------------------- /Superuser/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /Superuser/res/drawable-mdpi/ic_logging.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-mdpi/ic_logging.png -------------------------------------------------------------------------------- /Superuser/res/drawable-mdpi/ic_logging_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-mdpi/ic_logging_dark.png -------------------------------------------------------------------------------- /Superuser/res/drawable-mdpi/ic_menu_about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-mdpi/ic_menu_about.png -------------------------------------------------------------------------------- /Superuser/res/drawable-mdpi/ic_menu_logs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-mdpi/ic_menu_logs.png -------------------------------------------------------------------------------- /Superuser/res/drawable-mdpi/ic_menu_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-mdpi/ic_menu_settings.png -------------------------------------------------------------------------------- /Superuser/res/drawable-mdpi/ic_menu_trash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-mdpi/ic_menu_trash.png -------------------------------------------------------------------------------- /Superuser/res/drawable-mdpi/ic_notifications.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-mdpi/ic_notifications.png -------------------------------------------------------------------------------- /Superuser/res/drawable-mdpi/ic_notifications_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-mdpi/ic_notifications_dark.png -------------------------------------------------------------------------------- /Superuser/res/drawable-mdpi/ic_protected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-mdpi/ic_protected.png -------------------------------------------------------------------------------- /Superuser/res/drawable-mdpi/ic_protected_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-mdpi/ic_protected_dark.png -------------------------------------------------------------------------------- /Superuser/res/drawable-mdpi/ic_stat_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-mdpi/ic_stat_notification.png -------------------------------------------------------------------------------- /Superuser/res/drawable-mdpi/ic_theme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-mdpi/ic_theme.png -------------------------------------------------------------------------------- /Superuser/res/drawable-mdpi/ic_theme_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-mdpi/ic_theme_dark.png -------------------------------------------------------------------------------- /Superuser/res/drawable-mdpi/ic_timeout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-mdpi/ic_timeout.png -------------------------------------------------------------------------------- /Superuser/res/drawable-mdpi/ic_timeout_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-mdpi/ic_timeout_dark.png -------------------------------------------------------------------------------- /Superuser/res/drawable-mdpi/ic_toggle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-mdpi/ic_toggle.png -------------------------------------------------------------------------------- /Superuser/res/drawable-mdpi/ic_toggle_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-mdpi/ic_toggle_dark.png -------------------------------------------------------------------------------- /Superuser/res/drawable-mdpi/ic_users.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-mdpi/ic_users.png -------------------------------------------------------------------------------- /Superuser/res/drawable-mdpi/ic_users_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-mdpi/ic_users_dark.png -------------------------------------------------------------------------------- /Superuser/res/drawable-xhdpi-v11/ic_stat_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-xhdpi-v11/ic_stat_notification.png -------------------------------------------------------------------------------- /Superuser/res/drawable-xhdpi-v9/ic_stat_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-xhdpi-v9/ic_stat_notification.png -------------------------------------------------------------------------------- /Superuser/res/drawable-xhdpi/ic_action_about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-xhdpi/ic_action_about.png -------------------------------------------------------------------------------- /Superuser/res/drawable-xhdpi/ic_action_logs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-xhdpi/ic_action_logs.png -------------------------------------------------------------------------------- /Superuser/res/drawable-xhdpi/ic_action_permission.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-xhdpi/ic_action_permission.png -------------------------------------------------------------------------------- /Superuser/res/drawable-xhdpi/ic_action_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-xhdpi/ic_action_settings.png -------------------------------------------------------------------------------- /Superuser/res/drawable-xhdpi/ic_action_trash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-xhdpi/ic_action_trash.png -------------------------------------------------------------------------------- /Superuser/res/drawable-xhdpi/ic_alert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-xhdpi/ic_alert.png -------------------------------------------------------------------------------- /Superuser/res/drawable-xhdpi/ic_alert_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-xhdpi/ic_alert_dark.png -------------------------------------------------------------------------------- /Superuser/res/drawable-xhdpi/ic_allow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-xhdpi/ic_allow.png -------------------------------------------------------------------------------- /Superuser/res/drawable-xhdpi/ic_delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-xhdpi/ic_delete.png -------------------------------------------------------------------------------- /Superuser/res/drawable-xhdpi/ic_deny.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-xhdpi/ic_deny.png -------------------------------------------------------------------------------- /Superuser/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Superuser/res/drawable-xhdpi/ic_logging.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-xhdpi/ic_logging.png -------------------------------------------------------------------------------- /Superuser/res/drawable-xhdpi/ic_logging_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-xhdpi/ic_logging_dark.png -------------------------------------------------------------------------------- /Superuser/res/drawable-xhdpi/ic_menu_about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-xhdpi/ic_menu_about.png -------------------------------------------------------------------------------- /Superuser/res/drawable-xhdpi/ic_menu_logs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-xhdpi/ic_menu_logs.png -------------------------------------------------------------------------------- /Superuser/res/drawable-xhdpi/ic_menu_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-xhdpi/ic_menu_settings.png -------------------------------------------------------------------------------- /Superuser/res/drawable-xhdpi/ic_menu_trash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-xhdpi/ic_menu_trash.png -------------------------------------------------------------------------------- /Superuser/res/drawable-xhdpi/ic_notifications.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-xhdpi/ic_notifications.png -------------------------------------------------------------------------------- /Superuser/res/drawable-xhdpi/ic_notifications_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-xhdpi/ic_notifications_dark.png -------------------------------------------------------------------------------- /Superuser/res/drawable-xhdpi/ic_protected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-xhdpi/ic_protected.png -------------------------------------------------------------------------------- /Superuser/res/drawable-xhdpi/ic_protected_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-xhdpi/ic_protected_dark.png -------------------------------------------------------------------------------- /Superuser/res/drawable-xhdpi/ic_stat_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-xhdpi/ic_stat_notification.png -------------------------------------------------------------------------------- /Superuser/res/drawable-xhdpi/ic_theme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-xhdpi/ic_theme.png -------------------------------------------------------------------------------- /Superuser/res/drawable-xhdpi/ic_theme_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-xhdpi/ic_theme_dark.png -------------------------------------------------------------------------------- /Superuser/res/drawable-xhdpi/ic_timeout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-xhdpi/ic_timeout.png -------------------------------------------------------------------------------- /Superuser/res/drawable-xhdpi/ic_timeout_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-xhdpi/ic_timeout_dark.png -------------------------------------------------------------------------------- /Superuser/res/drawable-xhdpi/ic_toggle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-xhdpi/ic_toggle.png -------------------------------------------------------------------------------- /Superuser/res/drawable-xhdpi/ic_toggle_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-xhdpi/ic_toggle_dark.png -------------------------------------------------------------------------------- /Superuser/res/drawable-xhdpi/ic_users.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-xhdpi/ic_users.png -------------------------------------------------------------------------------- /Superuser/res/drawable-xhdpi/ic_users_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-xhdpi/ic_users_dark.png -------------------------------------------------------------------------------- /Superuser/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Superuser/res/drawable/carbon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable/carbon.png -------------------------------------------------------------------------------- /Superuser/res/drawable/clockwork512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable/clockwork512.png -------------------------------------------------------------------------------- /Superuser/res/drawable/desksms.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable/desksms.png -------------------------------------------------------------------------------- /Superuser/res/drawable/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable/github.png -------------------------------------------------------------------------------- /Superuser/res/drawable/koush.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable/koush.png -------------------------------------------------------------------------------- /Superuser/res/drawable/tether.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phhusson/Superuser/9ae9705874b9fc7d3990aac639ab9667b06519c0/Superuser/res/drawable/tether.png -------------------------------------------------------------------------------- /Superuser/res/layout-land/app_request.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Superuser/res/layout-land/log_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Superuser/res/layout-large-land/policy_list_content.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Superuser/res/layout-large/app_request.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Superuser/res/layout-large/policy_list_content.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Superuser/res/layout-v14/log_toggle.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Superuser/res/layout-v14/notification_toggle.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Superuser/res/layout/app_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /Superuser/res/layout/app_request.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Superuser/res/layout/empty.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | -------------------------------------------------------------------------------- /Superuser/res/layout/log_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Superuser/res/layout/log_toggle.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Superuser/res/layout/notification_toggle.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Superuser/res/layout/policy_list_content.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Superuser/res/layout/request_choices.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 14 | 15 | 20 | 21 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Superuser/res/layout/request_spinner.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /Superuser/res/layout/request_spinner_choice.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 12 | 13 | -------------------------------------------------------------------------------- /Superuser/res/layout/settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | 21 | 22 | 34 | 35 | 40 | 41 | -------------------------------------------------------------------------------- /Superuser/res/layout/unknown_app.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | -------------------------------------------------------------------------------- /Superuser/res/menu-v11/app.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | -------------------------------------------------------------------------------- /Superuser/res/menu-v11/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Superuser/res/menu-v11/policy.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | -------------------------------------------------------------------------------- /Superuser/res/menu/app.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 11 | 12 | -------------------------------------------------------------------------------- /Superuser/res/menu/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | -------------------------------------------------------------------------------- /Superuser/res/menu/policy.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /Superuser/res/values-large-v14/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /Superuser/res/values-sw600dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | -------------------------------------------------------------------------------- /Superuser/res/values-sw720dp-land/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | -------------------------------------------------------------------------------- /Superuser/res/values-v14/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 12 | -------------------------------------------------------------------------------- /Superuser/res/values-zh-rHK/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 18 | 19 | 允許 20 | 記住選擇 %s 分鐘 21 | 永遠記住選擇 22 | 刪除 23 | 通知 24 | %s 秒 25 | 通知 26 | 主題 27 | 深色 28 | 29 | -------------------------------------------------------------------------------- /Superuser/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Superuser/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 4dp 6 | -------------------------------------------------------------------------------- /Superuser/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':Widgets' 2 | project(':Widgets').projectDir = new File(settingsDir, '../Widgets/Widgets') 3 | -------------------------------------------------------------------------------- /Superuser/src/com/koushikdutta/superuser/RequestActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Koushik Dutta (@koush) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.koushikdutta.superuser; 18 | 19 | import android.app.Activity; 20 | import android.content.Intent; 21 | import android.os.Bundle; 22 | 23 | public class RequestActivity extends Activity { 24 | @Override 25 | protected void onCreate(Bundle savedInstanceState) { 26 | super.onCreate(savedInstanceState); 27 | 28 | Intent intent = getIntent(); 29 | if (intent == null) { 30 | finish(); 31 | return; 32 | } 33 | 34 | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 35 | String name = getClass().getPackage().getName() + "." + MultitaskSuRequestActivity.class.getSimpleName(); 36 | intent.setClassName(this, name); 37 | startActivity(intent); 38 | finish(); 39 | return; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Superuser/src/com/koushikdutta/superuser/SuApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Koushik Dutta (@koush) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.koushikdutta.superuser; 18 | 19 | import com.koushikdutta.superuser.db.SuDatabaseHelper; 20 | 21 | import android.app.Application; 22 | 23 | public class SuApplication extends Application { 24 | @Override 25 | public void onCreate() { 26 | super.onCreate(); 27 | 28 | new SuDatabaseHelper(this).getWritableDatabase().close(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Superuser/src/com/koushikdutta/superuser/db/LogEntry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Koushik Dutta (@koush) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.koushikdutta.superuser.db; 18 | 19 | import java.util.Date; 20 | 21 | import com.koushikdutta.superuser.R; 22 | 23 | public class LogEntry extends UidCommand { 24 | public long id; 25 | public String action; 26 | public int date; 27 | 28 | public Date getDate() { 29 | return new Date((long)date * 1000); 30 | } 31 | 32 | public int getActionResource() { 33 | if (UidPolicy.ALLOW.equals(action)) 34 | return R.string.allow; 35 | else if (UidPolicy.INTERACTIVE.equals(action)) 36 | return R.string.interactive; 37 | return R.string.deny; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Superuser/src/com/koushikdutta/superuser/db/UidPolicy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Koushik Dutta (@koush) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.koushikdutta.superuser.db; 18 | 19 | import java.util.Date; 20 | 21 | import com.koushikdutta.superuser.R; 22 | 23 | public class UidPolicy extends UidCommand { 24 | public static final String ALLOW = "allow"; 25 | public static final String DENY = "deny"; 26 | public static final String INTERACTIVE = "interactive"; 27 | 28 | public String policy; 29 | public int until; 30 | public boolean logging = true; 31 | public boolean notification = true; 32 | public Date getUntilDate() { 33 | return new Date((long)until * 1000); 34 | } 35 | 36 | public int getPolicyResource() { 37 | if (ALLOW.equals(policy)) 38 | return R.string.allow; 39 | else if (INTERACTIVE.equals(policy)) 40 | return R.string.interactive; 41 | return R.string.deny; 42 | } 43 | 44 | public String getPolicy() { 45 | return policy; 46 | } 47 | 48 | public void setPolicy(String policy){ 49 | this.policy = policy; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Superuser/src/com/koushikdutta/superuser/util/ImageCache.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Koushik Dutta (@koush) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.koushikdutta.superuser.util; 18 | 19 | import android.graphics.drawable.Drawable; 20 | 21 | public final class ImageCache extends SoftReferenceHashTable { 22 | private static ImageCache mInstance = new ImageCache(); 23 | 24 | public static ImageCache getInstance() { 25 | return mInstance; 26 | } 27 | 28 | private ImageCache() { 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Superuser/src/com/koushikdutta/superuser/util/SoftReferenceHashTable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Koushik Dutta (@koush) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.koushikdutta.superuser.util; 18 | 19 | import java.lang.ref.SoftReference; 20 | import java.util.Hashtable; 21 | 22 | public class SoftReferenceHashTable { 23 | Hashtable> mTable = new Hashtable>(); 24 | 25 | public V put(K key, V value) { 26 | SoftReference old = mTable.put(key, new SoftReference(value)); 27 | if (old == null) 28 | return null; 29 | return old.get(); 30 | } 31 | 32 | public V get(K key) { 33 | SoftReference val = mTable.get(key); 34 | if (val == null) 35 | return null; 36 | V ret = val.get(); 37 | if (ret == null) 38 | mTable.remove(key); 39 | return ret; 40 | } 41 | 42 | public V remove(K k) { 43 | SoftReference v = mTable.remove(k); 44 | if (v == null) 45 | return null; 46 | return v.get(); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Superuser/src/com/koushikdutta/superuser/util/SuHelper.java: -------------------------------------------------------------------------------- 1 | package com.koushikdutta.superuser.util; 2 | 3 | import android.content.Context; 4 | import android.util.Log; 5 | 6 | public class SuHelper { 7 | public static String CURRENT_VERSION = "17"; 8 | public static void checkSu(Context context) throws Exception { 9 | Process p = Runtime.getRuntime().exec("su -v"); 10 | String result = Settings.readToEnd(p.getInputStream()); 11 | Log.i("Superuser", "Result: " + result); 12 | if (0 != p.waitFor()) 13 | throw new Exception("non zero result"); 14 | if (result == null) 15 | throw new Exception("no data"); 16 | if (!result.contains(context.getPackageName())) 17 | throw new Exception("unknown su"); 18 | 19 | String[] parts = result.split(" "); 20 | if (!CURRENT_VERSION.equals(parts[0])) 21 | throw new Exception("binary is old"); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /init.superuser.rc: -------------------------------------------------------------------------------- 1 | # su daemon 2 | service su_daemon /system/xbin/su --daemon 3 | oneshot 4 | 5 | on property:persist.sys.root_access=0 6 | stop su_daemon 7 | 8 | on property:persist.sys.root_access=2 9 | stop su_daemon 10 | 11 | on property:persist.sys.root_access=1 12 | start su_daemon 13 | 14 | on property:persist.sys.root_access=3 15 | start su_daemon 16 | -------------------------------------------------------------------------------- /local_manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | --------------------------------------------------------------------------------