├── .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