diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..738de0e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/src/ +/work/ diff --git a/README.md b/README.md index 78aac8f..6ff9203 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,12 @@ Create system.img for ZenFone - Build `make_ext4fs` binary for packing `system.img` - `make_ext4fs` will be in `work` directory -2. run `scripts/build.sh` +2. run `scripts/build_applypatch.sh` + - Fetch required source tree from AOSP to `src` directory + - Build `applypatch` binary for applying delta OTA updates + - `applypatch` will be in `work` directory + +3. run `scripts/build.sh` - Fetch ROM file of ZenFone 5 (1.17.40.16, WW version) to `work` directory - Extract ROM file and get system directory - Inject root package diff --git a/assets/applypatch.patch b/assets/applypatch.patch new file mode 100644 index 0000000..e67610c --- /dev/null +++ b/assets/applypatch.patch @@ -0,0 +1,161 @@ +diff --git a/recovery/applypatch/applypatch.c b/recovery/applypatch/applypatch.c +index 2c86e09..58d1596 100644 +--- a/recovery/applypatch/applypatch.c ++++ b/recovery/applypatch/applypatch.c +@@ -20,7 +20,14 @@ + #include + #include + #include ++ ++#ifdef __APPLE__ ++#include ++#include ++#else + #include ++#endif ++ + #include + #include + #include +@@ -31,7 +38,10 @@ + #include "mtdutils/mtdutils.h" + #include "edify/expr.h" + ++#if !defined(__APPLE__) && !defined(__CYGWIN__) + static int LoadPartitionContents(const char* filename, FileContents* file); ++#endif ++ + static ssize_t FileSink(const unsigned char* data, ssize_t len, void* token); + static int GenerateTarget(FileContents* source_file, + const Value* source_patch_value, +@@ -56,7 +66,11 @@ int LoadFileContents(const char* filename, FileContents* file) { + // load the contents of a partition. + if (strncmp(filename, "MTD:", 4) == 0 || + strncmp(filename, "EMMC:", 5) == 0) { ++#if defined(__APPLE__) || defined(__CYGWIN__) ++ return -1; ++#else + return LoadPartitionContents(filename, file); ++#endif + } + + if (stat(filename, &file->st) != 0) { +@@ -104,6 +118,7 @@ static int compare_size_indices(const void* a, const void* b) { + } + } + ++#if !defined(__APPLE__) && !defined(__CYGWIN__) + // Load the contents of an MTD or EMMC partition into the provided + // FileContents. filename should be a string of the form + // "MTD::::::..." (or +@@ -304,7 +319,7 @@ static int LoadPartitionContents(const char* filename, FileContents* file) { + + return 0; + } +- ++#endif + + // Save the contents of the given FileContents object under the given + // filename. Return 0 on success. +@@ -345,6 +360,7 @@ int SaveFileContents(const char* filename, const FileContents* file) { + return 0; + } + ++#if !defined(__APPLE__) && !defined(__CYGWIN__) + // Write a memory buffer to 'target' partition, a string of the form + // "MTD:[:...]" or "EMMC::". Return 0 on + // success. +@@ -524,6 +540,7 @@ int WriteToPartition(unsigned char* data, size_t len, + free(copy); + return 0; + } ++#endif + + + // Take a string 'str' of 40 hex digits and parse it into the 20 +@@ -1009,11 +1026,15 @@ static int GenerateTarget(FileContents* source_file, + } + + if (output < 0) { ++#if defined(__APPLE__) || defined(__CYGWIN__) ++ return 1; ++#else + // Copy the temp file to the partition. + if (WriteToPartition(msi.buffer, msi.pos, target_filename) != 0) { + printf("write of patched data to %s failed\n", target_filename); + return 1; + } ++#endif + free(msi.buffer); + } else { + // Give the .patch file the same owner, group, and mode of the +diff --git a/recovery/applypatch/applypatch.h b/recovery/applypatch/applypatch.h +index edec848..6cfa498 100644 +--- a/recovery/applypatch/applypatch.h ++++ b/recovery/applypatch/applypatch.h +@@ -38,7 +38,7 @@ typedef struct _FileContents { + // it to free up space. If the expected source file doesn't exist, or + // is corrupted, we look to see if this file contains the bits we want + // and use it as the source instead. +-#define CACHE_TEMP_SOURCE "/cache/saved.file" ++#define CACHE_TEMP_SOURCE "saved.file" + + typedef ssize_t (*SinkFn)(const unsigned char*, ssize_t, void*); + +diff --git a/recovery/applypatch/bspatch.c b/recovery/applypatch/bspatch.c +index b34ec2a..b9fb174 100644 +--- a/recovery/applypatch/bspatch.c ++++ b/recovery/applypatch/bspatch.c +@@ -28,6 +28,10 @@ + + #include + ++#ifdef __APPLE__ ++#include ++#endif ++ + #include "mincrypt/sha.h" + #include "applypatch.h" + +@@ -63,7 +67,7 @@ void ShowBSDiffLicense() { + ); + } + +-static off_t offtin(u_char *buf) ++static off_t offtin(unsigned char *buf) + { + off_t y; + +diff --git a/recovery/applypatch/freecache.c b/recovery/applypatch/freecache.c +index 9827fda..d308a57 100644 +--- a/recovery/applypatch/freecache.c ++++ b/recovery/applypatch/freecache.c +@@ -4,7 +4,14 @@ + #include + #include + #include ++ ++#ifdef __APPLE__ ++#include ++#include ++#else + #include ++#endif ++ + #include + #include + #include + +diff --git a/recovery/applypatch/imgpatch.c b/recovery/applypatch/imgpatch.c +index 33c4487..38cbbd8 100644 +--- a/recovery/applypatch/imgpatch.c ++++ b/recovery/applypatch/imgpatch.c +@@ -36,7 +36,7 @@ + * file, and update the SHA context with the output data as well. + * Return 0 on success. + */ +-int ApplyImagePatch(const unsigned char* old_data, ssize_t old_size __unused, ++int ApplyImagePatch(const unsigned char* old_data, ssize_t old_size, + const Value* patch, + SinkFn sink, void* token, SHA_CTX* ctx, + const Value* bonus_data) { diff --git a/assets/exclude_apps_list b/assets/exclude_apps_list new file mode 100644 index 0000000..83a9bcb --- /dev/null +++ b/assets/exclude_apps_list @@ -0,0 +1,252 @@ +# Essential +#BackupRestoreConfirmation +#Bluetooth +#CaptivePortalLogin +#CertInstaller +#ContactsProvider +#DocumentsUI +#DownloadProvider +#DownloadProviderUi +#ExternalStorageProvider +#FusedLocation +#GmsCore +#GoogleBackupTransport +#GoogleCalendarSyncAdapter +#GoogleContactsSyncAdapter +#GoogleFeedback +#GoogleLoginService +#GoogleOneTimeInitializer +#GooglePartnerSetup +#GoogleServicesFramework +#HTMLViewer +#KeyChain +#LiveWallpapers +#LiveWallpapersPicker +#LocationPicker +#MediaProvider +#MmsService +#NfcNci +#OemTelephonyApp +#PackageInstaller +#PacProcessor +#Phonesky +#PowerHistory +#SettingsProvider +#SetupWizard +#SharedStorageBackup +#Shell +#Stk +#Stk2 +#Tag +#TaskManager +#TeleService +#Telecom +#TelephonyProvider +#UserDictionaryProvider +#VpnDialogs +#WallpaperCropper +#WAPPushManager +#WebViewGoogle +#webview +#BrowserProviderProxy +#CalendarProvider +#PartnerBookmarksProvider +#SmartcardService +#PrintSpooler +#ProxyHandler +#PicoTts +#MusicFX +#InputDevices +#ManagedProvisioning +#ConfigUpdater +#DefaultContainerService +#Keyboard + +# Intel stuff +#AwareResource +#CWSClientService +#HdmiSettings +#SARManager +#SensorCal +#VppSettings +#WidiInputService +#ituxd +#sl_installer +#SepService +#WirelessDisplayUtil + +# ZenUI (system) +#AsusHoudiniXmlUpdater +#AsusSettings +AsusSetupWizard +#AsusSystemUI +#AsusSensorService +QuickMemoService +#ShimProcess +#PlayTo +#MobileManager +#MobileManagerService +#AsusInputDevices +#DLNAService +#ICEsoundService +#Transformer +#AsusAs +#AsusBoost +#AsusCellBroadcast +#AsusDrawRes +#PAIStub +#XT9IME +#Lockscreen + +# ZenUI apps cannot working outside of system +AsusBackup +#AsusSplendid +#AsusSplendidCommandAgent +#AudioWizard +#AudioWizardView +#DeskClock +# must installed with DeskClock +#PowerSaving2 +#FlipCover +#FlipCover2 +#ASUSZenUIPCSuite + +########## Optional Packages ########## +# Google +Books +Chrome +Drive +DriveActivator +Gmail2 +Hangouts +Maps +Music2 +Newsstand +PlayGames +PlusOne +QuickSearch +Street +Velvet +Videos +YouTube +talkback + +# Live Wallpapers +Galaxy4 +HoloSpiralWallpaper +NoiseField +PhaseBeam +VisualizationWallpapers + +# Dreams +BasicDreams +PhotoTable + +# Theme +#AsusThemeApp +#AsusDefaultTheme +#AsusFreshGreenTheme +#AsusLovelyPinkTheme + +# Fonts +#Syndor +#Flipfont +#MFinanceHK-Bold +#MYingHei_18030-M +#MYuppyHK_Medium + +# Link tools +PCLinkBinary +# To use PCLink this should be in system +#PCLinkManager +# Use with AsusCamera +#PartyRimBinary +RemoteLink +ShareRimBinary + +# ZenUI app +ASUSBrowser +# Use with AsusCamera { +#ASUSGallery +#ASUSGalleryBurst +# Use with AsusCamera } +AsusCalculator +AsusCalendar +#AsusCamera +#AsusContacts +AsusEmail +#AsusInCallUI +#AsusLauncher +#AsusMessage +AsusMusic +AsusPhotoCollage +PhotoCollage +AsusTask +#AsusZenUIServices +QuickMemo +SoundRecorder +SuperNote +WeatherTime +WhatsNext +#FileManager2 +FlashLight +MicroFilm + +# ASUS apps +MyASUS +AppLocker +MyWater +AWS +ZenUIHelp +MyFrame +PhotoFrameWidget +AsusEasyLauncher +AsusFMRadio +AsusFMService +AsusKidsLauncher +AsusMirror +DataTransfor +ZenCircle +ZenTalkStub +GameCenter +BRapps +AsusQuickSearch +ZenFlash + +########## Safe to remove ########## +# Debug / Update or not-used-service +DMClient +SystemUpdate +UpdateLauncher +SMMI_TEST +DetectLogApp +LogUploader +AsusLiveDemoService +AsusLiveDemoUI + +# Bloatware (not ASUS) +Ezding +DrSafety +Dreye +Gameloft +Omlet +Omlet-stub +BbblerActors +CleanMaster +CMSKeyV2 +CMSKeyV3 +JawboneUP +KKBOX +Kindle +KindleStub +ThinkFree +Tripadvisor +YahooECShopping +YahooMall +ZinioReader +ZinioSettingsProvider +eztable +eReadingNow +PubuBookBuffet +YahooAuction +Asphalt diff --git a/assets/file_contexts_t00f b/assets/file_contexts_t00f new file mode 100644 index 0000000..fb9428d --- /dev/null +++ b/assets/file_contexts_t00f @@ -0,0 +1,391 @@ +#line 1 "external/sepolicy/file_contexts" +########################################### +# Root +/ u:object_r:rootfs:s0 + +# Data files +/adb_keys u:object_r:adb_keys_file:s0 +/default\.prop u:object_r:rootfs:s0 +/fstab\..* u:object_r:rootfs:s0 +/init\..* u:object_r:rootfs:s0 +/res(/.*)? u:object_r:rootfs:s0 +/ueventd\..* u:object_r:rootfs:s0 + +# Executables +/charger u:object_r:rootfs:s0 +/init u:object_r:rootfs:s0 +/sbin(/.*)? u:object_r:rootfs:s0 + +# Empty directories +/lost\+found u:object_r:rootfs:s0 +/proc u:object_r:rootfs:s0 + +# SELinux policy files +/file_contexts u:object_r:rootfs:s0 +/property_contexts u:object_r:rootfs:s0 +/seapp_contexts u:object_r:rootfs:s0 +/sepolicy u:object_r:rootfs:s0 + +########################## +# Devices +# +/dev(/.*)? u:object_r:device:s0 +/dev/akm8973.* u:object_r:sensors_device:s0 +/dev/accelerometer u:object_r:sensors_device:s0 +/dev/adf[0-9]* u:object_r:graphics_device:s0 +/dev/adf-interface[0-9]*\.[0-9]* u:object_r:graphics_device:s0 +/dev/adf-overlay-engine[0-9]*\.[0-9]* u:object_r:graphics_device:s0 +/dev/alarm u:object_r:alarm_device:s0 +/dev/android_adb.* u:object_r:adb_device:s0 +/dev/android_pclink.* u:object_r:pclink_device:s0 +/dev/ashmem u:object_r:ashmem_device:s0 +/dev/audio.* u:object_r:audio_device:s0 +/dev/binder u:object_r:binder_device:s0 +/dev/block(/.*)? u:object_r:block_device:s0 +/dev/block/loop[0-9]* u:object_r:loop_device:s0 +/dev/block/ram[0-9]* u:object_r:ram_device:s0 +/dev/bus/usb(.*)? u:object_r:usb_device:s0 +/dev/cam u:object_r:camera_device:s0 +/dev/console u:object_r:console_device:s0 +/dev/cpuctl(/.*)? u:object_r:cpuctl_device:s0 +/dev/device-mapper u:object_r:dm_device:s0 +/dev/eac u:object_r:audio_device:s0 +/dev/fscklogs(/.*)? u:object_r:fscklogs:s0 +/dev/full u:object_r:full_device:s0 +/dev/fuse u:object_r:fuse_device:s0 +/dev/graphics(/.*)? u:object_r:graphics_device:s0 +/dev/hw_random u:object_r:hw_random_device:s0 +/dev/input(/.*) u:object_r:input_device:s0 +/dev/iio:device[0-9]+ u:object_r:iio_device:s0 +/dev/ion u:object_r:ion_device:s0 +/dev/kmem u:object_r:kmem_device:s0 +/dev/log(/.*)? u:object_r:log_device:s0 +/dev/mem u:object_r:kmem_device:s0 +/dev/modem.* u:object_r:radio_device:s0 +/dev/mpu u:object_r:gps_device:s0 +/dev/mpuirq u:object_r:gps_device:s0 +/dev/mtd(/.*)? u:object_r:mtd_device:s0 +/dev/mtp_usb u:object_r:mtp_device:s0 +/dev/pn544 u:object_r:nfc_device:s0 +/dev/ppp u:object_r:ppp_device:s0 +/dev/ptmx u:object_r:ptmx_device:s0 +/dev/pvrsrvkm u:object_r:gpu_device:s0 +/dev/kmsg u:object_r:kmsg_device:s0 +/dev/null u:object_r:null_device:s0 +/dev/nvhdcp1 u:object_r:video_device:s0 +/dev/random u:object_r:random_device:s0 +/dev/rpmsg-omx[0-9] u:object_r:rpmsg_device:s0 +/dev/rproc_user u:object_r:rpmsg_device:s0 +/dev/snd(/.*)? u:object_r:audio_device:s0 +/dev/socket(/.*)? u:object_r:socket_device:s0 +/dev/socket/adbd u:object_r:adbd_socket:s0 +/dev/socket/pclinkd u:object_r:pclinkd_socket:s0 +/dev/socket/dnsproxyd u:object_r:dnsproxyd_socket:s0 +/dev/socket/dumpstate u:object_r:dumpstate_socket:s0 +/dev/socket/fwmarkd u:object_r:fwmarkd_socket:s0 +/dev/socket/gps u:object_r:gps_socket:s0 +/dev/socket/installd u:object_r:installd_socket:s0 +/dev/socket/lmkd u:object_r:lmkd_socket:s0 +/dev/logd_debug u:object_r:logd_debug:s0 +/dev/socket/logd u:object_r:logd_socket:s0 +/dev/socket/logdr u:object_r:logdr_socket:s0 +/dev/socket/logdw u:object_r:logdw_socket:s0 +/dev/socket/mdns u:object_r:mdns_socket:s0 +/dev/socket/mdnsd u:object_r:mdnsd_socket:s0 +/dev/socket/mtpd u:object_r:mtpd_socket:s0 +/dev/socket/netd u:object_r:netd_socket:s0 +/dev/socket/property_service u:object_r:property_socket:s0 +/dev/socket/racoon u:object_r:racoon_socket:s0 +/dev/socket/rild u:object_r:rild_socket:s0 +/dev/socket/rild-debug u:object_r:rild_debug_socket:s0 +/dev/socket/vold u:object_r:vold_socket:s0 +/dev/socket/wpa_eth[0-9] u:object_r:wpa_socket:s0 +/dev/socket/wpa_wlan[0-9] u:object_r:wpa_socket:s0 +/dev/socket/zygote u:object_r:zygote_socket:s0 +/dev/socket/zygote_secondary u:object_r:zygote_socket:s0 +/dev/spdif_out.* u:object_r:audio_device:s0 +/dev/tegra.* u:object_r:video_device:s0 +/dev/tf_driver u:object_r:tee_device:s0 +/dev/tty u:object_r:owntty_device:s0 +/dev/tty[0-9]* u:object_r:tty_device:s0 +/dev/ttyS[0-9]* u:object_r:serial_device:s0 +/dev/tun u:object_r:tun_device:s0 +/dev/uhid u:object_r:uhid_device:s0 +/dev/uinput u:object_r:uhid_device:s0 +/dev/uio[0-9]* u:object_r:uio_device:s0 +/dev/urandom u:object_r:urandom_device:s0 +/dev/usb_accessory u:object_r:usbaccessory_device:s0 +/dev/vcs[0-9a-z]* u:object_r:vcs_device:s0 +/dev/video[0-9]* u:object_r:video_device:s0 +/dev/watchdog u:object_r:watchdog_device:s0 +/dev/xt_qtaguid u:object_r:qtaguid_device:s0 +/dev/zero u:object_r:zero_device:s0 +/dev/__kmsg__ u:object_r:klog_device:s0 +/dev/__properties__ u:object_r:properties_device:s0 +############################# +# System files +# +/system(/.*)? u:object_r:system_file:s0 +/system/bin/sh -- u:object_r:shell_exec:s0 +/system/bin/run-as -- u:object_r:runas_exec:s0 +/system/bin/bootanimation u:object_r:bootanim_exec:s0 +/system/bin/app_process32 u:object_r:zygote_exec:s0 +/system/bin/app_process64 u:object_r:zygote_exec:s0 +/system/bin/servicemanager u:object_r:servicemanager_exec:s0 +/system/bin/surfaceflinger u:object_r:surfaceflinger_exec:s0 +/system/bin/drmserver u:object_r:drmserver_exec:s0 +/system/bin/dumpstate u:object_r:dumpstate_exec:s0 +/system/bin/vold u:object_r:vold_exec:s0 +/system/bin/netd u:object_r:netd_exec:s0 +/system/bin/rild u:object_r:rild_exec:s0 +/system/bin/mediaserver u:object_r:mediaserver_exec:s0 +/system/bin/mdnsd u:object_r:mdnsd_exec:s0 +/system/bin/installd u:object_r:installd_exec:s0 +/system/bin/keystore u:object_r:keystore_exec:s0 +/system/bin/debuggerd u:object_r:debuggerd_exec:s0 +/system/bin/debuggerd64 u:object_r:debuggerd_exec:s0 +/system/bin/wpa_supplicant u:object_r:wpa_exec:s0 +/system/bin/sdcard u:object_r:sdcardd_exec:s0 +/system/bin/dhcpcd u:object_r:dhcp_exec:s0 +/system/bin/mtpd u:object_r:mtp_exec:s0 +/system/bin/pppd u:object_r:ppp_exec:s0 +/system/bin/tf_daemon u:object_r:tee_exec:s0 +/system/bin/racoon u:object_r:racoon_exec:s0 +# for root +/system/xbin/sugote u:object_r:zygote_exec:s0 +/system/bin/app_process32_original u:object_r:zygote_exec:s0 +/system/bin/app_process_init u:object_r:zygote_exec:s0 +/system/bin/app_process32_xposed u:object_r:zygote_exec:s0 +# +/system/vendor/bin/gpsd u:object_r:gpsd_exec:s0 +/system/bin/dnsmasq u:object_r:dnsmasq_exec:s0 +/system/bin/hostapd u:object_r:hostapd_exec:s0 +/system/bin/clatd u:object_r:clatd_exec:s0 +/system/bin/lmkd u:object_r:lmkd_exec:s0 +/system/bin/inputflinger u:object_r:inputflinger_exec:s0 +/system/bin/logd u:object_r:logd_exec:s0 +/system/bin/uncrypt u:object_r:uncrypt_exec:s0 +/system/bin/logwrapper u:object_r:system_file:s0 +/system/bin/vdc u:object_r:vdc_exec:s0 +/system/bin/install-recovery.sh u:object_r:install_recovery_exec:s0 +/system/bin/dex2oat u:object_r:dex2oat_exec:s0 +# patchoat executable has (essentially) the same requirements as dex2oat. +/system/bin/patchoat u:object_r:dex2oat_exec:s0 + +############################# +# Vendor files +# +/vendor(/.*)? u:object_r:system_file:s0 +/vendor/bin/gpsd u:object_r:gpsd_exec:s0 +############################# +# Data files +# +/data(/.*)? u:object_r:system_data_file:s0 +/data/.layout_version u:object_r:install_data_file:s0 +/data/backup(/.*)? u:object_r:backup_data_file:s0 +/data/secure/backup(/.*)? u:object_r:backup_data_file:s0 +/data/security(/.*)? u:object_r:security_file:s0 +/data/system/ndebugsocket u:object_r:system_ndebug_socket:s0 +/data/drm(/.*)? u:object_r:drm_data_file:s0 +#/data/gps(/.*)? u:object_r:gps_data_file:s0 +/data/resource-cache(/.*)? u:object_r:resourcecache_data_file:s0 +/data/themepack-module(/.*)? u:object_r:themepack_module_file:s0 +/data/dalvik-cache(/.*)? u:object_r:dalvikcache_data_file:s0 +/data/dalvik-cache/profiles(/.*)? u:object_r:dalvikcache_profiles_data_file:s0 +/data/anr(/.*)? u:object_r:anr_data_file:s0 +/data/app(/.*)? u:object_r:apk_data_file:s0 +/data/app/vmdl.*\.tmp(/.*)? u:object_r:apk_tmp_file:s0 +/data/app-private(/.*)? u:object_r:apk_private_data_file:s0 +/data/app-private/vmdl.*\.tmp(/.*)? u:object_r:apk_private_tmp_file:s0 +/data/tombstones(/.*)? u:object_r:tombstone_data_file:s0 +/data/local/tmp(/.*)? u:object_r:shell_data_file:s0 +/data/media(/.*)? u:object_r:media_rw_data_file:s0 +/data/mediadrm(/.*)? u:object_r:media_data_file:s0 +/data/property(/.*)? u:object_r:property_data_file:s0 + +# Misc data +/data/misc/adb(/.*)? u:object_r:adb_keys_file:s0 +/data/misc/audio(/.*)? u:object_r:audio_data_file:s0 +/data/misc/bluetooth(/.*)? u:object_r:bluetooth_data_file:s0 +/data/misc/bluedroid(/.*)? u:object_r:bluetooth_data_file:s0 +/data/misc/bluedroid/\.a2dp_ctrl u:object_r:bluetooth_socket:s0 +/data/misc/bluedroid/\.a2dp_data u:object_r:bluetooth_socket:s0 +/data/misc/camera(/.*)? u:object_r:camera_data_file:s0 +/data/misc/dhcp(/.*)? u:object_r:dhcp_data_file:s0 +/data/misc/keychain(/.*)? u:object_r:keychain_data_file:s0 +/data/misc/keystore(/.*)? u:object_r:keystore_data_file:s0 +/data/misc/media(/.*)? u:object_r:media_data_file:s0 +/data/misc/net(/.*)? u:object_r:net_data_file:s0 +/data/misc/shared_relro(/.*)? u:object_r:shared_relro_file:s0 +/data/misc/sms(/.*)? u:object_r:radio_data_file:s0 +/data/misc/systemkeys(/.*)? u:object_r:systemkeys_data_file:s0 +/data/misc/user(/.*)? u:object_r:misc_user_data_file:s0 +/data/misc/vpn(/.*)? u:object_r:vpn_data_file:s0 +/data/misc/wifi(/.*)? u:object_r:wifi_data_file:s0 +/data/misc/wifi/sockets(/.*)? u:object_r:wpa_socket:s0 +/data/misc/wifi/sockets/wpa_ctrl.* u:object_r:system_wpa_socket:s0 +/data/misc/wifi/hostapd(/.*)? u:object_r:wpa_socket:s0 +/data/misc/zoneinfo(/.*)? u:object_r:zoneinfo_data_file:s0 +/data/gps/brcm_gps_unix_socket u:object_r:bluetooth_data_file:s0 +/data/gps(/.*)? u:object_r:bluetooth_data_file:s0 + +# Wallpaper file for other users +/data/system/users/[0-9]+/wallpaper u:object_r:wallpaper_file:s0 +# Lockscreen wallpaper files +/data/system/users/[0-9]+/lockscreen_phone u:object_r:wallpaper_file:s0 +/data/system/users/[0-9]+/lockscreen_pad u:object_r:wallpaper_file:s0 +############################# +# efs files +# +/efs(/.*)? u:object_r:efs_file:s0 +############################# +# Cache files +# +/cache(/.*)? u:object_r:cache_file:s0 +/cache/.*\.data u:object_r:cache_backup_file:s0 +/cache/.*\.restore u:object_r:cache_backup_file:s0 +# LocalTransport (backup) uses this directory +/cache/backup(/.*)? u:object_r:cache_backup_file:s0 +############################# +# sysfs files +# +/sys/devices/platform/nfc-power/nfc_power -- u:object_r:sysfs_nfc_power_writable:s0 +/sys/devices/system/cpu(/.*)? u:object_r:sysfs_devices_system_cpu:s0 +/sys/power/wake_lock -- u:object_r:sysfs_wake_lock:s0 +/sys/power/wake_unlock -- u:object_r:sysfs_wake_lock:s0 +/sys/kernel/uevent_helper -- u:object_r:usermodehelper:s0 +/sys/module/lowmemorykiller(/.*)? -- u:object_r:sysfs_lowmemorykiller:s0 + +############################# +# asec containers +/mnt/asec(/.*)? u:object_r:asec_apk_file:s0 +/mnt/asec/[^/]+/[^/]+\.zip u:object_r:asec_public_file:s0 +/mnt/asec/[^/]+/lib(/.*)? u:object_r:asec_public_file:s0 +/data/app-asec(/.*)? u:object_r:asec_image_file:s0 +/mnt/secure/asec(/.*)? u:object_r:asec_image_file_ext:s0 + +############################# +# APD files +# +/apd(/.*)? u:object_r:system_file:s0 +#line 1 "vendor/asus/tools/logtool/sepolicy/file_contexts" +#logtool +/system/bin/asuslogcat u:object_r:logtoold_exec:s0 +/system/bin/fdcmts u:object_r:logtoold_exec:s0 +/system/bin/logkmsg u:object_r:logtoold_exec:s0 +/system/bin/logcontrol u:object_r:logtoold_exec:s0 +/system/bin/logcommand u:object_r:logtoold_exec:s0 +/system/bin/toolcommand u:object_r:fdctool_exec:s0 +/system/bin/toolconnect u:object_r:logtoold_exec:s0 +/dev/socket/toolconnect u:object_r:logtoold_socket:s0 +/dev/socket/fdcmdm[0-9]* u:object_r:logtoold_socket:s0 +/dev/mdmTrace u:object_r:mdmTrace_device:s0 +#line 1 "device/intel/common/sepolicy/file_contexts" +# Additional file_contexts +# ASF securityfile service +/system/bin/securityfileservice u:object_r:asf_exec:s0 +#line 1 "device/intel/clovertrail/sepolicy/file_contexts" +# Additional file_contexts +# label graphics device with a new type +/dev/dri/card0 u:object_r:gpu_device:s0 + +# sep (Symantec endpoint protection) device, since app domain doesn't have access to tee device +/dev/sep_sec_driver u:object_r:sep_device:s0 + +# GPS +# remove? +/dev/gsmtty7 u:object_r:gps_device:s0 +/system/bin/gpsd u:object_r:gpsd_exec:s0 +/system/bin/gpslogd u:object_r:gpsd_exec:s0 +/system/bin/gpscerd u:object_r:gpsd_exec:s0 + +# mmgr +#/dev/socket/mmgr u:object_r:mmgr_socket:s0 +/dev/socket/mmgr[0-9]* u:object_r:mmgr_socket:s0 +/system/bin/mmgr u:object_r:mmgr_exec:s0 +/sys/devices/pci0000:00/0000:00:05.1/power/control u:object_r:sysfs_uart_power_ctrl:s0 +/dev/mdm_ctrl(.*)? u:object_r:tty_device:s0 +/dev/ttyXMM(.*)? u:object_r:tty_device:s0 + +# nvm_server +/system/bin/nvm_server u:object_r:nvm_server_exec:s0 +/dev/socket/nvm-ctl[0-9]* u:object_r:nvm_ctl_socket:s0 + +# coreu +# /system/bin/coreu u:object_r:coreu_exec:s0 + +# sensor +/dev/akm09911 u:object_r:sensors_device:s0 +/dev/akm09911_dev u:object_r:sensors_device:s0 +/dev/cm3602 u:object_r:sensors_device:s0 +/dev/kxtj9_dev u:object_r:sensors_device:s0 +/dev/asus_gsensor u:object_r:sensors_device:s0 +/dev/lightsensor u:object_r:sensors_device:s0 +/system/bin/akmd09911 u:object_r:sensors_exec:s0 +/system/bin/a600cg_akmd09911 u:object_r:sensors_exec:s0 +/dev/i2c(.*)? u:object_r:i2c_device:s0 + +# GPU +/dev/pvr_sync u:object_r:gpu_device:s0 + +# crashlogd +/system/bin/crashlogd u:object_r:crashlogd_exec:s0 + +# wlan_prov +/system/bin/wlan_prov u:object_r:wlan_prov_exec:s0 + +# bd_prov (bluetooth) +/system/bin/bd_prov u:object_r:bd_prov_exec:s0 + +# thermal management +/sys/devices/virtual/thermal(.*)? u:object_r:sysfs_thermal_management:s0 +/dev/socket/logconfig u:object_r:thermal_socket:s0 + +# healthd +/dev/max170xx u:object_r:tty_device:s0 + +# camera +/dev/media0 u:object_r:camera_device:s0 +/dev/v4l-subdev(.*)? u:object_r:camera_device:s0 + +# fg_conf +/system/bin/fg_conf u:object_r:fg_conf_exec:s0 + +# bcu_cpufreqrel +/system/bin/bcu_cpufreqrel u:object_r:bcu_cpufreqrel_exec:s0 + +# logcat for all the init scripts +/system/bin/logcat u:object_r:logcat_exec:s0 + +# pvrsrvctl +/system/vendor/bin/pvrsrvctl u:object_r:pvrsrvctl_exec:s0 + +# dpstmgr +/system/bin/dpstmgr u:object_r:dpstmgr_exec:s0 + +# atproxy_usbreset +/system/bin/atproxy_usbreset u:object_r:atproxy_usbreset_exec:s0 + +# rild (clear, dump) +/sys/kernel/modem_nvram(.*)? u:object_r:radio_device:s0 +/dev/socket/rild[0-9]+ u:object_r:rild_socket:s0 +/dev/socket/rild-debug[0-9]+ u:object_r:rild_debug_socket:s0 + +# voice +/dev/audience_es305 u:object_r:audio_device:s0 +/dev/gsmtty(.*)? u:object_r:tty_device:s0 + +/dev/intel_sst_ctrl u:object_r:intel_sst_ctrl_device:s0 +/dev/switch_ctrl u:object_r:switch_ctrl_device:s0 + +/dev/ttyIFX[0-1] u:object_r:tty_device:s0 +/dev/ttyMFD(.*)? u:object_r:tty_device:s0 + +#rootfs +/logs(/.*)? u:object_r:log_file:s0 +/config(/.*)? u:object_r:config_file:s0 +/factory(/.*)? u:object_r:factory_file:s0 + +#gauge +/system/bin/upi_ug31xx u:object_r:gauge_exec:s0 +/dev/ug31xx u:object_r:gauge_device:s0 diff --git a/assets/file_contexts_t00f_fix b/assets/file_contexts_t00f_fix new file mode 100644 index 0000000..721d715 --- /dev/null +++ b/assets/file_contexts_t00f_fix @@ -0,0 +1,389 @@ +#line 1 "external/sepolicy/file_contexts" +########################################### +# Root +/ u:object_r:rootfs:s0 + +# Data files +/adb_keys u:object_r:adb_keys_file:s0 +/default\.prop u:object_r:rootfs:s0 +/fstab\..* u:object_r:rootfs:s0 +/init\..* u:object_r:rootfs:s0 +/res(/.*)? u:object_r:rootfs:s0 +/ueventd\..* u:object_r:rootfs:s0 + +# Executables +/charger u:object_r:rootfs:s0 +/init u:object_r:rootfs:s0 +/sbin(/.*)? u:object_r:rootfs:s0 + +# Empty directories +/lost\+found u:object_r:rootfs:s0 +/proc u:object_r:rootfs:s0 + +# SELinux policy files +/file_contexts u:object_r:rootfs:s0 +/property_contexts u:object_r:rootfs:s0 +/seapp_contexts u:object_r:rootfs:s0 +/sepolicy u:object_r:rootfs:s0 + +########################## +# Devices +# +/dev(/.*)? u:object_r:device:s0 +/dev/akm8973.* u:object_r:sensors_device:s0 +/dev/accelerometer u:object_r:sensors_device:s0 +/dev/adf[0-9]* u:object_r:graphics_device:s0 +/dev/adf-interface[0-9]*\.[0-9]* u:object_r:graphics_device:s0 +/dev/adf-overlay-engine[0-9]*\.[0-9]* u:object_r:graphics_device:s0 +/dev/alarm u:object_r:alarm_device:s0 +/dev/android_adb.* u:object_r:adb_device:s0 +/dev/android_pclink.* u:object_r:pclink_device:s0 +/dev/ashmem u:object_r:ashmem_device:s0 +/dev/audio.* u:object_r:audio_device:s0 +/dev/binder u:object_r:binder_device:s0 +/dev/block(/.*)? u:object_r:block_device:s0 +/dev/block/loop[0-9]* u:object_r:loop_device:s0 +/dev/block/ram[0-9]* u:object_r:ram_device:s0 +/dev/bus/usb(.*)? u:object_r:usb_device:s0 +/dev/cam u:object_r:camera_device:s0 +/dev/console u:object_r:console_device:s0 +/dev/cpuctl(/.*)? u:object_r:cpuctl_device:s0 +/dev/device-mapper u:object_r:dm_device:s0 +/dev/eac u:object_r:audio_device:s0 +/dev/fscklogs(/.*)? u:object_r:fscklogs:s0 +/dev/full u:object_r:full_device:s0 +/dev/fuse u:object_r:fuse_device:s0 +/dev/graphics(/.*)? u:object_r:graphics_device:s0 +/dev/hw_random u:object_r:hw_random_device:s0 +/dev/input(/.*) u:object_r:input_device:s0 +/dev/iio:device[0-9]+ u:object_r:iio_device:s0 +/dev/ion u:object_r:ion_device:s0 +/dev/kmem u:object_r:kmem_device:s0 +/dev/log(/.*)? u:object_r:log_device:s0 +/dev/mem u:object_r:kmem_device:s0 +/dev/modem.* u:object_r:radio_device:s0 +/dev/mpu u:object_r:gps_device:s0 +/dev/mpuirq u:object_r:gps_device:s0 +/dev/mtd(/.*)? u:object_r:mtd_device:s0 +/dev/mtp_usb u:object_r:mtp_device:s0 +/dev/pn544 u:object_r:nfc_device:s0 +/dev/ppp u:object_r:ppp_device:s0 +/dev/ptmx u:object_r:ptmx_device:s0 +/dev/pvrsrvkm u:object_r:gpu_device:s0 +/dev/kmsg u:object_r:kmsg_device:s0 +/dev/null u:object_r:null_device:s0 +/dev/nvhdcp1 u:object_r:video_device:s0 +/dev/random u:object_r:random_device:s0 +/dev/rpmsg-omx[0-9] u:object_r:rpmsg_device:s0 +/dev/rproc_user u:object_r:rpmsg_device:s0 +/dev/snd(/.*)? u:object_r:audio_device:s0 +/dev/socket(/.*)? u:object_r:socket_device:s0 +/dev/socket/adbd u:object_r:adbd_socket:s0 +/dev/socket/pclinkd u:object_r:pclinkd_socket:s0 +/dev/socket/dnsproxyd u:object_r:dnsproxyd_socket:s0 +/dev/socket/dumpstate u:object_r:dumpstate_socket:s0 +/dev/socket/fwmarkd u:object_r:fwmarkd_socket:s0 +/dev/socket/gps u:object_r:gps_socket:s0 +/dev/socket/installd u:object_r:installd_socket:s0 +/dev/socket/lmkd u:object_r:lmkd_socket:s0 +/dev/logd_debug u:object_r:logd_debug:s0 +/dev/socket/logd u:object_r:logd_socket:s0 +/dev/socket/logdr u:object_r:logdr_socket:s0 +/dev/socket/logdw u:object_r:logdw_socket:s0 +/dev/socket/mdns u:object_r:mdns_socket:s0 +/dev/socket/mdnsd u:object_r:mdnsd_socket:s0 +/dev/socket/mtpd u:object_r:mtpd_socket:s0 +/dev/socket/netd u:object_r:netd_socket:s0 +/dev/socket/property_service u:object_r:property_socket:s0 +/dev/socket/racoon u:object_r:racoon_socket:s0 +/dev/socket/rild u:object_r:rild_socket:s0 +/dev/socket/rild-debug u:object_r:rild_debug_socket:s0 +/dev/socket/vold u:object_r:vold_socket:s0 +/dev/socket/wpa_eth[0-9] u:object_r:wpa_socket:s0 +/dev/socket/wpa_wlan[0-9] u:object_r:wpa_socket:s0 +/dev/socket/zygote u:object_r:zygote_socket:s0 +/dev/socket/zygote_secondary u:object_r:zygote_socket:s0 +/dev/spdif_out.* u:object_r:audio_device:s0 +/dev/tegra.* u:object_r:video_device:s0 +/dev/tf_driver u:object_r:tee_device:s0 +/dev/tty u:object_r:owntty_device:s0 +/dev/tty[0-9]* u:object_r:tty_device:s0 +/dev/ttyS[0-9]* u:object_r:serial_device:s0 +/dev/tun u:object_r:tun_device:s0 +/dev/uhid u:object_r:uhid_device:s0 +/dev/uinput u:object_r:uhid_device:s0 +/dev/uio[0-9]* u:object_r:uio_device:s0 +/dev/urandom u:object_r:urandom_device:s0 +/dev/usb_accessory u:object_r:usbaccessory_device:s0 +/dev/vcs[0-9a-z]* u:object_r:vcs_device:s0 +/dev/video[0-9]* u:object_r:video_device:s0 +/dev/watchdog u:object_r:watchdog_device:s0 +/dev/xt_qtaguid u:object_r:qtaguid_device:s0 +/dev/zero u:object_r:zero_device:s0 +/dev/__kmsg__ u:object_r:klog_device:s0 +/dev/__properties__ u:object_r:properties_device:s0 +############################# +# System files +# +/system(/.*)? u:object_r:system_file:s0 +/system/bin/sh -- u:object_r:shell_exec:s0 +/system/bin/run-as -- u:object_r:runas_exec:s0 +/system/bin/bootanimation u:object_r:bootanim_exec:s0 +/system/bin/servicemanager u:object_r:servicemanager_exec:s0 +/system/bin/surfaceflinger u:object_r:surfaceflinger_exec:s0 +/system/bin/drmserver u:object_r:drmserver_exec:s0 +/system/bin/dumpstate u:object_r:dumpstate_exec:s0 +/system/bin/vold u:object_r:vold_exec:s0 +/system/bin/netd u:object_r:netd_exec:s0 +/system/bin/rild u:object_r:rild_exec:s0 +/system/bin/mediaserver u:object_r:mediaserver_exec:s0 +/system/bin/mdnsd u:object_r:mdnsd_exec:s0 +/system/bin/installd u:object_r:installd_exec:s0 +/system/bin/keystore u:object_r:keystore_exec:s0 +/system/bin/debuggerd u:object_r:debuggerd_exec:s0 +/system/bin/debuggerd64 u:object_r:debuggerd_exec:s0 +/system/bin/wpa_supplicant u:object_r:wpa_exec:s0 +/system/bin/sdcard u:object_r:sdcardd_exec:s0 +/system/bin/dhcpcd u:object_r:dhcp_exec:s0 +/system/bin/mtpd u:object_r:mtp_exec:s0 +/system/bin/pppd u:object_r:ppp_exec:s0 +/system/bin/tf_daemon u:object_r:tee_exec:s0 +/system/bin/racoon u:object_r:racoon_exec:s0 +# for root +/system/xbin/sugote u:object_r:zygote_exec:s0 +/system/bin/app_process32_original u:object_r:zygote_exec:s0 +/system/bin/app_process_init u:object_r:zygote_exec:s0 +/system/bin/app_process32_xposed u:object_r:zygote_exec:s0 +# +/system/vendor/bin/gpsd u:object_r:gpsd_exec:s0 +/system/bin/dnsmasq u:object_r:dnsmasq_exec:s0 +/system/bin/hostapd u:object_r:hostapd_exec:s0 +/system/bin/clatd u:object_r:clatd_exec:s0 +/system/bin/lmkd u:object_r:lmkd_exec:s0 +/system/bin/inputflinger u:object_r:inputflinger_exec:s0 +/system/bin/logd u:object_r:logd_exec:s0 +/system/bin/uncrypt u:object_r:uncrypt_exec:s0 +/system/bin/logwrapper u:object_r:system_file:s0 +/system/bin/vdc u:object_r:vdc_exec:s0 +/system/bin/install-recovery.sh u:object_r:install_recovery_exec:s0 +/system/bin/dex2oat u:object_r:dex2oat_exec:s0 +# patchoat executable has (essentially) the same requirements as dex2oat. +/system/bin/patchoat u:object_r:dex2oat_exec:s0 + +############################# +# Vendor files +# +/vendor(/.*)? u:object_r:system_file:s0 +/vendor/bin/gpsd u:object_r:gpsd_exec:s0 +############################# +# Data files +# +/data(/.*)? u:object_r:system_data_file:s0 +/data/.layout_version u:object_r:install_data_file:s0 +/data/backup(/.*)? u:object_r:backup_data_file:s0 +/data/secure/backup(/.*)? u:object_r:backup_data_file:s0 +/data/security(/.*)? u:object_r:security_file:s0 +/data/system/ndebugsocket u:object_r:system_ndebug_socket:s0 +/data/drm(/.*)? u:object_r:drm_data_file:s0 +#/data/gps(/.*)? u:object_r:gps_data_file:s0 +/data/resource-cache(/.*)? u:object_r:resourcecache_data_file:s0 +/data/themepack-module(/.*)? u:object_r:themepack_module_file:s0 +/data/dalvik-cache(/.*)? u:object_r:dalvikcache_data_file:s0 +/data/dalvik-cache/profiles(/.*)? u:object_r:dalvikcache_profiles_data_file:s0 +/data/anr(/.*)? u:object_r:anr_data_file:s0 +/data/app(/.*)? u:object_r:apk_data_file:s0 +/data/app/vmdl.*\.tmp(/.*)? u:object_r:apk_tmp_file:s0 +/data/app-private(/.*)? u:object_r:apk_private_data_file:s0 +/data/app-private/vmdl.*\.tmp(/.*)? u:object_r:apk_private_tmp_file:s0 +/data/tombstones(/.*)? u:object_r:tombstone_data_file:s0 +/data/local/tmp(/.*)? u:object_r:shell_data_file:s0 +/data/media(/.*)? u:object_r:media_rw_data_file:s0 +/data/mediadrm(/.*)? u:object_r:media_data_file:s0 +/data/property(/.*)? u:object_r:property_data_file:s0 + +# Misc data +/data/misc/adb(/.*)? u:object_r:adb_keys_file:s0 +/data/misc/audio(/.*)? u:object_r:audio_data_file:s0 +/data/misc/bluetooth(/.*)? u:object_r:bluetooth_data_file:s0 +/data/misc/bluedroid(/.*)? u:object_r:bluetooth_data_file:s0 +/data/misc/bluedroid/\.a2dp_ctrl u:object_r:bluetooth_socket:s0 +/data/misc/bluedroid/\.a2dp_data u:object_r:bluetooth_socket:s0 +/data/misc/camera(/.*)? u:object_r:camera_data_file:s0 +/data/misc/dhcp(/.*)? u:object_r:dhcp_data_file:s0 +/data/misc/keychain(/.*)? u:object_r:keychain_data_file:s0 +/data/misc/keystore(/.*)? u:object_r:keystore_data_file:s0 +/data/misc/media(/.*)? u:object_r:media_data_file:s0 +/data/misc/net(/.*)? u:object_r:net_data_file:s0 +/data/misc/shared_relro(/.*)? u:object_r:shared_relro_file:s0 +/data/misc/sms(/.*)? u:object_r:radio_data_file:s0 +/data/misc/systemkeys(/.*)? u:object_r:systemkeys_data_file:s0 +/data/misc/user(/.*)? u:object_r:misc_user_data_file:s0 +/data/misc/vpn(/.*)? u:object_r:vpn_data_file:s0 +/data/misc/wifi(/.*)? u:object_r:wifi_data_file:s0 +/data/misc/wifi/sockets(/.*)? u:object_r:wpa_socket:s0 +/data/misc/wifi/sockets/wpa_ctrl.* u:object_r:system_wpa_socket:s0 +/data/misc/wifi/hostapd(/.*)? u:object_r:wpa_socket:s0 +/data/misc/zoneinfo(/.*)? u:object_r:zoneinfo_data_file:s0 +/data/gps/brcm_gps_unix_socket u:object_r:bluetooth_data_file:s0 +/data/gps(/.*)? u:object_r:bluetooth_data_file:s0 + +# Wallpaper file for other users +/data/system/users/[0-9]+/wallpaper u:object_r:wallpaper_file:s0 +# Lockscreen wallpaper files +/data/system/users/[0-9]+/lockscreen_phone u:object_r:wallpaper_file:s0 +/data/system/users/[0-9]+/lockscreen_pad u:object_r:wallpaper_file:s0 +############################# +# efs files +# +/efs(/.*)? u:object_r:efs_file:s0 +############################# +# Cache files +# +/cache(/.*)? u:object_r:cache_file:s0 +/cache/.*\.data u:object_r:cache_backup_file:s0 +/cache/.*\.restore u:object_r:cache_backup_file:s0 +# LocalTransport (backup) uses this directory +/cache/backup(/.*)? u:object_r:cache_backup_file:s0 +############################# +# sysfs files +# +/sys/devices/platform/nfc-power/nfc_power -- u:object_r:sysfs_nfc_power_writable:s0 +/sys/devices/system/cpu(/.*)? u:object_r:sysfs_devices_system_cpu:s0 +/sys/power/wake_lock -- u:object_r:sysfs_wake_lock:s0 +/sys/power/wake_unlock -- u:object_r:sysfs_wake_lock:s0 +/sys/kernel/uevent_helper -- u:object_r:usermodehelper:s0 +/sys/module/lowmemorykiller(/.*)? -- u:object_r:sysfs_lowmemorykiller:s0 + +############################# +# asec containers +/mnt/asec(/.*)? u:object_r:asec_apk_file:s0 +/mnt/asec/[^/]+/[^/]+\.zip u:object_r:asec_public_file:s0 +/mnt/asec/[^/]+/lib(/.*)? u:object_r:asec_public_file:s0 +/data/app-asec(/.*)? u:object_r:asec_image_file:s0 +/mnt/secure/asec(/.*)? u:object_r:asec_image_file_ext:s0 + +############################# +# APD files +# +/apd(/.*)? u:object_r:system_file:s0 +#line 1 "vendor/asus/tools/logtool/sepolicy/file_contexts" +#logtool +/system/bin/asuslogcat u:object_r:logtoold_exec:s0 +/system/bin/fdcmts u:object_r:logtoold_exec:s0 +/system/bin/logkmsg u:object_r:logtoold_exec:s0 +/system/bin/logcontrol u:object_r:logtoold_exec:s0 +/system/bin/logcommand u:object_r:logtoold_exec:s0 +/system/bin/toolcommand u:object_r:fdctool_exec:s0 +/system/bin/toolconnect u:object_r:logtoold_exec:s0 +/dev/socket/toolconnect u:object_r:logtoold_socket:s0 +/dev/socket/fdcmdm[0-9]* u:object_r:logtoold_socket:s0 +/dev/mdmTrace u:object_r:mdmTrace_device:s0 +#line 1 "device/intel/common/sepolicy/file_contexts" +# Additional file_contexts +# ASF securityfile service +/system/bin/securityfileservice u:object_r:asf_exec:s0 +#line 1 "device/intel/clovertrail/sepolicy/file_contexts" +# Additional file_contexts +# label graphics device with a new type +/dev/dri/card0 u:object_r:gpu_device:s0 + +# sep (Symantec endpoint protection) device, since app domain doesn't have access to tee device +/dev/sep_sec_driver u:object_r:sep_device:s0 + +# GPS +# remove? +/dev/gsmtty7 u:object_r:gps_device:s0 +/system/bin/gpsd u:object_r:gpsd_exec:s0 +/system/bin/gpslogd u:object_r:gpsd_exec:s0 +/system/bin/gpscerd u:object_r:gpsd_exec:s0 + +# mmgr +#/dev/socket/mmgr u:object_r:mmgr_socket:s0 +/dev/socket/mmgr[0-9]* u:object_r:mmgr_socket:s0 +/system/bin/mmgr u:object_r:mmgr_exec:s0 +/sys/devices/pci0000:00/0000:00:05.1/power/control u:object_r:sysfs_uart_power_ctrl:s0 +/dev/mdm_ctrl(.*)? u:object_r:tty_device:s0 +/dev/ttyXMM(.*)? u:object_r:tty_device:s0 + +# nvm_server +/system/bin/nvm_server u:object_r:nvm_server_exec:s0 +/dev/socket/nvm-ctl[0-9]* u:object_r:nvm_ctl_socket:s0 + +# coreu +# /system/bin/coreu u:object_r:coreu_exec:s0 + +# sensor +/dev/akm09911 u:object_r:sensors_device:s0 +/dev/akm09911_dev u:object_r:sensors_device:s0 +/dev/cm3602 u:object_r:sensors_device:s0 +/dev/kxtj9_dev u:object_r:sensors_device:s0 +/dev/asus_gsensor u:object_r:sensors_device:s0 +/dev/lightsensor u:object_r:sensors_device:s0 +/system/bin/akmd09911 u:object_r:sensors_exec:s0 +/system/bin/a600cg_akmd09911 u:object_r:sensors_exec:s0 +/dev/i2c(.*)? u:object_r:i2c_device:s0 + +# GPU +/dev/pvr_sync u:object_r:gpu_device:s0 + +# crashlogd +/system/bin/crashlogd u:object_r:crashlogd_exec:s0 + +# wlan_prov +/system/bin/wlan_prov u:object_r:wlan_prov_exec:s0 + +# bd_prov (bluetooth) +/system/bin/bd_prov u:object_r:bd_prov_exec:s0 + +# thermal management +/sys/devices/virtual/thermal(.*)? u:object_r:sysfs_thermal_management:s0 +/dev/socket/logconfig u:object_r:thermal_socket:s0 + +# healthd +/dev/max170xx u:object_r:tty_device:s0 + +# camera +/dev/media0 u:object_r:camera_device:s0 +/dev/v4l-subdev(.*)? u:object_r:camera_device:s0 + +# fg_conf +/system/bin/fg_conf u:object_r:fg_conf_exec:s0 + +# bcu_cpufreqrel +/system/bin/bcu_cpufreqrel u:object_r:bcu_cpufreqrel_exec:s0 + +# logcat for all the init scripts +/system/bin/logcat u:object_r:logcat_exec:s0 + +# pvrsrvctl +/system/vendor/bin/pvrsrvctl u:object_r:pvrsrvctl_exec:s0 + +# dpstmgr +/system/bin/dpstmgr u:object_r:dpstmgr_exec:s0 + +# atproxy_usbreset +/system/bin/atproxy_usbreset u:object_r:atproxy_usbreset_exec:s0 + +# rild (clear, dump) +/sys/kernel/modem_nvram(.*)? u:object_r:radio_device:s0 +/dev/socket/rild[0-9]+ u:object_r:rild_socket:s0 +/dev/socket/rild-debug[0-9]+ u:object_r:rild_debug_socket:s0 + +# voice +/dev/audience_es305 u:object_r:audio_device:s0 +/dev/gsmtty(.*)? u:object_r:tty_device:s0 + +/dev/intel_sst_ctrl u:object_r:intel_sst_ctrl_device:s0 +/dev/switch_ctrl u:object_r:switch_ctrl_device:s0 + +/dev/ttyIFX[0-1] u:object_r:tty_device:s0 +/dev/ttyMFD(.*)? u:object_r:tty_device:s0 + +#rootfs +/logs(/.*)? u:object_r:log_file:s0 +/config(/.*)? u:object_r:config_file:s0 +/factory(/.*)? u:object_r:factory_file:s0 + +#gauge +/system/bin/upi_ug31xx u:object_r:gauge_exec:s0 +/dev/ug31xx u:object_r:gauge_device:s0 diff --git a/assets/file_contexts_t00g b/assets/file_contexts_t00g new file mode 100644 index 0000000..fb9428d --- /dev/null +++ b/assets/file_contexts_t00g @@ -0,0 +1,391 @@ +#line 1 "external/sepolicy/file_contexts" +########################################### +# Root +/ u:object_r:rootfs:s0 + +# Data files +/adb_keys u:object_r:adb_keys_file:s0 +/default\.prop u:object_r:rootfs:s0 +/fstab\..* u:object_r:rootfs:s0 +/init\..* u:object_r:rootfs:s0 +/res(/.*)? u:object_r:rootfs:s0 +/ueventd\..* u:object_r:rootfs:s0 + +# Executables +/charger u:object_r:rootfs:s0 +/init u:object_r:rootfs:s0 +/sbin(/.*)? u:object_r:rootfs:s0 + +# Empty directories +/lost\+found u:object_r:rootfs:s0 +/proc u:object_r:rootfs:s0 + +# SELinux policy files +/file_contexts u:object_r:rootfs:s0 +/property_contexts u:object_r:rootfs:s0 +/seapp_contexts u:object_r:rootfs:s0 +/sepolicy u:object_r:rootfs:s0 + +########################## +# Devices +# +/dev(/.*)? u:object_r:device:s0 +/dev/akm8973.* u:object_r:sensors_device:s0 +/dev/accelerometer u:object_r:sensors_device:s0 +/dev/adf[0-9]* u:object_r:graphics_device:s0 +/dev/adf-interface[0-9]*\.[0-9]* u:object_r:graphics_device:s0 +/dev/adf-overlay-engine[0-9]*\.[0-9]* u:object_r:graphics_device:s0 +/dev/alarm u:object_r:alarm_device:s0 +/dev/android_adb.* u:object_r:adb_device:s0 +/dev/android_pclink.* u:object_r:pclink_device:s0 +/dev/ashmem u:object_r:ashmem_device:s0 +/dev/audio.* u:object_r:audio_device:s0 +/dev/binder u:object_r:binder_device:s0 +/dev/block(/.*)? u:object_r:block_device:s0 +/dev/block/loop[0-9]* u:object_r:loop_device:s0 +/dev/block/ram[0-9]* u:object_r:ram_device:s0 +/dev/bus/usb(.*)? u:object_r:usb_device:s0 +/dev/cam u:object_r:camera_device:s0 +/dev/console u:object_r:console_device:s0 +/dev/cpuctl(/.*)? u:object_r:cpuctl_device:s0 +/dev/device-mapper u:object_r:dm_device:s0 +/dev/eac u:object_r:audio_device:s0 +/dev/fscklogs(/.*)? u:object_r:fscklogs:s0 +/dev/full u:object_r:full_device:s0 +/dev/fuse u:object_r:fuse_device:s0 +/dev/graphics(/.*)? u:object_r:graphics_device:s0 +/dev/hw_random u:object_r:hw_random_device:s0 +/dev/input(/.*) u:object_r:input_device:s0 +/dev/iio:device[0-9]+ u:object_r:iio_device:s0 +/dev/ion u:object_r:ion_device:s0 +/dev/kmem u:object_r:kmem_device:s0 +/dev/log(/.*)? u:object_r:log_device:s0 +/dev/mem u:object_r:kmem_device:s0 +/dev/modem.* u:object_r:radio_device:s0 +/dev/mpu u:object_r:gps_device:s0 +/dev/mpuirq u:object_r:gps_device:s0 +/dev/mtd(/.*)? u:object_r:mtd_device:s0 +/dev/mtp_usb u:object_r:mtp_device:s0 +/dev/pn544 u:object_r:nfc_device:s0 +/dev/ppp u:object_r:ppp_device:s0 +/dev/ptmx u:object_r:ptmx_device:s0 +/dev/pvrsrvkm u:object_r:gpu_device:s0 +/dev/kmsg u:object_r:kmsg_device:s0 +/dev/null u:object_r:null_device:s0 +/dev/nvhdcp1 u:object_r:video_device:s0 +/dev/random u:object_r:random_device:s0 +/dev/rpmsg-omx[0-9] u:object_r:rpmsg_device:s0 +/dev/rproc_user u:object_r:rpmsg_device:s0 +/dev/snd(/.*)? u:object_r:audio_device:s0 +/dev/socket(/.*)? u:object_r:socket_device:s0 +/dev/socket/adbd u:object_r:adbd_socket:s0 +/dev/socket/pclinkd u:object_r:pclinkd_socket:s0 +/dev/socket/dnsproxyd u:object_r:dnsproxyd_socket:s0 +/dev/socket/dumpstate u:object_r:dumpstate_socket:s0 +/dev/socket/fwmarkd u:object_r:fwmarkd_socket:s0 +/dev/socket/gps u:object_r:gps_socket:s0 +/dev/socket/installd u:object_r:installd_socket:s0 +/dev/socket/lmkd u:object_r:lmkd_socket:s0 +/dev/logd_debug u:object_r:logd_debug:s0 +/dev/socket/logd u:object_r:logd_socket:s0 +/dev/socket/logdr u:object_r:logdr_socket:s0 +/dev/socket/logdw u:object_r:logdw_socket:s0 +/dev/socket/mdns u:object_r:mdns_socket:s0 +/dev/socket/mdnsd u:object_r:mdnsd_socket:s0 +/dev/socket/mtpd u:object_r:mtpd_socket:s0 +/dev/socket/netd u:object_r:netd_socket:s0 +/dev/socket/property_service u:object_r:property_socket:s0 +/dev/socket/racoon u:object_r:racoon_socket:s0 +/dev/socket/rild u:object_r:rild_socket:s0 +/dev/socket/rild-debug u:object_r:rild_debug_socket:s0 +/dev/socket/vold u:object_r:vold_socket:s0 +/dev/socket/wpa_eth[0-9] u:object_r:wpa_socket:s0 +/dev/socket/wpa_wlan[0-9] u:object_r:wpa_socket:s0 +/dev/socket/zygote u:object_r:zygote_socket:s0 +/dev/socket/zygote_secondary u:object_r:zygote_socket:s0 +/dev/spdif_out.* u:object_r:audio_device:s0 +/dev/tegra.* u:object_r:video_device:s0 +/dev/tf_driver u:object_r:tee_device:s0 +/dev/tty u:object_r:owntty_device:s0 +/dev/tty[0-9]* u:object_r:tty_device:s0 +/dev/ttyS[0-9]* u:object_r:serial_device:s0 +/dev/tun u:object_r:tun_device:s0 +/dev/uhid u:object_r:uhid_device:s0 +/dev/uinput u:object_r:uhid_device:s0 +/dev/uio[0-9]* u:object_r:uio_device:s0 +/dev/urandom u:object_r:urandom_device:s0 +/dev/usb_accessory u:object_r:usbaccessory_device:s0 +/dev/vcs[0-9a-z]* u:object_r:vcs_device:s0 +/dev/video[0-9]* u:object_r:video_device:s0 +/dev/watchdog u:object_r:watchdog_device:s0 +/dev/xt_qtaguid u:object_r:qtaguid_device:s0 +/dev/zero u:object_r:zero_device:s0 +/dev/__kmsg__ u:object_r:klog_device:s0 +/dev/__properties__ u:object_r:properties_device:s0 +############################# +# System files +# +/system(/.*)? u:object_r:system_file:s0 +/system/bin/sh -- u:object_r:shell_exec:s0 +/system/bin/run-as -- u:object_r:runas_exec:s0 +/system/bin/bootanimation u:object_r:bootanim_exec:s0 +/system/bin/app_process32 u:object_r:zygote_exec:s0 +/system/bin/app_process64 u:object_r:zygote_exec:s0 +/system/bin/servicemanager u:object_r:servicemanager_exec:s0 +/system/bin/surfaceflinger u:object_r:surfaceflinger_exec:s0 +/system/bin/drmserver u:object_r:drmserver_exec:s0 +/system/bin/dumpstate u:object_r:dumpstate_exec:s0 +/system/bin/vold u:object_r:vold_exec:s0 +/system/bin/netd u:object_r:netd_exec:s0 +/system/bin/rild u:object_r:rild_exec:s0 +/system/bin/mediaserver u:object_r:mediaserver_exec:s0 +/system/bin/mdnsd u:object_r:mdnsd_exec:s0 +/system/bin/installd u:object_r:installd_exec:s0 +/system/bin/keystore u:object_r:keystore_exec:s0 +/system/bin/debuggerd u:object_r:debuggerd_exec:s0 +/system/bin/debuggerd64 u:object_r:debuggerd_exec:s0 +/system/bin/wpa_supplicant u:object_r:wpa_exec:s0 +/system/bin/sdcard u:object_r:sdcardd_exec:s0 +/system/bin/dhcpcd u:object_r:dhcp_exec:s0 +/system/bin/mtpd u:object_r:mtp_exec:s0 +/system/bin/pppd u:object_r:ppp_exec:s0 +/system/bin/tf_daemon u:object_r:tee_exec:s0 +/system/bin/racoon u:object_r:racoon_exec:s0 +# for root +/system/xbin/sugote u:object_r:zygote_exec:s0 +/system/bin/app_process32_original u:object_r:zygote_exec:s0 +/system/bin/app_process_init u:object_r:zygote_exec:s0 +/system/bin/app_process32_xposed u:object_r:zygote_exec:s0 +# +/system/vendor/bin/gpsd u:object_r:gpsd_exec:s0 +/system/bin/dnsmasq u:object_r:dnsmasq_exec:s0 +/system/bin/hostapd u:object_r:hostapd_exec:s0 +/system/bin/clatd u:object_r:clatd_exec:s0 +/system/bin/lmkd u:object_r:lmkd_exec:s0 +/system/bin/inputflinger u:object_r:inputflinger_exec:s0 +/system/bin/logd u:object_r:logd_exec:s0 +/system/bin/uncrypt u:object_r:uncrypt_exec:s0 +/system/bin/logwrapper u:object_r:system_file:s0 +/system/bin/vdc u:object_r:vdc_exec:s0 +/system/bin/install-recovery.sh u:object_r:install_recovery_exec:s0 +/system/bin/dex2oat u:object_r:dex2oat_exec:s0 +# patchoat executable has (essentially) the same requirements as dex2oat. +/system/bin/patchoat u:object_r:dex2oat_exec:s0 + +############################# +# Vendor files +# +/vendor(/.*)? u:object_r:system_file:s0 +/vendor/bin/gpsd u:object_r:gpsd_exec:s0 +############################# +# Data files +# +/data(/.*)? u:object_r:system_data_file:s0 +/data/.layout_version u:object_r:install_data_file:s0 +/data/backup(/.*)? u:object_r:backup_data_file:s0 +/data/secure/backup(/.*)? u:object_r:backup_data_file:s0 +/data/security(/.*)? u:object_r:security_file:s0 +/data/system/ndebugsocket u:object_r:system_ndebug_socket:s0 +/data/drm(/.*)? u:object_r:drm_data_file:s0 +#/data/gps(/.*)? u:object_r:gps_data_file:s0 +/data/resource-cache(/.*)? u:object_r:resourcecache_data_file:s0 +/data/themepack-module(/.*)? u:object_r:themepack_module_file:s0 +/data/dalvik-cache(/.*)? u:object_r:dalvikcache_data_file:s0 +/data/dalvik-cache/profiles(/.*)? u:object_r:dalvikcache_profiles_data_file:s0 +/data/anr(/.*)? u:object_r:anr_data_file:s0 +/data/app(/.*)? u:object_r:apk_data_file:s0 +/data/app/vmdl.*\.tmp(/.*)? u:object_r:apk_tmp_file:s0 +/data/app-private(/.*)? u:object_r:apk_private_data_file:s0 +/data/app-private/vmdl.*\.tmp(/.*)? u:object_r:apk_private_tmp_file:s0 +/data/tombstones(/.*)? u:object_r:tombstone_data_file:s0 +/data/local/tmp(/.*)? u:object_r:shell_data_file:s0 +/data/media(/.*)? u:object_r:media_rw_data_file:s0 +/data/mediadrm(/.*)? u:object_r:media_data_file:s0 +/data/property(/.*)? u:object_r:property_data_file:s0 + +# Misc data +/data/misc/adb(/.*)? u:object_r:adb_keys_file:s0 +/data/misc/audio(/.*)? u:object_r:audio_data_file:s0 +/data/misc/bluetooth(/.*)? u:object_r:bluetooth_data_file:s0 +/data/misc/bluedroid(/.*)? u:object_r:bluetooth_data_file:s0 +/data/misc/bluedroid/\.a2dp_ctrl u:object_r:bluetooth_socket:s0 +/data/misc/bluedroid/\.a2dp_data u:object_r:bluetooth_socket:s0 +/data/misc/camera(/.*)? u:object_r:camera_data_file:s0 +/data/misc/dhcp(/.*)? u:object_r:dhcp_data_file:s0 +/data/misc/keychain(/.*)? u:object_r:keychain_data_file:s0 +/data/misc/keystore(/.*)? u:object_r:keystore_data_file:s0 +/data/misc/media(/.*)? u:object_r:media_data_file:s0 +/data/misc/net(/.*)? u:object_r:net_data_file:s0 +/data/misc/shared_relro(/.*)? u:object_r:shared_relro_file:s0 +/data/misc/sms(/.*)? u:object_r:radio_data_file:s0 +/data/misc/systemkeys(/.*)? u:object_r:systemkeys_data_file:s0 +/data/misc/user(/.*)? u:object_r:misc_user_data_file:s0 +/data/misc/vpn(/.*)? u:object_r:vpn_data_file:s0 +/data/misc/wifi(/.*)? u:object_r:wifi_data_file:s0 +/data/misc/wifi/sockets(/.*)? u:object_r:wpa_socket:s0 +/data/misc/wifi/sockets/wpa_ctrl.* u:object_r:system_wpa_socket:s0 +/data/misc/wifi/hostapd(/.*)? u:object_r:wpa_socket:s0 +/data/misc/zoneinfo(/.*)? u:object_r:zoneinfo_data_file:s0 +/data/gps/brcm_gps_unix_socket u:object_r:bluetooth_data_file:s0 +/data/gps(/.*)? u:object_r:bluetooth_data_file:s0 + +# Wallpaper file for other users +/data/system/users/[0-9]+/wallpaper u:object_r:wallpaper_file:s0 +# Lockscreen wallpaper files +/data/system/users/[0-9]+/lockscreen_phone u:object_r:wallpaper_file:s0 +/data/system/users/[0-9]+/lockscreen_pad u:object_r:wallpaper_file:s0 +############################# +# efs files +# +/efs(/.*)? u:object_r:efs_file:s0 +############################# +# Cache files +# +/cache(/.*)? u:object_r:cache_file:s0 +/cache/.*\.data u:object_r:cache_backup_file:s0 +/cache/.*\.restore u:object_r:cache_backup_file:s0 +# LocalTransport (backup) uses this directory +/cache/backup(/.*)? u:object_r:cache_backup_file:s0 +############################# +# sysfs files +# +/sys/devices/platform/nfc-power/nfc_power -- u:object_r:sysfs_nfc_power_writable:s0 +/sys/devices/system/cpu(/.*)? u:object_r:sysfs_devices_system_cpu:s0 +/sys/power/wake_lock -- u:object_r:sysfs_wake_lock:s0 +/sys/power/wake_unlock -- u:object_r:sysfs_wake_lock:s0 +/sys/kernel/uevent_helper -- u:object_r:usermodehelper:s0 +/sys/module/lowmemorykiller(/.*)? -- u:object_r:sysfs_lowmemorykiller:s0 + +############################# +# asec containers +/mnt/asec(/.*)? u:object_r:asec_apk_file:s0 +/mnt/asec/[^/]+/[^/]+\.zip u:object_r:asec_public_file:s0 +/mnt/asec/[^/]+/lib(/.*)? u:object_r:asec_public_file:s0 +/data/app-asec(/.*)? u:object_r:asec_image_file:s0 +/mnt/secure/asec(/.*)? u:object_r:asec_image_file_ext:s0 + +############################# +# APD files +# +/apd(/.*)? u:object_r:system_file:s0 +#line 1 "vendor/asus/tools/logtool/sepolicy/file_contexts" +#logtool +/system/bin/asuslogcat u:object_r:logtoold_exec:s0 +/system/bin/fdcmts u:object_r:logtoold_exec:s0 +/system/bin/logkmsg u:object_r:logtoold_exec:s0 +/system/bin/logcontrol u:object_r:logtoold_exec:s0 +/system/bin/logcommand u:object_r:logtoold_exec:s0 +/system/bin/toolcommand u:object_r:fdctool_exec:s0 +/system/bin/toolconnect u:object_r:logtoold_exec:s0 +/dev/socket/toolconnect u:object_r:logtoold_socket:s0 +/dev/socket/fdcmdm[0-9]* u:object_r:logtoold_socket:s0 +/dev/mdmTrace u:object_r:mdmTrace_device:s0 +#line 1 "device/intel/common/sepolicy/file_contexts" +# Additional file_contexts +# ASF securityfile service +/system/bin/securityfileservice u:object_r:asf_exec:s0 +#line 1 "device/intel/clovertrail/sepolicy/file_contexts" +# Additional file_contexts +# label graphics device with a new type +/dev/dri/card0 u:object_r:gpu_device:s0 + +# sep (Symantec endpoint protection) device, since app domain doesn't have access to tee device +/dev/sep_sec_driver u:object_r:sep_device:s0 + +# GPS +# remove? +/dev/gsmtty7 u:object_r:gps_device:s0 +/system/bin/gpsd u:object_r:gpsd_exec:s0 +/system/bin/gpslogd u:object_r:gpsd_exec:s0 +/system/bin/gpscerd u:object_r:gpsd_exec:s0 + +# mmgr +#/dev/socket/mmgr u:object_r:mmgr_socket:s0 +/dev/socket/mmgr[0-9]* u:object_r:mmgr_socket:s0 +/system/bin/mmgr u:object_r:mmgr_exec:s0 +/sys/devices/pci0000:00/0000:00:05.1/power/control u:object_r:sysfs_uart_power_ctrl:s0 +/dev/mdm_ctrl(.*)? u:object_r:tty_device:s0 +/dev/ttyXMM(.*)? u:object_r:tty_device:s0 + +# nvm_server +/system/bin/nvm_server u:object_r:nvm_server_exec:s0 +/dev/socket/nvm-ctl[0-9]* u:object_r:nvm_ctl_socket:s0 + +# coreu +# /system/bin/coreu u:object_r:coreu_exec:s0 + +# sensor +/dev/akm09911 u:object_r:sensors_device:s0 +/dev/akm09911_dev u:object_r:sensors_device:s0 +/dev/cm3602 u:object_r:sensors_device:s0 +/dev/kxtj9_dev u:object_r:sensors_device:s0 +/dev/asus_gsensor u:object_r:sensors_device:s0 +/dev/lightsensor u:object_r:sensors_device:s0 +/system/bin/akmd09911 u:object_r:sensors_exec:s0 +/system/bin/a600cg_akmd09911 u:object_r:sensors_exec:s0 +/dev/i2c(.*)? u:object_r:i2c_device:s0 + +# GPU +/dev/pvr_sync u:object_r:gpu_device:s0 + +# crashlogd +/system/bin/crashlogd u:object_r:crashlogd_exec:s0 + +# wlan_prov +/system/bin/wlan_prov u:object_r:wlan_prov_exec:s0 + +# bd_prov (bluetooth) +/system/bin/bd_prov u:object_r:bd_prov_exec:s0 + +# thermal management +/sys/devices/virtual/thermal(.*)? u:object_r:sysfs_thermal_management:s0 +/dev/socket/logconfig u:object_r:thermal_socket:s0 + +# healthd +/dev/max170xx u:object_r:tty_device:s0 + +# camera +/dev/media0 u:object_r:camera_device:s0 +/dev/v4l-subdev(.*)? u:object_r:camera_device:s0 + +# fg_conf +/system/bin/fg_conf u:object_r:fg_conf_exec:s0 + +# bcu_cpufreqrel +/system/bin/bcu_cpufreqrel u:object_r:bcu_cpufreqrel_exec:s0 + +# logcat for all the init scripts +/system/bin/logcat u:object_r:logcat_exec:s0 + +# pvrsrvctl +/system/vendor/bin/pvrsrvctl u:object_r:pvrsrvctl_exec:s0 + +# dpstmgr +/system/bin/dpstmgr u:object_r:dpstmgr_exec:s0 + +# atproxy_usbreset +/system/bin/atproxy_usbreset u:object_r:atproxy_usbreset_exec:s0 + +# rild (clear, dump) +/sys/kernel/modem_nvram(.*)? u:object_r:radio_device:s0 +/dev/socket/rild[0-9]+ u:object_r:rild_socket:s0 +/dev/socket/rild-debug[0-9]+ u:object_r:rild_debug_socket:s0 + +# voice +/dev/audience_es305 u:object_r:audio_device:s0 +/dev/gsmtty(.*)? u:object_r:tty_device:s0 + +/dev/intel_sst_ctrl u:object_r:intel_sst_ctrl_device:s0 +/dev/switch_ctrl u:object_r:switch_ctrl_device:s0 + +/dev/ttyIFX[0-1] u:object_r:tty_device:s0 +/dev/ttyMFD(.*)? u:object_r:tty_device:s0 + +#rootfs +/logs(/.*)? u:object_r:log_file:s0 +/config(/.*)? u:object_r:config_file:s0 +/factory(/.*)? u:object_r:factory_file:s0 + +#gauge +/system/bin/upi_ug31xx u:object_r:gauge_exec:s0 +/dev/ug31xx u:object_r:gauge_device:s0 diff --git a/assets/file_contexts_t00g_fix b/assets/file_contexts_t00g_fix new file mode 100644 index 0000000..721d715 --- /dev/null +++ b/assets/file_contexts_t00g_fix @@ -0,0 +1,389 @@ +#line 1 "external/sepolicy/file_contexts" +########################################### +# Root +/ u:object_r:rootfs:s0 + +# Data files +/adb_keys u:object_r:adb_keys_file:s0 +/default\.prop u:object_r:rootfs:s0 +/fstab\..* u:object_r:rootfs:s0 +/init\..* u:object_r:rootfs:s0 +/res(/.*)? u:object_r:rootfs:s0 +/ueventd\..* u:object_r:rootfs:s0 + +# Executables +/charger u:object_r:rootfs:s0 +/init u:object_r:rootfs:s0 +/sbin(/.*)? u:object_r:rootfs:s0 + +# Empty directories +/lost\+found u:object_r:rootfs:s0 +/proc u:object_r:rootfs:s0 + +# SELinux policy files +/file_contexts u:object_r:rootfs:s0 +/property_contexts u:object_r:rootfs:s0 +/seapp_contexts u:object_r:rootfs:s0 +/sepolicy u:object_r:rootfs:s0 + +########################## +# Devices +# +/dev(/.*)? u:object_r:device:s0 +/dev/akm8973.* u:object_r:sensors_device:s0 +/dev/accelerometer u:object_r:sensors_device:s0 +/dev/adf[0-9]* u:object_r:graphics_device:s0 +/dev/adf-interface[0-9]*\.[0-9]* u:object_r:graphics_device:s0 +/dev/adf-overlay-engine[0-9]*\.[0-9]* u:object_r:graphics_device:s0 +/dev/alarm u:object_r:alarm_device:s0 +/dev/android_adb.* u:object_r:adb_device:s0 +/dev/android_pclink.* u:object_r:pclink_device:s0 +/dev/ashmem u:object_r:ashmem_device:s0 +/dev/audio.* u:object_r:audio_device:s0 +/dev/binder u:object_r:binder_device:s0 +/dev/block(/.*)? u:object_r:block_device:s0 +/dev/block/loop[0-9]* u:object_r:loop_device:s0 +/dev/block/ram[0-9]* u:object_r:ram_device:s0 +/dev/bus/usb(.*)? u:object_r:usb_device:s0 +/dev/cam u:object_r:camera_device:s0 +/dev/console u:object_r:console_device:s0 +/dev/cpuctl(/.*)? u:object_r:cpuctl_device:s0 +/dev/device-mapper u:object_r:dm_device:s0 +/dev/eac u:object_r:audio_device:s0 +/dev/fscklogs(/.*)? u:object_r:fscklogs:s0 +/dev/full u:object_r:full_device:s0 +/dev/fuse u:object_r:fuse_device:s0 +/dev/graphics(/.*)? u:object_r:graphics_device:s0 +/dev/hw_random u:object_r:hw_random_device:s0 +/dev/input(/.*) u:object_r:input_device:s0 +/dev/iio:device[0-9]+ u:object_r:iio_device:s0 +/dev/ion u:object_r:ion_device:s0 +/dev/kmem u:object_r:kmem_device:s0 +/dev/log(/.*)? u:object_r:log_device:s0 +/dev/mem u:object_r:kmem_device:s0 +/dev/modem.* u:object_r:radio_device:s0 +/dev/mpu u:object_r:gps_device:s0 +/dev/mpuirq u:object_r:gps_device:s0 +/dev/mtd(/.*)? u:object_r:mtd_device:s0 +/dev/mtp_usb u:object_r:mtp_device:s0 +/dev/pn544 u:object_r:nfc_device:s0 +/dev/ppp u:object_r:ppp_device:s0 +/dev/ptmx u:object_r:ptmx_device:s0 +/dev/pvrsrvkm u:object_r:gpu_device:s0 +/dev/kmsg u:object_r:kmsg_device:s0 +/dev/null u:object_r:null_device:s0 +/dev/nvhdcp1 u:object_r:video_device:s0 +/dev/random u:object_r:random_device:s0 +/dev/rpmsg-omx[0-9] u:object_r:rpmsg_device:s0 +/dev/rproc_user u:object_r:rpmsg_device:s0 +/dev/snd(/.*)? u:object_r:audio_device:s0 +/dev/socket(/.*)? u:object_r:socket_device:s0 +/dev/socket/adbd u:object_r:adbd_socket:s0 +/dev/socket/pclinkd u:object_r:pclinkd_socket:s0 +/dev/socket/dnsproxyd u:object_r:dnsproxyd_socket:s0 +/dev/socket/dumpstate u:object_r:dumpstate_socket:s0 +/dev/socket/fwmarkd u:object_r:fwmarkd_socket:s0 +/dev/socket/gps u:object_r:gps_socket:s0 +/dev/socket/installd u:object_r:installd_socket:s0 +/dev/socket/lmkd u:object_r:lmkd_socket:s0 +/dev/logd_debug u:object_r:logd_debug:s0 +/dev/socket/logd u:object_r:logd_socket:s0 +/dev/socket/logdr u:object_r:logdr_socket:s0 +/dev/socket/logdw u:object_r:logdw_socket:s0 +/dev/socket/mdns u:object_r:mdns_socket:s0 +/dev/socket/mdnsd u:object_r:mdnsd_socket:s0 +/dev/socket/mtpd u:object_r:mtpd_socket:s0 +/dev/socket/netd u:object_r:netd_socket:s0 +/dev/socket/property_service u:object_r:property_socket:s0 +/dev/socket/racoon u:object_r:racoon_socket:s0 +/dev/socket/rild u:object_r:rild_socket:s0 +/dev/socket/rild-debug u:object_r:rild_debug_socket:s0 +/dev/socket/vold u:object_r:vold_socket:s0 +/dev/socket/wpa_eth[0-9] u:object_r:wpa_socket:s0 +/dev/socket/wpa_wlan[0-9] u:object_r:wpa_socket:s0 +/dev/socket/zygote u:object_r:zygote_socket:s0 +/dev/socket/zygote_secondary u:object_r:zygote_socket:s0 +/dev/spdif_out.* u:object_r:audio_device:s0 +/dev/tegra.* u:object_r:video_device:s0 +/dev/tf_driver u:object_r:tee_device:s0 +/dev/tty u:object_r:owntty_device:s0 +/dev/tty[0-9]* u:object_r:tty_device:s0 +/dev/ttyS[0-9]* u:object_r:serial_device:s0 +/dev/tun u:object_r:tun_device:s0 +/dev/uhid u:object_r:uhid_device:s0 +/dev/uinput u:object_r:uhid_device:s0 +/dev/uio[0-9]* u:object_r:uio_device:s0 +/dev/urandom u:object_r:urandom_device:s0 +/dev/usb_accessory u:object_r:usbaccessory_device:s0 +/dev/vcs[0-9a-z]* u:object_r:vcs_device:s0 +/dev/video[0-9]* u:object_r:video_device:s0 +/dev/watchdog u:object_r:watchdog_device:s0 +/dev/xt_qtaguid u:object_r:qtaguid_device:s0 +/dev/zero u:object_r:zero_device:s0 +/dev/__kmsg__ u:object_r:klog_device:s0 +/dev/__properties__ u:object_r:properties_device:s0 +############################# +# System files +# +/system(/.*)? u:object_r:system_file:s0 +/system/bin/sh -- u:object_r:shell_exec:s0 +/system/bin/run-as -- u:object_r:runas_exec:s0 +/system/bin/bootanimation u:object_r:bootanim_exec:s0 +/system/bin/servicemanager u:object_r:servicemanager_exec:s0 +/system/bin/surfaceflinger u:object_r:surfaceflinger_exec:s0 +/system/bin/drmserver u:object_r:drmserver_exec:s0 +/system/bin/dumpstate u:object_r:dumpstate_exec:s0 +/system/bin/vold u:object_r:vold_exec:s0 +/system/bin/netd u:object_r:netd_exec:s0 +/system/bin/rild u:object_r:rild_exec:s0 +/system/bin/mediaserver u:object_r:mediaserver_exec:s0 +/system/bin/mdnsd u:object_r:mdnsd_exec:s0 +/system/bin/installd u:object_r:installd_exec:s0 +/system/bin/keystore u:object_r:keystore_exec:s0 +/system/bin/debuggerd u:object_r:debuggerd_exec:s0 +/system/bin/debuggerd64 u:object_r:debuggerd_exec:s0 +/system/bin/wpa_supplicant u:object_r:wpa_exec:s0 +/system/bin/sdcard u:object_r:sdcardd_exec:s0 +/system/bin/dhcpcd u:object_r:dhcp_exec:s0 +/system/bin/mtpd u:object_r:mtp_exec:s0 +/system/bin/pppd u:object_r:ppp_exec:s0 +/system/bin/tf_daemon u:object_r:tee_exec:s0 +/system/bin/racoon u:object_r:racoon_exec:s0 +# for root +/system/xbin/sugote u:object_r:zygote_exec:s0 +/system/bin/app_process32_original u:object_r:zygote_exec:s0 +/system/bin/app_process_init u:object_r:zygote_exec:s0 +/system/bin/app_process32_xposed u:object_r:zygote_exec:s0 +# +/system/vendor/bin/gpsd u:object_r:gpsd_exec:s0 +/system/bin/dnsmasq u:object_r:dnsmasq_exec:s0 +/system/bin/hostapd u:object_r:hostapd_exec:s0 +/system/bin/clatd u:object_r:clatd_exec:s0 +/system/bin/lmkd u:object_r:lmkd_exec:s0 +/system/bin/inputflinger u:object_r:inputflinger_exec:s0 +/system/bin/logd u:object_r:logd_exec:s0 +/system/bin/uncrypt u:object_r:uncrypt_exec:s0 +/system/bin/logwrapper u:object_r:system_file:s0 +/system/bin/vdc u:object_r:vdc_exec:s0 +/system/bin/install-recovery.sh u:object_r:install_recovery_exec:s0 +/system/bin/dex2oat u:object_r:dex2oat_exec:s0 +# patchoat executable has (essentially) the same requirements as dex2oat. +/system/bin/patchoat u:object_r:dex2oat_exec:s0 + +############################# +# Vendor files +# +/vendor(/.*)? u:object_r:system_file:s0 +/vendor/bin/gpsd u:object_r:gpsd_exec:s0 +############################# +# Data files +# +/data(/.*)? u:object_r:system_data_file:s0 +/data/.layout_version u:object_r:install_data_file:s0 +/data/backup(/.*)? u:object_r:backup_data_file:s0 +/data/secure/backup(/.*)? u:object_r:backup_data_file:s0 +/data/security(/.*)? u:object_r:security_file:s0 +/data/system/ndebugsocket u:object_r:system_ndebug_socket:s0 +/data/drm(/.*)? u:object_r:drm_data_file:s0 +#/data/gps(/.*)? u:object_r:gps_data_file:s0 +/data/resource-cache(/.*)? u:object_r:resourcecache_data_file:s0 +/data/themepack-module(/.*)? u:object_r:themepack_module_file:s0 +/data/dalvik-cache(/.*)? u:object_r:dalvikcache_data_file:s0 +/data/dalvik-cache/profiles(/.*)? u:object_r:dalvikcache_profiles_data_file:s0 +/data/anr(/.*)? u:object_r:anr_data_file:s0 +/data/app(/.*)? u:object_r:apk_data_file:s0 +/data/app/vmdl.*\.tmp(/.*)? u:object_r:apk_tmp_file:s0 +/data/app-private(/.*)? u:object_r:apk_private_data_file:s0 +/data/app-private/vmdl.*\.tmp(/.*)? u:object_r:apk_private_tmp_file:s0 +/data/tombstones(/.*)? u:object_r:tombstone_data_file:s0 +/data/local/tmp(/.*)? u:object_r:shell_data_file:s0 +/data/media(/.*)? u:object_r:media_rw_data_file:s0 +/data/mediadrm(/.*)? u:object_r:media_data_file:s0 +/data/property(/.*)? u:object_r:property_data_file:s0 + +# Misc data +/data/misc/adb(/.*)? u:object_r:adb_keys_file:s0 +/data/misc/audio(/.*)? u:object_r:audio_data_file:s0 +/data/misc/bluetooth(/.*)? u:object_r:bluetooth_data_file:s0 +/data/misc/bluedroid(/.*)? u:object_r:bluetooth_data_file:s0 +/data/misc/bluedroid/\.a2dp_ctrl u:object_r:bluetooth_socket:s0 +/data/misc/bluedroid/\.a2dp_data u:object_r:bluetooth_socket:s0 +/data/misc/camera(/.*)? u:object_r:camera_data_file:s0 +/data/misc/dhcp(/.*)? u:object_r:dhcp_data_file:s0 +/data/misc/keychain(/.*)? u:object_r:keychain_data_file:s0 +/data/misc/keystore(/.*)? u:object_r:keystore_data_file:s0 +/data/misc/media(/.*)? u:object_r:media_data_file:s0 +/data/misc/net(/.*)? u:object_r:net_data_file:s0 +/data/misc/shared_relro(/.*)? u:object_r:shared_relro_file:s0 +/data/misc/sms(/.*)? u:object_r:radio_data_file:s0 +/data/misc/systemkeys(/.*)? u:object_r:systemkeys_data_file:s0 +/data/misc/user(/.*)? u:object_r:misc_user_data_file:s0 +/data/misc/vpn(/.*)? u:object_r:vpn_data_file:s0 +/data/misc/wifi(/.*)? u:object_r:wifi_data_file:s0 +/data/misc/wifi/sockets(/.*)? u:object_r:wpa_socket:s0 +/data/misc/wifi/sockets/wpa_ctrl.* u:object_r:system_wpa_socket:s0 +/data/misc/wifi/hostapd(/.*)? u:object_r:wpa_socket:s0 +/data/misc/zoneinfo(/.*)? u:object_r:zoneinfo_data_file:s0 +/data/gps/brcm_gps_unix_socket u:object_r:bluetooth_data_file:s0 +/data/gps(/.*)? u:object_r:bluetooth_data_file:s0 + +# Wallpaper file for other users +/data/system/users/[0-9]+/wallpaper u:object_r:wallpaper_file:s0 +# Lockscreen wallpaper files +/data/system/users/[0-9]+/lockscreen_phone u:object_r:wallpaper_file:s0 +/data/system/users/[0-9]+/lockscreen_pad u:object_r:wallpaper_file:s0 +############################# +# efs files +# +/efs(/.*)? u:object_r:efs_file:s0 +############################# +# Cache files +# +/cache(/.*)? u:object_r:cache_file:s0 +/cache/.*\.data u:object_r:cache_backup_file:s0 +/cache/.*\.restore u:object_r:cache_backup_file:s0 +# LocalTransport (backup) uses this directory +/cache/backup(/.*)? u:object_r:cache_backup_file:s0 +############################# +# sysfs files +# +/sys/devices/platform/nfc-power/nfc_power -- u:object_r:sysfs_nfc_power_writable:s0 +/sys/devices/system/cpu(/.*)? u:object_r:sysfs_devices_system_cpu:s0 +/sys/power/wake_lock -- u:object_r:sysfs_wake_lock:s0 +/sys/power/wake_unlock -- u:object_r:sysfs_wake_lock:s0 +/sys/kernel/uevent_helper -- u:object_r:usermodehelper:s0 +/sys/module/lowmemorykiller(/.*)? -- u:object_r:sysfs_lowmemorykiller:s0 + +############################# +# asec containers +/mnt/asec(/.*)? u:object_r:asec_apk_file:s0 +/mnt/asec/[^/]+/[^/]+\.zip u:object_r:asec_public_file:s0 +/mnt/asec/[^/]+/lib(/.*)? u:object_r:asec_public_file:s0 +/data/app-asec(/.*)? u:object_r:asec_image_file:s0 +/mnt/secure/asec(/.*)? u:object_r:asec_image_file_ext:s0 + +############################# +# APD files +# +/apd(/.*)? u:object_r:system_file:s0 +#line 1 "vendor/asus/tools/logtool/sepolicy/file_contexts" +#logtool +/system/bin/asuslogcat u:object_r:logtoold_exec:s0 +/system/bin/fdcmts u:object_r:logtoold_exec:s0 +/system/bin/logkmsg u:object_r:logtoold_exec:s0 +/system/bin/logcontrol u:object_r:logtoold_exec:s0 +/system/bin/logcommand u:object_r:logtoold_exec:s0 +/system/bin/toolcommand u:object_r:fdctool_exec:s0 +/system/bin/toolconnect u:object_r:logtoold_exec:s0 +/dev/socket/toolconnect u:object_r:logtoold_socket:s0 +/dev/socket/fdcmdm[0-9]* u:object_r:logtoold_socket:s0 +/dev/mdmTrace u:object_r:mdmTrace_device:s0 +#line 1 "device/intel/common/sepolicy/file_contexts" +# Additional file_contexts +# ASF securityfile service +/system/bin/securityfileservice u:object_r:asf_exec:s0 +#line 1 "device/intel/clovertrail/sepolicy/file_contexts" +# Additional file_contexts +# label graphics device with a new type +/dev/dri/card0 u:object_r:gpu_device:s0 + +# sep (Symantec endpoint protection) device, since app domain doesn't have access to tee device +/dev/sep_sec_driver u:object_r:sep_device:s0 + +# GPS +# remove? +/dev/gsmtty7 u:object_r:gps_device:s0 +/system/bin/gpsd u:object_r:gpsd_exec:s0 +/system/bin/gpslogd u:object_r:gpsd_exec:s0 +/system/bin/gpscerd u:object_r:gpsd_exec:s0 + +# mmgr +#/dev/socket/mmgr u:object_r:mmgr_socket:s0 +/dev/socket/mmgr[0-9]* u:object_r:mmgr_socket:s0 +/system/bin/mmgr u:object_r:mmgr_exec:s0 +/sys/devices/pci0000:00/0000:00:05.1/power/control u:object_r:sysfs_uart_power_ctrl:s0 +/dev/mdm_ctrl(.*)? u:object_r:tty_device:s0 +/dev/ttyXMM(.*)? u:object_r:tty_device:s0 + +# nvm_server +/system/bin/nvm_server u:object_r:nvm_server_exec:s0 +/dev/socket/nvm-ctl[0-9]* u:object_r:nvm_ctl_socket:s0 + +# coreu +# /system/bin/coreu u:object_r:coreu_exec:s0 + +# sensor +/dev/akm09911 u:object_r:sensors_device:s0 +/dev/akm09911_dev u:object_r:sensors_device:s0 +/dev/cm3602 u:object_r:sensors_device:s0 +/dev/kxtj9_dev u:object_r:sensors_device:s0 +/dev/asus_gsensor u:object_r:sensors_device:s0 +/dev/lightsensor u:object_r:sensors_device:s0 +/system/bin/akmd09911 u:object_r:sensors_exec:s0 +/system/bin/a600cg_akmd09911 u:object_r:sensors_exec:s0 +/dev/i2c(.*)? u:object_r:i2c_device:s0 + +# GPU +/dev/pvr_sync u:object_r:gpu_device:s0 + +# crashlogd +/system/bin/crashlogd u:object_r:crashlogd_exec:s0 + +# wlan_prov +/system/bin/wlan_prov u:object_r:wlan_prov_exec:s0 + +# bd_prov (bluetooth) +/system/bin/bd_prov u:object_r:bd_prov_exec:s0 + +# thermal management +/sys/devices/virtual/thermal(.*)? u:object_r:sysfs_thermal_management:s0 +/dev/socket/logconfig u:object_r:thermal_socket:s0 + +# healthd +/dev/max170xx u:object_r:tty_device:s0 + +# camera +/dev/media0 u:object_r:camera_device:s0 +/dev/v4l-subdev(.*)? u:object_r:camera_device:s0 + +# fg_conf +/system/bin/fg_conf u:object_r:fg_conf_exec:s0 + +# bcu_cpufreqrel +/system/bin/bcu_cpufreqrel u:object_r:bcu_cpufreqrel_exec:s0 + +# logcat for all the init scripts +/system/bin/logcat u:object_r:logcat_exec:s0 + +# pvrsrvctl +/system/vendor/bin/pvrsrvctl u:object_r:pvrsrvctl_exec:s0 + +# dpstmgr +/system/bin/dpstmgr u:object_r:dpstmgr_exec:s0 + +# atproxy_usbreset +/system/bin/atproxy_usbreset u:object_r:atproxy_usbreset_exec:s0 + +# rild (clear, dump) +/sys/kernel/modem_nvram(.*)? u:object_r:radio_device:s0 +/dev/socket/rild[0-9]+ u:object_r:rild_socket:s0 +/dev/socket/rild-debug[0-9]+ u:object_r:rild_debug_socket:s0 + +# voice +/dev/audience_es305 u:object_r:audio_device:s0 +/dev/gsmtty(.*)? u:object_r:tty_device:s0 + +/dev/intel_sst_ctrl u:object_r:intel_sst_ctrl_device:s0 +/dev/switch_ctrl u:object_r:switch_ctrl_device:s0 + +/dev/ttyIFX[0-1] u:object_r:tty_device:s0 +/dev/ttyMFD(.*)? u:object_r:tty_device:s0 + +#rootfs +/logs(/.*)? u:object_r:log_file:s0 +/config(/.*)? u:object_r:config_file:s0 +/factory(/.*)? u:object_r:factory_file:s0 + +#gauge +/system/bin/upi_ug31xx u:object_r:gauge_exec:s0 +/dev/ug31xx u:object_r:gauge_device:s0 diff --git a/assets/file_contexts_z008 b/assets/file_contexts_z008 new file mode 100644 index 0000000..a8f7259 --- /dev/null +++ b/assets/file_contexts_z008 @@ -0,0 +1,410 @@ +#line 1 "external/sepolicy/file_contexts" +########################################### +# Root +/ u:object_r:rootfs:s0 + +# Data files +/adb_keys u:object_r:adb_keys_file:s0 +/default\.prop u:object_r:rootfs:s0 +/fstab\..* u:object_r:rootfs:s0 +/init\..* u:object_r:rootfs:s0 +/res(/.*)? u:object_r:rootfs:s0 +/ueventd\..* u:object_r:rootfs:s0 + +# Executables +/charger u:object_r:rootfs:s0 +/init u:object_r:rootfs:s0 +/sbin(/.*)? u:object_r:rootfs:s0 + +# Empty directories +/lost\+found u:object_r:rootfs:s0 +/proc u:object_r:rootfs:s0 + +# SELinux policy files +/file_contexts u:object_r:rootfs:s0 +/property_contexts u:object_r:rootfs:s0 +/seapp_contexts u:object_r:rootfs:s0 +/sepolicy u:object_r:rootfs:s0 + +########################## +# Devices +# +/dev(/.*)? u:object_r:device:s0 +/dev/akm8973.* u:object_r:sensors_device:s0 +/dev/accelerometer u:object_r:sensors_device:s0 +/dev/adf[0-9]* u:object_r:graphics_device:s0 +/dev/adf-interface[0-9]*\.[0-9]* u:object_r:graphics_device:s0 +/dev/adf-overlay-engine[0-9]*\.[0-9]* u:object_r:graphics_device:s0 +/dev/alarm u:object_r:alarm_device:s0 +/dev/android_adb.* u:object_r:adb_device:s0 +/dev/android_pclink.* u:object_r:pclink_device:s0 +/dev/ashmem u:object_r:ashmem_device:s0 +/dev/audio.* u:object_r:audio_device:s0 +/dev/binder u:object_r:binder_device:s0 +/dev/block(/.*)? u:object_r:block_device:s0 +/dev/block/loop[0-9]* u:object_r:loop_device:s0 +/dev/block/ram[0-9]* u:object_r:ram_device:s0 +/dev/bus/usb(.*)? u:object_r:usb_device:s0 +/dev/cam u:object_r:camera_device:s0 +/dev/console u:object_r:console_device:s0 +/dev/cpuctl(/.*)? u:object_r:cpuctl_device:s0 +/dev/device-mapper u:object_r:dm_device:s0 +/dev/eac u:object_r:audio_device:s0 +/dev/fscklogs(/.*)? u:object_r:fscklogs:s0 +/dev/full u:object_r:full_device:s0 +/dev/fuse u:object_r:fuse_device:s0 +/dev/graphics(/.*)? u:object_r:graphics_device:s0 +/dev/hw_random u:object_r:hw_random_device:s0 +/dev/input(/.*) u:object_r:input_device:s0 +/dev/iio:device[0-9]+ u:object_r:iio_device:s0 +/dev/ion u:object_r:ion_device:s0 +/dev/kmem u:object_r:kmem_device:s0 +/dev/log(/.*)? u:object_r:log_device:s0 +/dev/mem u:object_r:kmem_device:s0 +/dev/modem.* u:object_r:radio_device:s0 +/dev/mpu u:object_r:gps_device:s0 +/dev/mpuirq u:object_r:gps_device:s0 +/dev/mtd(/.*)? u:object_r:mtd_device:s0 +/dev/mtp_usb u:object_r:mtp_device:s0 +/dev/pn544 u:object_r:nfc_device:s0 +/dev/bcm2079x-i2c u:object_r:nfc_device:s0 +/dev/ppp u:object_r:ppp_device:s0 +/dev/ptmx u:object_r:ptmx_device:s0 +/dev/pvrsrvkm u:object_r:gpu_device:s0 +/dev/kmsg u:object_r:kmsg_device:s0 +/dev/null u:object_r:null_device:s0 +/dev/nvhdcp1 u:object_r:video_device:s0 +/dev/random u:object_r:random_device:s0 +/dev/rpmsg-omx[0-9] u:object_r:rpmsg_device:s0 +/dev/rproc_user u:object_r:rpmsg_device:s0 +/dev/snd(/.*)? u:object_r:audio_device:s0 +/dev/socket(/.*)? u:object_r:socket_device:s0 +/dev/socket/adbd u:object_r:adbd_socket:s0 +/dev/socket/pclinkd u:object_r:pclinkd_socket:s0 +/dev/socket/dnsproxyd u:object_r:dnsproxyd_socket:s0 +/dev/socket/dumpstate u:object_r:dumpstate_socket:s0 +/dev/socket/fwmarkd u:object_r:fwmarkd_socket:s0 +/dev/socket/gps u:object_r:gps_socket:s0 +/dev/socket/installd u:object_r:installd_socket:s0 +/dev/socket/lmkd u:object_r:lmkd_socket:s0 +/dev/logd_debug u:object_r:logd_debug:s0 +/dev/socket/logd u:object_r:logd_socket:s0 +/dev/socket/logdr u:object_r:logdr_socket:s0 +/dev/socket/logdw u:object_r:logdw_socket:s0 +/dev/socket/mdns u:object_r:mdns_socket:s0 +/dev/socket/mdnsd u:object_r:mdnsd_socket:s0 +/dev/socket/mtpd u:object_r:mtpd_socket:s0 +/dev/socket/netd u:object_r:netd_socket:s0 +/dev/socket/property_service u:object_r:property_socket:s0 +/dev/socket/racoon u:object_r:racoon_socket:s0 +/dev/socket/rild u:object_r:rild_socket:s0 +/dev/socket/rild-debug u:object_r:rild_debug_socket:s0 +/dev/socket/vold u:object_r:vold_socket:s0 +/dev/socket/wpa_eth[0-9] u:object_r:wpa_socket:s0 +/dev/socket/wpa_wlan[0-9] u:object_r:wpa_socket:s0 +/dev/socket/zygote u:object_r:zygote_socket:s0 +/dev/socket/zygote_secondary u:object_r:zygote_socket:s0 +/dev/spdif_out.* u:object_r:audio_device:s0 +/dev/tegra.* u:object_r:video_device:s0 +/dev/tf_driver u:object_r:tee_device:s0 +/dev/tty u:object_r:owntty_device:s0 +/dev/tty[0-9]* u:object_r:tty_device:s0 +/dev/ttyS[0-9]* u:object_r:serial_device:s0 +/dev/tun u:object_r:tun_device:s0 +/dev/uhid u:object_r:uhid_device:s0 +/dev/uinput u:object_r:uhid_device:s0 +/dev/uio[0-9]* u:object_r:uio_device:s0 +/dev/urandom u:object_r:urandom_device:s0 +/dev/usb_accessory u:object_r:usbaccessory_device:s0 +/dev/vcs[0-9a-z]* u:object_r:vcs_device:s0 +/dev/video[0-9]* u:object_r:video_device:s0 +/dev/watchdog u:object_r:watchdog_device:s0 +/dev/xt_qtaguid u:object_r:qtaguid_device:s0 +/dev/zero u:object_r:zero_device:s0 +/dev/__kmsg__ u:object_r:klog_device:s0 +/dev/__properties__ u:object_r:properties_device:s0 +############################# +# System files +# +/system(/.*)? u:object_r:system_file:s0 +/system/bin/info_setting u:object_r:shell_exec:s0 +/system/bin/sh -- u:object_r:shell_exec:s0 +/system/bin/run-as -- u:object_r:runas_exec:s0 +/system/bin/bootanimation u:object_r:bootanim_exec:s0 +/system/bin/app_process32 u:object_r:zygote_exec:s0 +/system/bin/app_process64 u:object_r:zygote_exec:s0 +/system/bin/servicemanager u:object_r:servicemanager_exec:s0 +/system/bin/surfaceflinger u:object_r:surfaceflinger_exec:s0 +/system/bin/drmserver u:object_r:drmserver_exec:s0 +/system/bin/dumpstate u:object_r:dumpstate_exec:s0 +/system/bin/vold u:object_r:vold_exec:s0 +/system/bin/netd u:object_r:netd_exec:s0 +/system/bin/rild u:object_r:rild_exec:s0 +/system/bin/mediaserver u:object_r:mediaserver_exec:s0 +/system/bin/mdnsd u:object_r:mdnsd_exec:s0 +/system/bin/installd u:object_r:installd_exec:s0 +/system/bin/keystore u:object_r:keystore_exec:s0 +/system/bin/debuggerd u:object_r:debuggerd_exec:s0 +/system/bin/debuggerd64 u:object_r:debuggerd_exec:s0 +/system/bin/wpa_supplicant u:object_r:wpa_exec:s0 +/system/bin/sdcard u:object_r:sdcardd_exec:s0 +/system/bin/dhcpcd u:object_r:dhcp_exec:s0 +/system/bin/mtpd u:object_r:mtp_exec:s0 +/system/bin/pppd u:object_r:ppp_exec:s0 +/system/bin/tf_daemon u:object_r:tee_exec:s0 +/system/bin/racoon u:object_r:racoon_exec:s0 +# for root +/system/xbin/sugote u:object_r:zygote_exec:s0 +/system/bin/app_process32_original u:object_r:zygote_exec:s0 +/system/bin/app_process_init u:object_r:zygote_exec:s0 +/system/bin/app_process32_xposed u:object_r:zygote_exec:s0 +# +/system/vendor/bin/gpsd u:object_r:gpsd_exec:s0 +/system/bin/dnsmasq u:object_r:dnsmasq_exec:s0 +/system/bin/hostapd u:object_r:hostapd_exec:s0 +/system/bin/clatd u:object_r:clatd_exec:s0 +/system/bin/lmkd u:object_r:lmkd_exec:s0 +/system/bin/inputflinger u:object_r:inputflinger_exec:s0 +/system/bin/logd u:object_r:logd_exec:s0 +/system/bin/uncrypt u:object_r:uncrypt_exec:s0 +/system/bin/logwrapper u:object_r:system_file:s0 +/system/bin/vdc u:object_r:vdc_exec:s0 +/system/bin/install-recovery.sh u:object_r:install_recovery_exec:s0 +/system/bin/dex2oat u:object_r:dex2oat_exec:s0 +# patchoat executable has (essentially) the same requirements as dex2oat. +/system/bin/patchoat u:object_r:dex2oat_exec:s0 + +############################# +# Vendor files +# +/vendor(/.*)? u:object_r:system_file:s0 +/vendor/bin/gpsd u:object_r:gpsd_exec:s0 +############################# +# Data files +# +/data(/.*)? u:object_r:system_data_file:s0 +/data/.layout_version u:object_r:install_data_file:s0 +/data/backup(/.*)? u:object_r:backup_data_file:s0 +/data/secure/backup(/.*)? u:object_r:backup_data_file:s0 +/data/security(/.*)? u:object_r:security_file:s0 +/data/system/ndebugsocket u:object_r:system_ndebug_socket:s0 +/data/drm(/.*)? u:object_r:drm_data_file:s0 +/data/gps(/.*)? u:object_r:gps_data_file:s0 +/data/resource-cache(/.*)? u:object_r:resourcecache_data_file:s0 +/data/themepack-module(/.*)? u:object_r:themepack_module_file:s0 +/data/themepack-exchange(/.*)? u:object_r:themepack_exchange_file:s0 +/data/dalvik-cache(/.*)? u:object_r:dalvikcache_data_file:s0 +/data/dalvik-cache/profiles(/.*)? u:object_r:dalvikcache_profiles_data_file:s0 +/data/anr(/.*)? u:object_r:anr_data_file:s0 +/data/app(/.*)? u:object_r:apk_data_file:s0 +/data/app/vmdl.*\.tmp(/.*)? u:object_r:apk_tmp_file:s0 +/data/app-private(/.*)? u:object_r:apk_private_data_file:s0 +/data/app-private/vmdl.*\.tmp(/.*)? u:object_r:apk_private_tmp_file:s0 +/data/tombstones(/.*)? u:object_r:tombstone_data_file:s0 +/data/local/tmp(/.*)? u:object_r:shell_data_file:s0 +/data/media(/.*)? u:object_r:media_rw_data_file:s0 +/data/mediadrm(/.*)? u:object_r:media_data_file:s0 +/data/property(/.*)? u:object_r:property_data_file:s0 + +# Misc data +/data/misc/adb(/.*)? u:object_r:adb_keys_file:s0 +/data/misc/audio(/.*)? u:object_r:audio_data_file:s0 +/data/misc/bluetooth(/.*)? u:object_r:bluetooth_data_file:s0 +/data/misc/bluedroid(/.*)? u:object_r:bluetooth_data_file:s0 +/data/misc/bluedroid/\.a2dp_ctrl u:object_r:bluetooth_socket:s0 +/data/misc/bluedroid/\.a2dp_data u:object_r:bluetooth_socket:s0 +/data/misc/camera(/.*)? u:object_r:camera_data_file:s0 +/data/misc/dhcp(/.*)? u:object_r:dhcp_data_file:s0 +/data/misc/keychain(/.*)? u:object_r:keychain_data_file:s0 +/data/misc/keystore(/.*)? u:object_r:keystore_data_file:s0 +/data/misc/media(/.*)? u:object_r:media_data_file:s0 +/data/misc/net(/.*)? u:object_r:net_data_file:s0 +/data/misc/shared_relro(/.*)? u:object_r:shared_relro_file:s0 +/data/misc/sms(/.*)? u:object_r:radio_data_file:s0 +/data/misc/systemkeys(/.*)? u:object_r:systemkeys_data_file:s0 +/data/misc/user(/.*)? u:object_r:misc_user_data_file:s0 +/data/misc/vpn(/.*)? u:object_r:vpn_data_file:s0 +/data/misc/wifi(/.*)? u:object_r:wifi_data_file:s0 +/data/misc/wifi/sockets(/.*)? u:object_r:wpa_socket:s0 +/data/misc/wifi/sockets/wpa_ctrl.* u:object_r:system_wpa_socket:s0 +/data/misc/wifi/hostapd(/.*)? u:object_r:wpa_socket:s0 +/data/misc/zoneinfo(/.*)? u:object_r:zoneinfo_data_file:s0 + +# Wallpaper file for other users +/data/system/users/[0-9]+/wallpaper u:object_r:wallpaper_file:s0 +# Lockscreen wallpaper files +/data/system/users/[0-9]+/lockscreen_phone u:object_r:wallpaper_file:s0 +/data/system/users/[0-9]+/lockscreen_pad u:object_r:wallpaper_file:s0 +############################# +# efs files +# +/efs(/.*)? u:object_r:efs_file:s0 +############################# +# Cache files +# +/cache(/.*)? u:object_r:cache_file:s0 +/cache/.*\.data u:object_r:cache_backup_file:s0 +/cache/.*\.restore u:object_r:cache_backup_file:s0 +# LocalTransport (backup) uses this directory +/cache/backup(/.*)? u:object_r:cache_backup_file:s0 +############################# +# sysfs files +# +/sys/devices/platform/nfc-power/nfc_power -- u:object_r:sysfs_nfc_power_writable:s0 +/sys/devices/system/cpu(/.*)? u:object_r:sysfs_devices_system_cpu:s0 +/sys/power/wake_lock -- u:object_r:sysfs_wake_lock:s0 +/sys/power/wake_unlock -- u:object_r:sysfs_wake_lock:s0 +/sys/kernel/uevent_helper -- u:object_r:usermodehelper:s0 +/sys/module/lowmemorykiller(/.*)? -- u:object_r:sysfs_lowmemorykiller:s0 + +############################# +# asec containers +/mnt/asec(/.*)? u:object_r:asec_apk_file:s0 +/mnt/asec/[^/]+/[^/]+\.zip u:object_r:asec_public_file:s0 +/mnt/asec/[^/]+/lib(/.*)? u:object_r:asec_public_file:s0 +/data/app-asec(/.*)? u:object_r:asec_image_file:s0 +/mnt/secure/asec(/.*)? u:object_r:asec_image_file_ext:s0 +############################# +# APD files +# +/APD(/.*)? u:object_r:demoapp_file:s0 +/ADF(/.*)? u:object_r:demoapp_file:s0 + +#line 1 "vendor/asus/tools/logtool/sepolicy/file_contexts" +#logtool +/system/bin/asuslogcat u:object_r:dumpstate_exec:s0 +/system/bin/fdcmts u:object_r:logtoold_exec:s0 +/system/bin/logkmsg u:object_r:dumpstate_exec:s0 +/system/bin/logcontrol u:object_r:dumpstate_exec:s0 +/system/bin/logcommand u:object_r:logtoold_exec:s0 +/system/bin/toolcommand u:object_r:fdctool_exec:s0 +/system/bin/toolconnect u:object_r:logtoold_exec:s0 +/dev/socket/toolconnect u:object_r:logtoold_socket:s0 +/dev/socket/fdcmdm[0-9]* u:object_r:logtoold_socket:s0 +#line 1 "device/intel/common/sepolicy/file_contexts" +# Additional file_contexts +# ASF securityfile service +/system/bin/securityfileservice u:object_r:asf_exec:s0 +#line 1 "device/intel/moorefield/sepolicy/file_contexts" +# Additional file_contexts +# label graphics device with a new type +/dev/dri/card0 u:object_r:gpu_device:s0 +/dev/pvr_sync u:object_r:gpu_device:s0 +/dev/sw_sync u:object_r:graphics_device:s0 +/dev/intel_sst_ctrl u:object_r:intel_sst_ctrl_device:s0 +/dev/switch_ctrl u:object_r:switch_ctrl_device:s0 + +# chaabi uses sep_device +/dev/dx_sep_q(.*) u:object_r:sep_device:s0 + +# GPS +/dev/gsmtty(.*)? u:object_r:tty_device:s0 +/dev/ttyMFD(.*)? u:object_r:tty_device:s0 +/system/bin/gpsd u:object_r:gpsd_exec:s0 +/system/bin/gpscerd u:object_r:gpsd_exec:s0 + +# mmgr +/dev/socket/mmgr[0-9]* u:object_r:mmgr_socket:s0 +/dev/mdm_apcdmp0 u:object_r:radio_device:s0 +/system/bin/mmgr u:object_r:mmgr_exec:s0 +/sys/devices/pci0000:00/0000:00:10.0/hsic/hsic0/hsic_enable u:object_r:sysfs_hsic_enable:s0 +/sys/devices/pci0000:00/0000:00:10.0/hsic_enable u:object_r:sysfs_hsic_enable:s0 +/sys/devices/pci0000:00/0000:00:04.2/power/control u:object_r:sysfs_uart_power_ctrl:s0 +/sys/devices/pci0000:00/0000:00:04.3/power/control u:object_r:sysfs_uart_power_ctrl:s0 +/dev/mdm_ctrl(.*)? u:object_r:tty_device:s0 +/dev/ttyACM(.*)? u:object_r:tty_device:s0 +/dev/ttyXMM(.*)? u:object_r:tty_device:s0 + +# hdcpd +/system/bin/hdcpd u:object_r:hdcpd_exec:s0 +/data/hdcp(/.*)? u:object_r:hdcpd_data_file:s0 + +# sensorhubd +/system/bin/sensorhubd u:object_r:sensorhubd_exec:s0 +/sys/devices/platform/80860F41:04/i2c-5/5-0040/control u:object_r:sysfs_hwmon_control:s0 +/dev/socket/sensorhubd u:object_r:sensorhubd_socket:s0 +/dev/i2c(.*)? u:object_r:i2c_device:s0 +/sys/class/gpio/gpio59/value u:object_r:sysfs_gpio_value:s0 +/sys/class/gpio/gpio95/value u:object_r:sysfs_gpio_value:s0 +/sys/devices/pci0000:00/0000:00:16.1/control u:object_r:sysfs_hwmon_control:s0 + +# nvm_server +/system/bin/nvm_server u:object_r:nvm_server_exec:s0 +/dev/socket/nvm-ctl[0-9]* u:object_r:nvm_ctl_socket:s0 + +# ueventd +/sys/devices/pci0000:00/0000:00:10.0/L2_autosuspend_enable u:object_r:sysfs_autosuspend_enable:s0 + +# crashlogd +/system/bin/crashlogd u:object_r:dumpstate_exec:s0 + +# bd_prov (bluetooth) +/system/bin/bd_prov u:object_r:bd_prov_exec:s0 + +# vw drm +/sys/devices/pci0000:00/0000:00:02.0/resource0 u:object_r:sysfs_drm_resource:s0 +/sys/devices/pci0000:00/0000:00:02.0/drm/(.*)? u:object_r:sysfs_drm_resource:s0 + +# thermal management +/sys/devices/platform/coretemp.0/(.*)? u:object_r:sysfs_thermal_management:s0 +/sys/devices/virtual/thermal(.*)? u:object_r:sysfs_thermal_management:s0 +/dev/socket/logconfig u:object_r:thermal_socket:s0 +/sys/devices/virtual/powercap/intel-rapl/intel-rapl:0(/.*)? u:object_r:sysfs_thermal_management:s0 + +# CPU +/dev/msr[0-3] u:object_r:msr_device:s0 + +# healthd +/dev/max170xx u:object_r:tty_device:s0 + +# camera +/dev/media0 u:object_r:camera_device:s0 +/dev/v4l-subdev(.*)? u:object_r:camera_device:s0 + +# fg_conf +/system/bin/fg_conf u:object_r:fg_conf_exec:s0 + +# wlan_prov +/system/bin/wlan_prov u:object_r:wlan_prov_exec:s0 + +# bcu_cpufreqrel +/system/bin/bcu_cpufreqrel u:object_r:bcu_cpufreqrel_exec:s0 + +# logcat for all the init scripts +/system/bin/logcat u:object_r:logcat_exec:s0 + +# nfc +/data/nfc(/.*)? u:object_r:nfc_data_file:s0 + +# pvrsrvctl +/system/bin/pvrsrvctl u:object_r:pvrsrvctl_exec:s0 +/system/vendor/bin/pvrsrvctl u:object_r:pvrsrvctl_exec:s0 + +# dpstmgr +/system/bin/dpstmgr u:object_r:dpstmgr_exec:s0 + +# rfid_monzaxd +/system/bin/rfid_monzaxd u:object_r:rfid_monzaxd_exec:s0 + +# rild +/sys/kernel/modem_nvram/dump u:object_r:radio_device:s0 +/dev/socket/rild[0-9]+ u:object_r:rild_socket:s0 +/dev/socket/rild-debug[0-9]+ u:object_r:rild_debug_socket:s0 + +# sl_si_service +/system/bin/sl_si_service u:object_r:sl_si_service_exec:s0 + +# factory files +/factory(/.*)? u:object_r:factory_file:s0 + +# config files +/config(/.*)? u:object_r:config_file:s0 + +# log files +/logs(/.*)? u:object_r:log_file:s0 + +# system_server +/dev/block/mmcblk0p9 u:object_r:tmpfs_block_device:s0 + +#Bug Reporter +/system/etc/packlogs.sh u:object_r:dumpstate_exec:s0 diff --git a/assets/file_contexts_z008_fix b/assets/file_contexts_z008_fix new file mode 100644 index 0000000..7288e6d --- /dev/null +++ b/assets/file_contexts_z008_fix @@ -0,0 +1,408 @@ +#line 1 "external/sepolicy/file_contexts" +########################################### +# Root +/ u:object_r:rootfs:s0 + +# Data files +/adb_keys u:object_r:adb_keys_file:s0 +/default\.prop u:object_r:rootfs:s0 +/fstab\..* u:object_r:rootfs:s0 +/init\..* u:object_r:rootfs:s0 +/res(/.*)? u:object_r:rootfs:s0 +/ueventd\..* u:object_r:rootfs:s0 + +# Executables +/charger u:object_r:rootfs:s0 +/init u:object_r:rootfs:s0 +/sbin(/.*)? u:object_r:rootfs:s0 + +# Empty directories +/lost\+found u:object_r:rootfs:s0 +/proc u:object_r:rootfs:s0 + +# SELinux policy files +/file_contexts u:object_r:rootfs:s0 +/property_contexts u:object_r:rootfs:s0 +/seapp_contexts u:object_r:rootfs:s0 +/sepolicy u:object_r:rootfs:s0 + +########################## +# Devices +# +/dev(/.*)? u:object_r:device:s0 +/dev/akm8973.* u:object_r:sensors_device:s0 +/dev/accelerometer u:object_r:sensors_device:s0 +/dev/adf[0-9]* u:object_r:graphics_device:s0 +/dev/adf-interface[0-9]*\.[0-9]* u:object_r:graphics_device:s0 +/dev/adf-overlay-engine[0-9]*\.[0-9]* u:object_r:graphics_device:s0 +/dev/alarm u:object_r:alarm_device:s0 +/dev/android_adb.* u:object_r:adb_device:s0 +/dev/android_pclink.* u:object_r:pclink_device:s0 +/dev/ashmem u:object_r:ashmem_device:s0 +/dev/audio.* u:object_r:audio_device:s0 +/dev/binder u:object_r:binder_device:s0 +/dev/block(/.*)? u:object_r:block_device:s0 +/dev/block/loop[0-9]* u:object_r:loop_device:s0 +/dev/block/ram[0-9]* u:object_r:ram_device:s0 +/dev/bus/usb(.*)? u:object_r:usb_device:s0 +/dev/cam u:object_r:camera_device:s0 +/dev/console u:object_r:console_device:s0 +/dev/cpuctl(/.*)? u:object_r:cpuctl_device:s0 +/dev/device-mapper u:object_r:dm_device:s0 +/dev/eac u:object_r:audio_device:s0 +/dev/fscklogs(/.*)? u:object_r:fscklogs:s0 +/dev/full u:object_r:full_device:s0 +/dev/fuse u:object_r:fuse_device:s0 +/dev/graphics(/.*)? u:object_r:graphics_device:s0 +/dev/hw_random u:object_r:hw_random_device:s0 +/dev/input(/.*) u:object_r:input_device:s0 +/dev/iio:device[0-9]+ u:object_r:iio_device:s0 +/dev/ion u:object_r:ion_device:s0 +/dev/kmem u:object_r:kmem_device:s0 +/dev/log(/.*)? u:object_r:log_device:s0 +/dev/mem u:object_r:kmem_device:s0 +/dev/modem.* u:object_r:radio_device:s0 +/dev/mpu u:object_r:gps_device:s0 +/dev/mpuirq u:object_r:gps_device:s0 +/dev/mtd(/.*)? u:object_r:mtd_device:s0 +/dev/mtp_usb u:object_r:mtp_device:s0 +/dev/pn544 u:object_r:nfc_device:s0 +/dev/bcm2079x-i2c u:object_r:nfc_device:s0 +/dev/ppp u:object_r:ppp_device:s0 +/dev/ptmx u:object_r:ptmx_device:s0 +/dev/pvrsrvkm u:object_r:gpu_device:s0 +/dev/kmsg u:object_r:kmsg_device:s0 +/dev/null u:object_r:null_device:s0 +/dev/nvhdcp1 u:object_r:video_device:s0 +/dev/random u:object_r:random_device:s0 +/dev/rpmsg-omx[0-9] u:object_r:rpmsg_device:s0 +/dev/rproc_user u:object_r:rpmsg_device:s0 +/dev/snd(/.*)? u:object_r:audio_device:s0 +/dev/socket(/.*)? u:object_r:socket_device:s0 +/dev/socket/adbd u:object_r:adbd_socket:s0 +/dev/socket/pclinkd u:object_r:pclinkd_socket:s0 +/dev/socket/dnsproxyd u:object_r:dnsproxyd_socket:s0 +/dev/socket/dumpstate u:object_r:dumpstate_socket:s0 +/dev/socket/fwmarkd u:object_r:fwmarkd_socket:s0 +/dev/socket/gps u:object_r:gps_socket:s0 +/dev/socket/installd u:object_r:installd_socket:s0 +/dev/socket/lmkd u:object_r:lmkd_socket:s0 +/dev/logd_debug u:object_r:logd_debug:s0 +/dev/socket/logd u:object_r:logd_socket:s0 +/dev/socket/logdr u:object_r:logdr_socket:s0 +/dev/socket/logdw u:object_r:logdw_socket:s0 +/dev/socket/mdns u:object_r:mdns_socket:s0 +/dev/socket/mdnsd u:object_r:mdnsd_socket:s0 +/dev/socket/mtpd u:object_r:mtpd_socket:s0 +/dev/socket/netd u:object_r:netd_socket:s0 +/dev/socket/property_service u:object_r:property_socket:s0 +/dev/socket/racoon u:object_r:racoon_socket:s0 +/dev/socket/rild u:object_r:rild_socket:s0 +/dev/socket/rild-debug u:object_r:rild_debug_socket:s0 +/dev/socket/vold u:object_r:vold_socket:s0 +/dev/socket/wpa_eth[0-9] u:object_r:wpa_socket:s0 +/dev/socket/wpa_wlan[0-9] u:object_r:wpa_socket:s0 +/dev/socket/zygote u:object_r:zygote_socket:s0 +/dev/socket/zygote_secondary u:object_r:zygote_socket:s0 +/dev/spdif_out.* u:object_r:audio_device:s0 +/dev/tegra.* u:object_r:video_device:s0 +/dev/tf_driver u:object_r:tee_device:s0 +/dev/tty u:object_r:owntty_device:s0 +/dev/tty[0-9]* u:object_r:tty_device:s0 +/dev/ttyS[0-9]* u:object_r:serial_device:s0 +/dev/tun u:object_r:tun_device:s0 +/dev/uhid u:object_r:uhid_device:s0 +/dev/uinput u:object_r:uhid_device:s0 +/dev/uio[0-9]* u:object_r:uio_device:s0 +/dev/urandom u:object_r:urandom_device:s0 +/dev/usb_accessory u:object_r:usbaccessory_device:s0 +/dev/vcs[0-9a-z]* u:object_r:vcs_device:s0 +/dev/video[0-9]* u:object_r:video_device:s0 +/dev/watchdog u:object_r:watchdog_device:s0 +/dev/xt_qtaguid u:object_r:qtaguid_device:s0 +/dev/zero u:object_r:zero_device:s0 +/dev/__kmsg__ u:object_r:klog_device:s0 +/dev/__properties__ u:object_r:properties_device:s0 +############################# +# System files +# +/system(/.*)? u:object_r:system_file:s0 +/system/bin/info_setting u:object_r:shell_exec:s0 +/system/bin/sh -- u:object_r:shell_exec:s0 +/system/bin/run-as -- u:object_r:runas_exec:s0 +/system/bin/bootanimation u:object_r:bootanim_exec:s0 +/system/bin/servicemanager u:object_r:servicemanager_exec:s0 +/system/bin/surfaceflinger u:object_r:surfaceflinger_exec:s0 +/system/bin/drmserver u:object_r:drmserver_exec:s0 +/system/bin/dumpstate u:object_r:dumpstate_exec:s0 +/system/bin/vold u:object_r:vold_exec:s0 +/system/bin/netd u:object_r:netd_exec:s0 +/system/bin/rild u:object_r:rild_exec:s0 +/system/bin/mediaserver u:object_r:mediaserver_exec:s0 +/system/bin/mdnsd u:object_r:mdnsd_exec:s0 +/system/bin/installd u:object_r:installd_exec:s0 +/system/bin/keystore u:object_r:keystore_exec:s0 +/system/bin/debuggerd u:object_r:debuggerd_exec:s0 +/system/bin/debuggerd64 u:object_r:debuggerd_exec:s0 +/system/bin/wpa_supplicant u:object_r:wpa_exec:s0 +/system/bin/sdcard u:object_r:sdcardd_exec:s0 +/system/bin/dhcpcd u:object_r:dhcp_exec:s0 +/system/bin/mtpd u:object_r:mtp_exec:s0 +/system/bin/pppd u:object_r:ppp_exec:s0 +/system/bin/tf_daemon u:object_r:tee_exec:s0 +/system/bin/racoon u:object_r:racoon_exec:s0 +# for root +/system/xbin/sugote u:object_r:zygote_exec:s0 +/system/bin/app_process32_original u:object_r:zygote_exec:s0 +/system/bin/app_process_init u:object_r:zygote_exec:s0 +/system/bin/app_process32_xposed u:object_r:zygote_exec:s0 +# +/system/vendor/bin/gpsd u:object_r:gpsd_exec:s0 +/system/bin/dnsmasq u:object_r:dnsmasq_exec:s0 +/system/bin/hostapd u:object_r:hostapd_exec:s0 +/system/bin/clatd u:object_r:clatd_exec:s0 +/system/bin/lmkd u:object_r:lmkd_exec:s0 +/system/bin/inputflinger u:object_r:inputflinger_exec:s0 +/system/bin/logd u:object_r:logd_exec:s0 +/system/bin/uncrypt u:object_r:uncrypt_exec:s0 +/system/bin/logwrapper u:object_r:system_file:s0 +/system/bin/vdc u:object_r:vdc_exec:s0 +/system/bin/install-recovery.sh u:object_r:install_recovery_exec:s0 +/system/bin/dex2oat u:object_r:dex2oat_exec:s0 +# patchoat executable has (essentially) the same requirements as dex2oat. +/system/bin/patchoat u:object_r:dex2oat_exec:s0 + +############################# +# Vendor files +# +/vendor(/.*)? u:object_r:system_file:s0 +/vendor/bin/gpsd u:object_r:gpsd_exec:s0 +############################# +# Data files +# +/data(/.*)? u:object_r:system_data_file:s0 +/data/.layout_version u:object_r:install_data_file:s0 +/data/backup(/.*)? u:object_r:backup_data_file:s0 +/data/secure/backup(/.*)? u:object_r:backup_data_file:s0 +/data/security(/.*)? u:object_r:security_file:s0 +/data/system/ndebugsocket u:object_r:system_ndebug_socket:s0 +/data/drm(/.*)? u:object_r:drm_data_file:s0 +/data/gps(/.*)? u:object_r:gps_data_file:s0 +/data/resource-cache(/.*)? u:object_r:resourcecache_data_file:s0 +/data/themepack-module(/.*)? u:object_r:themepack_module_file:s0 +/data/themepack-exchange(/.*)? u:object_r:themepack_exchange_file:s0 +/data/dalvik-cache(/.*)? u:object_r:dalvikcache_data_file:s0 +/data/dalvik-cache/profiles(/.*)? u:object_r:dalvikcache_profiles_data_file:s0 +/data/anr(/.*)? u:object_r:anr_data_file:s0 +/data/app(/.*)? u:object_r:apk_data_file:s0 +/data/app/vmdl.*\.tmp(/.*)? u:object_r:apk_tmp_file:s0 +/data/app-private(/.*)? u:object_r:apk_private_data_file:s0 +/data/app-private/vmdl.*\.tmp(/.*)? u:object_r:apk_private_tmp_file:s0 +/data/tombstones(/.*)? u:object_r:tombstone_data_file:s0 +/data/local/tmp(/.*)? u:object_r:shell_data_file:s0 +/data/media(/.*)? u:object_r:media_rw_data_file:s0 +/data/mediadrm(/.*)? u:object_r:media_data_file:s0 +/data/property(/.*)? u:object_r:property_data_file:s0 + +# Misc data +/data/misc/adb(/.*)? u:object_r:adb_keys_file:s0 +/data/misc/audio(/.*)? u:object_r:audio_data_file:s0 +/data/misc/bluetooth(/.*)? u:object_r:bluetooth_data_file:s0 +/data/misc/bluedroid(/.*)? u:object_r:bluetooth_data_file:s0 +/data/misc/bluedroid/\.a2dp_ctrl u:object_r:bluetooth_socket:s0 +/data/misc/bluedroid/\.a2dp_data u:object_r:bluetooth_socket:s0 +/data/misc/camera(/.*)? u:object_r:camera_data_file:s0 +/data/misc/dhcp(/.*)? u:object_r:dhcp_data_file:s0 +/data/misc/keychain(/.*)? u:object_r:keychain_data_file:s0 +/data/misc/keystore(/.*)? u:object_r:keystore_data_file:s0 +/data/misc/media(/.*)? u:object_r:media_data_file:s0 +/data/misc/net(/.*)? u:object_r:net_data_file:s0 +/data/misc/shared_relro(/.*)? u:object_r:shared_relro_file:s0 +/data/misc/sms(/.*)? u:object_r:radio_data_file:s0 +/data/misc/systemkeys(/.*)? u:object_r:systemkeys_data_file:s0 +/data/misc/user(/.*)? u:object_r:misc_user_data_file:s0 +/data/misc/vpn(/.*)? u:object_r:vpn_data_file:s0 +/data/misc/wifi(/.*)? u:object_r:wifi_data_file:s0 +/data/misc/wifi/sockets(/.*)? u:object_r:wpa_socket:s0 +/data/misc/wifi/sockets/wpa_ctrl.* u:object_r:system_wpa_socket:s0 +/data/misc/wifi/hostapd(/.*)? u:object_r:wpa_socket:s0 +/data/misc/zoneinfo(/.*)? u:object_r:zoneinfo_data_file:s0 + +# Wallpaper file for other users +/data/system/users/[0-9]+/wallpaper u:object_r:wallpaper_file:s0 +# Lockscreen wallpaper files +/data/system/users/[0-9]+/lockscreen_phone u:object_r:wallpaper_file:s0 +/data/system/users/[0-9]+/lockscreen_pad u:object_r:wallpaper_file:s0 +############################# +# efs files +# +/efs(/.*)? u:object_r:efs_file:s0 +############################# +# Cache files +# +/cache(/.*)? u:object_r:cache_file:s0 +/cache/.*\.data u:object_r:cache_backup_file:s0 +/cache/.*\.restore u:object_r:cache_backup_file:s0 +# LocalTransport (backup) uses this directory +/cache/backup(/.*)? u:object_r:cache_backup_file:s0 +############################# +# sysfs files +# +/sys/devices/platform/nfc-power/nfc_power -- u:object_r:sysfs_nfc_power_writable:s0 +/sys/devices/system/cpu(/.*)? u:object_r:sysfs_devices_system_cpu:s0 +/sys/power/wake_lock -- u:object_r:sysfs_wake_lock:s0 +/sys/power/wake_unlock -- u:object_r:sysfs_wake_lock:s0 +/sys/kernel/uevent_helper -- u:object_r:usermodehelper:s0 +/sys/module/lowmemorykiller(/.*)? -- u:object_r:sysfs_lowmemorykiller:s0 + +############################# +# asec containers +/mnt/asec(/.*)? u:object_r:asec_apk_file:s0 +/mnt/asec/[^/]+/[^/]+\.zip u:object_r:asec_public_file:s0 +/mnt/asec/[^/]+/lib(/.*)? u:object_r:asec_public_file:s0 +/data/app-asec(/.*)? u:object_r:asec_image_file:s0 +/mnt/secure/asec(/.*)? u:object_r:asec_image_file_ext:s0 +############################# +# APD files +# +/APD(/.*)? u:object_r:demoapp_file:s0 +/ADF(/.*)? u:object_r:demoapp_file:s0 + +#line 1 "vendor/asus/tools/logtool/sepolicy/file_contexts" +#logtool +/system/bin/asuslogcat u:object_r:dumpstate_exec:s0 +/system/bin/fdcmts u:object_r:logtoold_exec:s0 +/system/bin/logkmsg u:object_r:dumpstate_exec:s0 +/system/bin/logcontrol u:object_r:dumpstate_exec:s0 +/system/bin/logcommand u:object_r:logtoold_exec:s0 +/system/bin/toolcommand u:object_r:fdctool_exec:s0 +/system/bin/toolconnect u:object_r:logtoold_exec:s0 +/dev/socket/toolconnect u:object_r:logtoold_socket:s0 +/dev/socket/fdcmdm[0-9]* u:object_r:logtoold_socket:s0 +#line 1 "device/intel/common/sepolicy/file_contexts" +# Additional file_contexts +# ASF securityfile service +/system/bin/securityfileservice u:object_r:asf_exec:s0 +#line 1 "device/intel/moorefield/sepolicy/file_contexts" +# Additional file_contexts +# label graphics device with a new type +/dev/dri/card0 u:object_r:gpu_device:s0 +/dev/pvr_sync u:object_r:gpu_device:s0 +/dev/sw_sync u:object_r:graphics_device:s0 +/dev/intel_sst_ctrl u:object_r:intel_sst_ctrl_device:s0 +/dev/switch_ctrl u:object_r:switch_ctrl_device:s0 + +# chaabi uses sep_device +/dev/dx_sep_q(.*) u:object_r:sep_device:s0 + +# GPS +/dev/gsmtty(.*)? u:object_r:tty_device:s0 +/dev/ttyMFD(.*)? u:object_r:tty_device:s0 +/system/bin/gpsd u:object_r:gpsd_exec:s0 +/system/bin/gpscerd u:object_r:gpsd_exec:s0 + +# mmgr +/dev/socket/mmgr[0-9]* u:object_r:mmgr_socket:s0 +/dev/mdm_apcdmp0 u:object_r:radio_device:s0 +/system/bin/mmgr u:object_r:mmgr_exec:s0 +/sys/devices/pci0000:00/0000:00:10.0/hsic/hsic0/hsic_enable u:object_r:sysfs_hsic_enable:s0 +/sys/devices/pci0000:00/0000:00:10.0/hsic_enable u:object_r:sysfs_hsic_enable:s0 +/sys/devices/pci0000:00/0000:00:04.2/power/control u:object_r:sysfs_uart_power_ctrl:s0 +/sys/devices/pci0000:00/0000:00:04.3/power/control u:object_r:sysfs_uart_power_ctrl:s0 +/dev/mdm_ctrl(.*)? u:object_r:tty_device:s0 +/dev/ttyACM(.*)? u:object_r:tty_device:s0 +/dev/ttyXMM(.*)? u:object_r:tty_device:s0 + +# hdcpd +/system/bin/hdcpd u:object_r:hdcpd_exec:s0 +/data/hdcp(/.*)? u:object_r:hdcpd_data_file:s0 + +# sensorhubd +/system/bin/sensorhubd u:object_r:sensorhubd_exec:s0 +/sys/devices/platform/80860F41:04/i2c-5/5-0040/control u:object_r:sysfs_hwmon_control:s0 +/dev/socket/sensorhubd u:object_r:sensorhubd_socket:s0 +/dev/i2c(.*)? u:object_r:i2c_device:s0 +/sys/class/gpio/gpio59/value u:object_r:sysfs_gpio_value:s0 +/sys/class/gpio/gpio95/value u:object_r:sysfs_gpio_value:s0 +/sys/devices/pci0000:00/0000:00:16.1/control u:object_r:sysfs_hwmon_control:s0 + +# nvm_server +/system/bin/nvm_server u:object_r:nvm_server_exec:s0 +/dev/socket/nvm-ctl[0-9]* u:object_r:nvm_ctl_socket:s0 + +# ueventd +/sys/devices/pci0000:00/0000:00:10.0/L2_autosuspend_enable u:object_r:sysfs_autosuspend_enable:s0 + +# crashlogd +/system/bin/crashlogd u:object_r:dumpstate_exec:s0 + +# bd_prov (bluetooth) +/system/bin/bd_prov u:object_r:bd_prov_exec:s0 + +# vw drm +/sys/devices/pci0000:00/0000:00:02.0/resource0 u:object_r:sysfs_drm_resource:s0 +/sys/devices/pci0000:00/0000:00:02.0/drm/(.*)? u:object_r:sysfs_drm_resource:s0 + +# thermal management +/sys/devices/platform/coretemp.0/(.*)? u:object_r:sysfs_thermal_management:s0 +/sys/devices/virtual/thermal(.*)? u:object_r:sysfs_thermal_management:s0 +/dev/socket/logconfig u:object_r:thermal_socket:s0 +/sys/devices/virtual/powercap/intel-rapl/intel-rapl:0(/.*)? u:object_r:sysfs_thermal_management:s0 + +# CPU +/dev/msr[0-3] u:object_r:msr_device:s0 + +# healthd +/dev/max170xx u:object_r:tty_device:s0 + +# camera +/dev/media0 u:object_r:camera_device:s0 +/dev/v4l-subdev(.*)? u:object_r:camera_device:s0 + +# fg_conf +/system/bin/fg_conf u:object_r:fg_conf_exec:s0 + +# wlan_prov +/system/bin/wlan_prov u:object_r:wlan_prov_exec:s0 + +# bcu_cpufreqrel +/system/bin/bcu_cpufreqrel u:object_r:bcu_cpufreqrel_exec:s0 + +# logcat for all the init scripts +/system/bin/logcat u:object_r:logcat_exec:s0 + +# nfc +/data/nfc(/.*)? u:object_r:nfc_data_file:s0 + +# pvrsrvctl +/system/bin/pvrsrvctl u:object_r:pvrsrvctl_exec:s0 +/system/vendor/bin/pvrsrvctl u:object_r:pvrsrvctl_exec:s0 + +# dpstmgr +/system/bin/dpstmgr u:object_r:dpstmgr_exec:s0 + +# rfid_monzaxd +/system/bin/rfid_monzaxd u:object_r:rfid_monzaxd_exec:s0 + +# rild +/sys/kernel/modem_nvram/dump u:object_r:radio_device:s0 +/dev/socket/rild[0-9]+ u:object_r:rild_socket:s0 +/dev/socket/rild-debug[0-9]+ u:object_r:rild_debug_socket:s0 + +# sl_si_service +/system/bin/sl_si_service u:object_r:sl_si_service_exec:s0 + +# factory files +/factory(/.*)? u:object_r:factory_file:s0 + +# config files +/config(/.*)? u:object_r:config_file:s0 + +# log files +/logs(/.*)? u:object_r:log_file:s0 + +# system_server +/dev/block/mmcblk0p9 u:object_r:tmpfs_block_device:s0 + +#Bug Reporter +/system/etc/packlogs.sh u:object_r:dumpstate_exec:s0 diff --git a/assets/file_contexts_z00a b/assets/file_contexts_z00a new file mode 100644 index 0000000..076d04c --- /dev/null +++ b/assets/file_contexts_z00a @@ -0,0 +1,410 @@ +#line 1 "external/sepolicy/file_contexts" +########################################### +# Root +/ u:object_r:rootfs:s0 + +# Data files +/adb_keys u:object_r:adb_keys_file:s0 +/default\.prop u:object_r:rootfs:s0 +/fstab\..* u:object_r:rootfs:s0 +/init\..* u:object_r:rootfs:s0 +/res(/.*)? u:object_r:rootfs:s0 +/ueventd\..* u:object_r:rootfs:s0 + +# Executables +/charger u:object_r:rootfs:s0 +/init u:object_r:rootfs:s0 +/sbin(/.*)? u:object_r:rootfs:s0 + +# Empty directories +/lost\+found u:object_r:rootfs:s0 +/proc u:object_r:rootfs:s0 + +# SELinux policy files +/file_contexts u:object_r:rootfs:s0 +/property_contexts u:object_r:rootfs:s0 +/seapp_contexts u:object_r:rootfs:s0 +/sepolicy u:object_r:rootfs:s0 + +########################## +# Devices +# +/dev(/.*)? u:object_r:device:s0 +/dev/akm8973.* u:object_r:sensors_device:s0 +/dev/accelerometer u:object_r:sensors_device:s0 +/dev/adf[0-9]* u:object_r:graphics_device:s0 +/dev/adf-interface[0-9]*\.[0-9]* u:object_r:graphics_device:s0 +/dev/adf-overlay-engine[0-9]*\.[0-9]* u:object_r:graphics_device:s0 +/dev/alarm u:object_r:alarm_device:s0 +/dev/android_adb.* u:object_r:adb_device:s0 +/dev/android_pclink.* u:object_r:pclink_device:s0 +/dev/ashmem u:object_r:ashmem_device:s0 +/dev/audio.* u:object_r:audio_device:s0 +/dev/binder u:object_r:binder_device:s0 +/dev/block(/.*)? u:object_r:block_device:s0 +/dev/block/loop[0-9]* u:object_r:loop_device:s0 +/dev/block/ram[0-9]* u:object_r:ram_device:s0 +/dev/bus/usb(.*)? u:object_r:usb_device:s0 +/dev/cam u:object_r:camera_device:s0 +/dev/console u:object_r:console_device:s0 +/dev/cpuctl(/.*)? u:object_r:cpuctl_device:s0 +/dev/device-mapper u:object_r:dm_device:s0 +/dev/eac u:object_r:audio_device:s0 +/dev/fscklogs(/.*)? u:object_r:fscklogs:s0 +/dev/full u:object_r:full_device:s0 +/dev/fuse u:object_r:fuse_device:s0 +/dev/graphics(/.*)? u:object_r:graphics_device:s0 +/dev/hw_random u:object_r:hw_random_device:s0 +/dev/input(/.*) u:object_r:input_device:s0 +/dev/iio:device[0-9]+ u:object_r:iio_device:s0 +/dev/ion u:object_r:ion_device:s0 +/dev/kmem u:object_r:kmem_device:s0 +/dev/log(/.*)? u:object_r:log_device:s0 +/dev/mem u:object_r:kmem_device:s0 +/dev/modem.* u:object_r:radio_device:s0 +/dev/mpu u:object_r:gps_device:s0 +/dev/mpuirq u:object_r:gps_device:s0 +/dev/mtd(/.*)? u:object_r:mtd_device:s0 +/dev/mtp_usb u:object_r:mtp_device:s0 +/dev/pn544 u:object_r:nfc_device:s0 +/dev/bcm2079x-i2c u:object_r:nfc_device:s0 +/dev/ppp u:object_r:ppp_device:s0 +/dev/ptmx u:object_r:ptmx_device:s0 +/dev/pvrsrvkm u:object_r:gpu_device:s0 +/dev/kmsg u:object_r:kmsg_device:s0 +/dev/null u:object_r:null_device:s0 +/dev/nvhdcp1 u:object_r:video_device:s0 +/dev/random u:object_r:random_device:s0 +/dev/rpmsg-omx[0-9] u:object_r:rpmsg_device:s0 +/dev/rproc_user u:object_r:rpmsg_device:s0 +/dev/snd(/.*)? u:object_r:audio_device:s0 +/dev/socket(/.*)? u:object_r:socket_device:s0 +/dev/socket/adbd u:object_r:adbd_socket:s0 +/dev/socket/pclinkd u:object_r:pclinkd_socket:s0 +/dev/socket/dnsproxyd u:object_r:dnsproxyd_socket:s0 +/dev/socket/dumpstate u:object_r:dumpstate_socket:s0 +/dev/socket/fwmarkd u:object_r:fwmarkd_socket:s0 +/dev/socket/gps u:object_r:gps_socket:s0 +/dev/socket/installd u:object_r:installd_socket:s0 +/dev/socket/lmkd u:object_r:lmkd_socket:s0 +/dev/logd_debug u:object_r:logd_debug:s0 +/dev/socket/logd u:object_r:logd_socket:s0 +/dev/socket/logdr u:object_r:logdr_socket:s0 +/dev/socket/logdw u:object_r:logdw_socket:s0 +/dev/socket/mdns u:object_r:mdns_socket:s0 +/dev/socket/mdnsd u:object_r:mdnsd_socket:s0 +/dev/socket/mtpd u:object_r:mtpd_socket:s0 +/dev/socket/netd u:object_r:netd_socket:s0 +/dev/socket/property_service u:object_r:property_socket:s0 +/dev/socket/racoon u:object_r:racoon_socket:s0 +/dev/socket/rild u:object_r:rild_socket:s0 +/dev/socket/rild-debug u:object_r:rild_debug_socket:s0 +/dev/socket/vold u:object_r:vold_socket:s0 +/dev/socket/wpa_eth[0-9] u:object_r:wpa_socket:s0 +/dev/socket/wpa_wlan[0-9] u:object_r:wpa_socket:s0 +/dev/socket/zygote u:object_r:zygote_socket:s0 +/dev/socket/zygote_secondary u:object_r:zygote_socket:s0 +/dev/spdif_out.* u:object_r:audio_device:s0 +/dev/tegra.* u:object_r:video_device:s0 +/dev/tf_driver u:object_r:tee_device:s0 +/dev/tty u:object_r:owntty_device:s0 +/dev/tty[0-9]* u:object_r:tty_device:s0 +/dev/ttyS[0-9]* u:object_r:serial_device:s0 +/dev/tun u:object_r:tun_device:s0 +/dev/uhid u:object_r:uhid_device:s0 +/dev/uinput u:object_r:uhid_device:s0 +/dev/uio[0-9]* u:object_r:uio_device:s0 +/dev/urandom u:object_r:urandom_device:s0 +/dev/usb_accessory u:object_r:usbaccessory_device:s0 +/dev/vcs[0-9a-z]* u:object_r:vcs_device:s0 +/dev/video[0-9]* u:object_r:video_device:s0 +/dev/watchdog u:object_r:watchdog_device:s0 +/dev/xt_qtaguid u:object_r:qtaguid_device:s0 +/dev/zero u:object_r:zero_device:s0 +/dev/__kmsg__ u:object_r:klog_device:s0 +/dev/__properties__ u:object_r:properties_device:s0 +############################# +# System files +# +/system(/.*)? u:object_r:system_file:s0 +/system/bin/info_setting u:object_r:shell_exec:s0 +/system/bin/sh -- u:object_r:shell_exec:s0 +/system/bin/run-as -- u:object_r:runas_exec:s0 +/system/bin/bootanimation u:object_r:bootanim_exec:s0 +/system/bin/app_process32 u:object_r:zygote_exec:s0 +/system/bin/app_process64 u:object_r:zygote_exec:s0 +/system/bin/servicemanager u:object_r:servicemanager_exec:s0 +/system/bin/surfaceflinger u:object_r:surfaceflinger_exec:s0 +/system/bin/drmserver u:object_r:drmserver_exec:s0 +/system/bin/dumpstate u:object_r:dumpstate_exec:s0 +/system/bin/vold u:object_r:vold_exec:s0 +/system/bin/netd u:object_r:netd_exec:s0 +/system/bin/rild u:object_r:rild_exec:s0 +/system/bin/mediaserver u:object_r:mediaserver_exec:s0 +/system/bin/mdnsd u:object_r:mdnsd_exec:s0 +/system/bin/installd u:object_r:installd_exec:s0 +/system/bin/keystore u:object_r:keystore_exec:s0 +/system/bin/debuggerd u:object_r:debuggerd_exec:s0 +/system/bin/debuggerd64 u:object_r:debuggerd_exec:s0 +/system/bin/wpa_supplicant u:object_r:wpa_exec:s0 +/system/bin/sdcard u:object_r:sdcardd_exec:s0 +/system/bin/dhcpcd u:object_r:dhcp_exec:s0 +/system/bin/mtpd u:object_r:mtp_exec:s0 +/system/bin/pppd u:object_r:ppp_exec:s0 +/system/bin/tf_daemon u:object_r:tee_exec:s0 +/system/bin/racoon u:object_r:racoon_exec:s0 +# for root +/system/xbin/sugote u:object_r:zygote_exec:s0 +/system/bin/app_process32_original u:object_r:zygote_exec:s0 +/system/bin/app_process_init u:object_r:zygote_exec:s0 +/system/bin/app_process32_xposed u:object_r:zygote_exec:s0 +# +/system/vendor/bin/gpsd u:object_r:gpsd_exec:s0 +/system/bin/dnsmasq u:object_r:dnsmasq_exec:s0 +/system/bin/hostapd u:object_r:hostapd_exec:s0 +/system/bin/clatd u:object_r:clatd_exec:s0 +/system/bin/lmkd u:object_r:lmkd_exec:s0 +/system/bin/inputflinger u:object_r:inputflinger_exec:s0 +/system/bin/logd u:object_r:logd_exec:s0 +/system/bin/uncrypt u:object_r:uncrypt_exec:s0 +/system/bin/logwrapper u:object_r:system_file:s0 +/system/bin/vdc u:object_r:vdc_exec:s0 +/system/bin/install-recovery.sh u:object_r:install_recovery_exec:s0 +/system/bin/dex2oat u:object_r:dex2oat_exec:s0 +# patchoat executable has (essentially) the same requirements as dex2oat. +/system/bin/patchoat u:object_r:dex2oat_exec:s0 + +############################# +# Vendor files +# +/vendor(/.*)? u:object_r:system_file:s0 +/vendor/bin/gpsd u:object_r:gpsd_exec:s0 +############################# +# Data files +# +/data(/.*)? u:object_r:system_data_file:s0 +/data/.layout_version u:object_r:install_data_file:s0 +/data/backup(/.*)? u:object_r:backup_data_file:s0 +/data/secure/backup(/.*)? u:object_r:backup_data_file:s0 +/data/security(/.*)? u:object_r:security_file:s0 +/data/system/ndebugsocket u:object_r:system_ndebug_socket:s0 +/data/drm(/.*)? u:object_r:drm_data_file:s0 +/data/gps(/.*)? u:object_r:gps_data_file:s0 +/data/resource-cache(/.*)? u:object_r:resourcecache_data_file:s0 +/data/themepack-module(/.*)? u:object_r:themepack_module_file:s0 +/data/themepack-exchange(/.*)? u:object_r:themepack_exchange_file:s0 +/data/dalvik-cache(/.*)? u:object_r:dalvikcache_data_file:s0 +/data/dalvik-cache/profiles(/.*)? u:object_r:dalvikcache_profiles_data_file:s0 +/data/anr(/.*)? u:object_r:anr_data_file:s0 +/data/app(/.*)? u:object_r:apk_data_file:s0 +/data/app/vmdl.*\.tmp(/.*)? u:object_r:apk_tmp_file:s0 +/data/app-private(/.*)? u:object_r:apk_private_data_file:s0 +/data/app-private/vmdl.*\.tmp(/.*)? u:object_r:apk_private_tmp_file:s0 +/data/tombstones(/.*)? u:object_r:tombstone_data_file:s0 +/data/local/tmp(/.*)? u:object_r:shell_data_file:s0 +/data/media(/.*)? u:object_r:media_rw_data_file:s0 +/data/mediadrm(/.*)? u:object_r:media_data_file:s0 +/data/property(/.*)? u:object_r:property_data_file:s0 + +# Misc data +/data/misc/adb(/.*)? u:object_r:adb_keys_file:s0 +/data/misc/audio(/.*)? u:object_r:audio_data_file:s0 +/data/misc/bluetooth(/.*)? u:object_r:bluetooth_data_file:s0 +/data/misc/bluedroid(/.*)? u:object_r:bluetooth_data_file:s0 +/data/misc/bluedroid/\.a2dp_ctrl u:object_r:bluetooth_socket:s0 +/data/misc/bluedroid/\.a2dp_data u:object_r:bluetooth_socket:s0 +/data/misc/camera(/.*)? u:object_r:camera_data_file:s0 +/data/misc/dhcp(/.*)? u:object_r:dhcp_data_file:s0 +/data/misc/keychain(/.*)? u:object_r:keychain_data_file:s0 +/data/misc/keystore(/.*)? u:object_r:keystore_data_file:s0 +/data/misc/media(/.*)? u:object_r:media_data_file:s0 +/data/misc/net(/.*)? u:object_r:net_data_file:s0 +/data/misc/shared_relro(/.*)? u:object_r:shared_relro_file:s0 +/data/misc/sms(/.*)? u:object_r:radio_data_file:s0 +/data/misc/systemkeys(/.*)? u:object_r:systemkeys_data_file:s0 +/data/misc/user(/.*)? u:object_r:misc_user_data_file:s0 +/data/misc/vpn(/.*)? u:object_r:vpn_data_file:s0 +/data/misc/wifi(/.*)? u:object_r:wifi_data_file:s0 +/data/misc/wifi/sockets(/.*)? u:object_r:wpa_socket:s0 +/data/misc/wifi/sockets/wpa_ctrl.* u:object_r:system_wpa_socket:s0 +/data/misc/wifi/hostapd(/.*)? u:object_r:wpa_socket:s0 +/data/misc/zoneinfo(/.*)? u:object_r:zoneinfo_data_file:s0 + +# Wallpaper file for other users +/data/system/users/[0-9]+/wallpaper u:object_r:wallpaper_file:s0 +# Lockscreen wallpaper files +/data/system/users/[0-9]+/lockscreen_phone u:object_r:wallpaper_file:s0 +/data/system/users/[0-9]+/lockscreen_pad u:object_r:wallpaper_file:s0 +############################# +# efs files +# +/efs(/.*)? u:object_r:efs_file:s0 +############################# +# Cache files +# +/cache(/.*)? u:object_r:cache_file:s0 +/cache/.*\.data u:object_r:cache_backup_file:s0 +/cache/.*\.restore u:object_r:cache_backup_file:s0 +# LocalTransport (backup) uses this directory +/cache/backup(/.*)? u:object_r:cache_backup_file:s0 +############################# +# sysfs files +# +/sys/devices/platform/nfc-power/nfc_power -- u:object_r:sysfs_nfc_power_writable:s0 +/sys/devices/system/cpu(/.*)? u:object_r:sysfs_devices_system_cpu:s0 +/sys/power/wake_lock -- u:object_r:sysfs_wake_lock:s0 +/sys/power/wake_unlock -- u:object_r:sysfs_wake_lock:s0 +/sys/kernel/uevent_helper -- u:object_r:usermodehelper:s0 +/sys/module/lowmemorykiller(/.*)? -- u:object_r:sysfs_lowmemorykiller:s0 + +############################# +# asec containers +/mnt/asec(/.*)? u:object_r:asec_apk_file:s0 +/mnt/asec/[^/]+/[^/]+\.zip u:object_r:asec_public_file:s0 +/mnt/asec/[^/]+/lib(/.*)? u:object_r:asec_public_file:s0 +/data/app-asec(/.*)? u:object_r:asec_image_file:s0 +/mnt/secure/asec(/.*)? u:object_r:asec_image_file_ext:s0 +############################# +# APD files +# +/APD(/.*)? u:object_r:demoapp_file:s0 +/ADF(/.*)? u:object_r:demoapp_file:s0 + +#line 1 "vendor/asus/tools/logtool/sepolicy/file_contexts" +#logtool +/system/bin/asuslogcat u:object_r:dumpstate_exec:s0 +/system/bin/fdcmts u:object_r:dumpstate_exec:s0 +/system/bin/logkmsg u:object_r:dumpstate_exec:s0 +/system/bin/logcontrol u:object_r:dumpstate_exec:s0 +/system/bin/logcommand u:object_r:dumpstate_exec:s0 +/system/bin/toolcommand u:object_r:fdctool_exec:s0 +/system/bin/toolconnect u:object_r:dumpstate_exec:s0 +/dev/socket/toolconnect u:object_r:dumpstate_socket:s0 +/dev/socket/fdcmdm[0-9]* u:object_r:dumpstate_socket:s0 +#line 1 "device/intel/common/sepolicy/file_contexts" +# Additional file_contexts +# ASF securityfile service +/system/bin/securityfileservice u:object_r:asf_exec:s0 +#line 1 "device/intel/moorefield/sepolicy/file_contexts" +# Additional file_contexts +# label graphics device with a new type +/dev/dri/card0 u:object_r:gpu_device:s0 +/dev/pvr_sync u:object_r:gpu_device:s0 +/dev/sw_sync u:object_r:graphics_device:s0 +/dev/intel_sst_ctrl u:object_r:intel_sst_ctrl_device:s0 +/dev/switch_ctrl u:object_r:switch_ctrl_device:s0 + +# chaabi uses sep_device +/dev/dx_sep_q(.*) u:object_r:sep_device:s0 + +# GPS +/dev/gsmtty(.*)? u:object_r:tty_device:s0 +/dev/ttyMFD(.*)? u:object_r:tty_device:s0 +/system/bin/gpsd u:object_r:gpsd_exec:s0 +/system/bin/gpscerd u:object_r:gpsd_exec:s0 + +# mmgr +/dev/socket/mmgr[0-9]* u:object_r:mmgr_socket:s0 +/dev/mdm_apcdmp0 u:object_r:radio_device:s0 +/system/bin/mmgr u:object_r:mmgr_exec:s0 +/sys/devices/pci0000:00/0000:00:10.0/hsic/hsic0/hsic_enable u:object_r:sysfs_hsic_enable:s0 +/sys/devices/pci0000:00/0000:00:10.0/hsic_enable u:object_r:sysfs_hsic_enable:s0 +/sys/devices/pci0000:00/0000:00:04.2/power/control u:object_r:sysfs_uart_power_ctrl:s0 +/sys/devices/pci0000:00/0000:00:04.3/power/control u:object_r:sysfs_uart_power_ctrl:s0 +/dev/mdm_ctrl(.*)? u:object_r:tty_device:s0 +/dev/ttyACM(.*)? u:object_r:tty_device:s0 +/dev/ttyXMM(.*)? u:object_r:tty_device:s0 + +# hdcpd +/system/bin/hdcpd u:object_r:hdcpd_exec:s0 +/data/hdcp(/.*)? u:object_r:hdcpd_data_file:s0 + +# sensorhubd +/system/bin/sensorhubd u:object_r:sensorhubd_exec:s0 +/sys/devices/platform/80860F41:04/i2c-5/5-0040/control u:object_r:sysfs_hwmon_control:s0 +/dev/socket/sensorhubd u:object_r:sensorhubd_socket:s0 +/dev/i2c(.*)? u:object_r:i2c_device:s0 +/sys/class/gpio/gpio59/value u:object_r:sysfs_gpio_value:s0 +/sys/class/gpio/gpio95/value u:object_r:sysfs_gpio_value:s0 +/sys/devices/pci0000:00/0000:00:16.1/control u:object_r:sysfs_hwmon_control:s0 + +# nvm_server +/system/bin/nvm_server u:object_r:nvm_server_exec:s0 +/dev/socket/nvm-ctl[0-9]* u:object_r:nvm_ctl_socket:s0 + +# ueventd +/sys/devices/pci0000:00/0000:00:10.0/L2_autosuspend_enable u:object_r:sysfs_autosuspend_enable:s0 + +# crashlogd +/system/bin/crashlogd u:object_r:dumpstate_exec:s0 + +# bd_prov (bluetooth) +/system/bin/bd_prov u:object_r:bd_prov_exec:s0 + +# vw drm +/sys/devices/pci0000:00/0000:00:02.0/resource0 u:object_r:sysfs_drm_resource:s0 +/sys/devices/pci0000:00/0000:00:02.0/drm/(.*)? u:object_r:sysfs_drm_resource:s0 + +# thermal management +/sys/devices/platform/coretemp.0/(.*)? u:object_r:sysfs_thermal_management:s0 +/sys/devices/virtual/thermal(.*)? u:object_r:sysfs_thermal_management:s0 +/dev/socket/logconfig u:object_r:thermal_socket:s0 +/sys/devices/virtual/powercap/intel-rapl/intel-rapl:0(/.*)? u:object_r:sysfs_thermal_management:s0 + +# CPU +/dev/msr[0-3] u:object_r:msr_device:s0 + +# healthd +/dev/max170xx u:object_r:tty_device:s0 + +# camera +/dev/media0 u:object_r:camera_device:s0 +/dev/v4l-subdev(.*)? u:object_r:camera_device:s0 + +# fg_conf +/system/bin/fg_conf u:object_r:fg_conf_exec:s0 + +# wlan_prov +/system/bin/wlan_prov u:object_r:wlan_prov_exec:s0 + +# bcu_cpufreqrel +/system/bin/bcu_cpufreqrel u:object_r:bcu_cpufreqrel_exec:s0 + +# logcat for all the init scripts +/system/bin/logcat u:object_r:logcat_exec:s0 + +# nfc +/data/nfc(/.*)? u:object_r:nfc_data_file:s0 + +# pvrsrvctl +/system/bin/pvrsrvctl u:object_r:pvrsrvctl_exec:s0 +/system/vendor/bin/pvrsrvctl u:object_r:pvrsrvctl_exec:s0 + +# dpstmgr +/system/bin/dpstmgr u:object_r:dpstmgr_exec:s0 + +# rfid_monzaxd +/system/bin/rfid_monzaxd u:object_r:rfid_monzaxd_exec:s0 + +# rild +/sys/kernel/modem_nvram/dump u:object_r:radio_device:s0 +/dev/socket/rild[0-9]+ u:object_r:rild_socket:s0 +/dev/socket/rild-debug[0-9]+ u:object_r:rild_debug_socket:s0 + +# sl_si_service +/system/bin/sl_si_service u:object_r:sl_si_service_exec:s0 + +# factory files +/factory(/.*)? u:object_r:factory_file:s0 + +# config files +/config(/.*)? u:object_r:config_file:s0 + +# log files +/logs(/.*)? u:object_r:log_file:s0 + +# system_server +/dev/block/mmcblk0p9 u:object_r:tmpfs_block_device:s0 + +#Bug Reporter +/system/etc/packlogs.sh u:object_r:dumpstate_exec:s0 diff --git a/assets/file_contexts_z00a_fix b/assets/file_contexts_z00a_fix new file mode 100644 index 0000000..7288e6d --- /dev/null +++ b/assets/file_contexts_z00a_fix @@ -0,0 +1,408 @@ +#line 1 "external/sepolicy/file_contexts" +########################################### +# Root +/ u:object_r:rootfs:s0 + +# Data files +/adb_keys u:object_r:adb_keys_file:s0 +/default\.prop u:object_r:rootfs:s0 +/fstab\..* u:object_r:rootfs:s0 +/init\..* u:object_r:rootfs:s0 +/res(/.*)? u:object_r:rootfs:s0 +/ueventd\..* u:object_r:rootfs:s0 + +# Executables +/charger u:object_r:rootfs:s0 +/init u:object_r:rootfs:s0 +/sbin(/.*)? u:object_r:rootfs:s0 + +# Empty directories +/lost\+found u:object_r:rootfs:s0 +/proc u:object_r:rootfs:s0 + +# SELinux policy files +/file_contexts u:object_r:rootfs:s0 +/property_contexts u:object_r:rootfs:s0 +/seapp_contexts u:object_r:rootfs:s0 +/sepolicy u:object_r:rootfs:s0 + +########################## +# Devices +# +/dev(/.*)? u:object_r:device:s0 +/dev/akm8973.* u:object_r:sensors_device:s0 +/dev/accelerometer u:object_r:sensors_device:s0 +/dev/adf[0-9]* u:object_r:graphics_device:s0 +/dev/adf-interface[0-9]*\.[0-9]* u:object_r:graphics_device:s0 +/dev/adf-overlay-engine[0-9]*\.[0-9]* u:object_r:graphics_device:s0 +/dev/alarm u:object_r:alarm_device:s0 +/dev/android_adb.* u:object_r:adb_device:s0 +/dev/android_pclink.* u:object_r:pclink_device:s0 +/dev/ashmem u:object_r:ashmem_device:s0 +/dev/audio.* u:object_r:audio_device:s0 +/dev/binder u:object_r:binder_device:s0 +/dev/block(/.*)? u:object_r:block_device:s0 +/dev/block/loop[0-9]* u:object_r:loop_device:s0 +/dev/block/ram[0-9]* u:object_r:ram_device:s0 +/dev/bus/usb(.*)? u:object_r:usb_device:s0 +/dev/cam u:object_r:camera_device:s0 +/dev/console u:object_r:console_device:s0 +/dev/cpuctl(/.*)? u:object_r:cpuctl_device:s0 +/dev/device-mapper u:object_r:dm_device:s0 +/dev/eac u:object_r:audio_device:s0 +/dev/fscklogs(/.*)? u:object_r:fscklogs:s0 +/dev/full u:object_r:full_device:s0 +/dev/fuse u:object_r:fuse_device:s0 +/dev/graphics(/.*)? u:object_r:graphics_device:s0 +/dev/hw_random u:object_r:hw_random_device:s0 +/dev/input(/.*) u:object_r:input_device:s0 +/dev/iio:device[0-9]+ u:object_r:iio_device:s0 +/dev/ion u:object_r:ion_device:s0 +/dev/kmem u:object_r:kmem_device:s0 +/dev/log(/.*)? u:object_r:log_device:s0 +/dev/mem u:object_r:kmem_device:s0 +/dev/modem.* u:object_r:radio_device:s0 +/dev/mpu u:object_r:gps_device:s0 +/dev/mpuirq u:object_r:gps_device:s0 +/dev/mtd(/.*)? u:object_r:mtd_device:s0 +/dev/mtp_usb u:object_r:mtp_device:s0 +/dev/pn544 u:object_r:nfc_device:s0 +/dev/bcm2079x-i2c u:object_r:nfc_device:s0 +/dev/ppp u:object_r:ppp_device:s0 +/dev/ptmx u:object_r:ptmx_device:s0 +/dev/pvrsrvkm u:object_r:gpu_device:s0 +/dev/kmsg u:object_r:kmsg_device:s0 +/dev/null u:object_r:null_device:s0 +/dev/nvhdcp1 u:object_r:video_device:s0 +/dev/random u:object_r:random_device:s0 +/dev/rpmsg-omx[0-9] u:object_r:rpmsg_device:s0 +/dev/rproc_user u:object_r:rpmsg_device:s0 +/dev/snd(/.*)? u:object_r:audio_device:s0 +/dev/socket(/.*)? u:object_r:socket_device:s0 +/dev/socket/adbd u:object_r:adbd_socket:s0 +/dev/socket/pclinkd u:object_r:pclinkd_socket:s0 +/dev/socket/dnsproxyd u:object_r:dnsproxyd_socket:s0 +/dev/socket/dumpstate u:object_r:dumpstate_socket:s0 +/dev/socket/fwmarkd u:object_r:fwmarkd_socket:s0 +/dev/socket/gps u:object_r:gps_socket:s0 +/dev/socket/installd u:object_r:installd_socket:s0 +/dev/socket/lmkd u:object_r:lmkd_socket:s0 +/dev/logd_debug u:object_r:logd_debug:s0 +/dev/socket/logd u:object_r:logd_socket:s0 +/dev/socket/logdr u:object_r:logdr_socket:s0 +/dev/socket/logdw u:object_r:logdw_socket:s0 +/dev/socket/mdns u:object_r:mdns_socket:s0 +/dev/socket/mdnsd u:object_r:mdnsd_socket:s0 +/dev/socket/mtpd u:object_r:mtpd_socket:s0 +/dev/socket/netd u:object_r:netd_socket:s0 +/dev/socket/property_service u:object_r:property_socket:s0 +/dev/socket/racoon u:object_r:racoon_socket:s0 +/dev/socket/rild u:object_r:rild_socket:s0 +/dev/socket/rild-debug u:object_r:rild_debug_socket:s0 +/dev/socket/vold u:object_r:vold_socket:s0 +/dev/socket/wpa_eth[0-9] u:object_r:wpa_socket:s0 +/dev/socket/wpa_wlan[0-9] u:object_r:wpa_socket:s0 +/dev/socket/zygote u:object_r:zygote_socket:s0 +/dev/socket/zygote_secondary u:object_r:zygote_socket:s0 +/dev/spdif_out.* u:object_r:audio_device:s0 +/dev/tegra.* u:object_r:video_device:s0 +/dev/tf_driver u:object_r:tee_device:s0 +/dev/tty u:object_r:owntty_device:s0 +/dev/tty[0-9]* u:object_r:tty_device:s0 +/dev/ttyS[0-9]* u:object_r:serial_device:s0 +/dev/tun u:object_r:tun_device:s0 +/dev/uhid u:object_r:uhid_device:s0 +/dev/uinput u:object_r:uhid_device:s0 +/dev/uio[0-9]* u:object_r:uio_device:s0 +/dev/urandom u:object_r:urandom_device:s0 +/dev/usb_accessory u:object_r:usbaccessory_device:s0 +/dev/vcs[0-9a-z]* u:object_r:vcs_device:s0 +/dev/video[0-9]* u:object_r:video_device:s0 +/dev/watchdog u:object_r:watchdog_device:s0 +/dev/xt_qtaguid u:object_r:qtaguid_device:s0 +/dev/zero u:object_r:zero_device:s0 +/dev/__kmsg__ u:object_r:klog_device:s0 +/dev/__properties__ u:object_r:properties_device:s0 +############################# +# System files +# +/system(/.*)? u:object_r:system_file:s0 +/system/bin/info_setting u:object_r:shell_exec:s0 +/system/bin/sh -- u:object_r:shell_exec:s0 +/system/bin/run-as -- u:object_r:runas_exec:s0 +/system/bin/bootanimation u:object_r:bootanim_exec:s0 +/system/bin/servicemanager u:object_r:servicemanager_exec:s0 +/system/bin/surfaceflinger u:object_r:surfaceflinger_exec:s0 +/system/bin/drmserver u:object_r:drmserver_exec:s0 +/system/bin/dumpstate u:object_r:dumpstate_exec:s0 +/system/bin/vold u:object_r:vold_exec:s0 +/system/bin/netd u:object_r:netd_exec:s0 +/system/bin/rild u:object_r:rild_exec:s0 +/system/bin/mediaserver u:object_r:mediaserver_exec:s0 +/system/bin/mdnsd u:object_r:mdnsd_exec:s0 +/system/bin/installd u:object_r:installd_exec:s0 +/system/bin/keystore u:object_r:keystore_exec:s0 +/system/bin/debuggerd u:object_r:debuggerd_exec:s0 +/system/bin/debuggerd64 u:object_r:debuggerd_exec:s0 +/system/bin/wpa_supplicant u:object_r:wpa_exec:s0 +/system/bin/sdcard u:object_r:sdcardd_exec:s0 +/system/bin/dhcpcd u:object_r:dhcp_exec:s0 +/system/bin/mtpd u:object_r:mtp_exec:s0 +/system/bin/pppd u:object_r:ppp_exec:s0 +/system/bin/tf_daemon u:object_r:tee_exec:s0 +/system/bin/racoon u:object_r:racoon_exec:s0 +# for root +/system/xbin/sugote u:object_r:zygote_exec:s0 +/system/bin/app_process32_original u:object_r:zygote_exec:s0 +/system/bin/app_process_init u:object_r:zygote_exec:s0 +/system/bin/app_process32_xposed u:object_r:zygote_exec:s0 +# +/system/vendor/bin/gpsd u:object_r:gpsd_exec:s0 +/system/bin/dnsmasq u:object_r:dnsmasq_exec:s0 +/system/bin/hostapd u:object_r:hostapd_exec:s0 +/system/bin/clatd u:object_r:clatd_exec:s0 +/system/bin/lmkd u:object_r:lmkd_exec:s0 +/system/bin/inputflinger u:object_r:inputflinger_exec:s0 +/system/bin/logd u:object_r:logd_exec:s0 +/system/bin/uncrypt u:object_r:uncrypt_exec:s0 +/system/bin/logwrapper u:object_r:system_file:s0 +/system/bin/vdc u:object_r:vdc_exec:s0 +/system/bin/install-recovery.sh u:object_r:install_recovery_exec:s0 +/system/bin/dex2oat u:object_r:dex2oat_exec:s0 +# patchoat executable has (essentially) the same requirements as dex2oat. +/system/bin/patchoat u:object_r:dex2oat_exec:s0 + +############################# +# Vendor files +# +/vendor(/.*)? u:object_r:system_file:s0 +/vendor/bin/gpsd u:object_r:gpsd_exec:s0 +############################# +# Data files +# +/data(/.*)? u:object_r:system_data_file:s0 +/data/.layout_version u:object_r:install_data_file:s0 +/data/backup(/.*)? u:object_r:backup_data_file:s0 +/data/secure/backup(/.*)? u:object_r:backup_data_file:s0 +/data/security(/.*)? u:object_r:security_file:s0 +/data/system/ndebugsocket u:object_r:system_ndebug_socket:s0 +/data/drm(/.*)? u:object_r:drm_data_file:s0 +/data/gps(/.*)? u:object_r:gps_data_file:s0 +/data/resource-cache(/.*)? u:object_r:resourcecache_data_file:s0 +/data/themepack-module(/.*)? u:object_r:themepack_module_file:s0 +/data/themepack-exchange(/.*)? u:object_r:themepack_exchange_file:s0 +/data/dalvik-cache(/.*)? u:object_r:dalvikcache_data_file:s0 +/data/dalvik-cache/profiles(/.*)? u:object_r:dalvikcache_profiles_data_file:s0 +/data/anr(/.*)? u:object_r:anr_data_file:s0 +/data/app(/.*)? u:object_r:apk_data_file:s0 +/data/app/vmdl.*\.tmp(/.*)? u:object_r:apk_tmp_file:s0 +/data/app-private(/.*)? u:object_r:apk_private_data_file:s0 +/data/app-private/vmdl.*\.tmp(/.*)? u:object_r:apk_private_tmp_file:s0 +/data/tombstones(/.*)? u:object_r:tombstone_data_file:s0 +/data/local/tmp(/.*)? u:object_r:shell_data_file:s0 +/data/media(/.*)? u:object_r:media_rw_data_file:s0 +/data/mediadrm(/.*)? u:object_r:media_data_file:s0 +/data/property(/.*)? u:object_r:property_data_file:s0 + +# Misc data +/data/misc/adb(/.*)? u:object_r:adb_keys_file:s0 +/data/misc/audio(/.*)? u:object_r:audio_data_file:s0 +/data/misc/bluetooth(/.*)? u:object_r:bluetooth_data_file:s0 +/data/misc/bluedroid(/.*)? u:object_r:bluetooth_data_file:s0 +/data/misc/bluedroid/\.a2dp_ctrl u:object_r:bluetooth_socket:s0 +/data/misc/bluedroid/\.a2dp_data u:object_r:bluetooth_socket:s0 +/data/misc/camera(/.*)? u:object_r:camera_data_file:s0 +/data/misc/dhcp(/.*)? u:object_r:dhcp_data_file:s0 +/data/misc/keychain(/.*)? u:object_r:keychain_data_file:s0 +/data/misc/keystore(/.*)? u:object_r:keystore_data_file:s0 +/data/misc/media(/.*)? u:object_r:media_data_file:s0 +/data/misc/net(/.*)? u:object_r:net_data_file:s0 +/data/misc/shared_relro(/.*)? u:object_r:shared_relro_file:s0 +/data/misc/sms(/.*)? u:object_r:radio_data_file:s0 +/data/misc/systemkeys(/.*)? u:object_r:systemkeys_data_file:s0 +/data/misc/user(/.*)? u:object_r:misc_user_data_file:s0 +/data/misc/vpn(/.*)? u:object_r:vpn_data_file:s0 +/data/misc/wifi(/.*)? u:object_r:wifi_data_file:s0 +/data/misc/wifi/sockets(/.*)? u:object_r:wpa_socket:s0 +/data/misc/wifi/sockets/wpa_ctrl.* u:object_r:system_wpa_socket:s0 +/data/misc/wifi/hostapd(/.*)? u:object_r:wpa_socket:s0 +/data/misc/zoneinfo(/.*)? u:object_r:zoneinfo_data_file:s0 + +# Wallpaper file for other users +/data/system/users/[0-9]+/wallpaper u:object_r:wallpaper_file:s0 +# Lockscreen wallpaper files +/data/system/users/[0-9]+/lockscreen_phone u:object_r:wallpaper_file:s0 +/data/system/users/[0-9]+/lockscreen_pad u:object_r:wallpaper_file:s0 +############################# +# efs files +# +/efs(/.*)? u:object_r:efs_file:s0 +############################# +# Cache files +# +/cache(/.*)? u:object_r:cache_file:s0 +/cache/.*\.data u:object_r:cache_backup_file:s0 +/cache/.*\.restore u:object_r:cache_backup_file:s0 +# LocalTransport (backup) uses this directory +/cache/backup(/.*)? u:object_r:cache_backup_file:s0 +############################# +# sysfs files +# +/sys/devices/platform/nfc-power/nfc_power -- u:object_r:sysfs_nfc_power_writable:s0 +/sys/devices/system/cpu(/.*)? u:object_r:sysfs_devices_system_cpu:s0 +/sys/power/wake_lock -- u:object_r:sysfs_wake_lock:s0 +/sys/power/wake_unlock -- u:object_r:sysfs_wake_lock:s0 +/sys/kernel/uevent_helper -- u:object_r:usermodehelper:s0 +/sys/module/lowmemorykiller(/.*)? -- u:object_r:sysfs_lowmemorykiller:s0 + +############################# +# asec containers +/mnt/asec(/.*)? u:object_r:asec_apk_file:s0 +/mnt/asec/[^/]+/[^/]+\.zip u:object_r:asec_public_file:s0 +/mnt/asec/[^/]+/lib(/.*)? u:object_r:asec_public_file:s0 +/data/app-asec(/.*)? u:object_r:asec_image_file:s0 +/mnt/secure/asec(/.*)? u:object_r:asec_image_file_ext:s0 +############################# +# APD files +# +/APD(/.*)? u:object_r:demoapp_file:s0 +/ADF(/.*)? u:object_r:demoapp_file:s0 + +#line 1 "vendor/asus/tools/logtool/sepolicy/file_contexts" +#logtool +/system/bin/asuslogcat u:object_r:dumpstate_exec:s0 +/system/bin/fdcmts u:object_r:logtoold_exec:s0 +/system/bin/logkmsg u:object_r:dumpstate_exec:s0 +/system/bin/logcontrol u:object_r:dumpstate_exec:s0 +/system/bin/logcommand u:object_r:logtoold_exec:s0 +/system/bin/toolcommand u:object_r:fdctool_exec:s0 +/system/bin/toolconnect u:object_r:logtoold_exec:s0 +/dev/socket/toolconnect u:object_r:logtoold_socket:s0 +/dev/socket/fdcmdm[0-9]* u:object_r:logtoold_socket:s0 +#line 1 "device/intel/common/sepolicy/file_contexts" +# Additional file_contexts +# ASF securityfile service +/system/bin/securityfileservice u:object_r:asf_exec:s0 +#line 1 "device/intel/moorefield/sepolicy/file_contexts" +# Additional file_contexts +# label graphics device with a new type +/dev/dri/card0 u:object_r:gpu_device:s0 +/dev/pvr_sync u:object_r:gpu_device:s0 +/dev/sw_sync u:object_r:graphics_device:s0 +/dev/intel_sst_ctrl u:object_r:intel_sst_ctrl_device:s0 +/dev/switch_ctrl u:object_r:switch_ctrl_device:s0 + +# chaabi uses sep_device +/dev/dx_sep_q(.*) u:object_r:sep_device:s0 + +# GPS +/dev/gsmtty(.*)? u:object_r:tty_device:s0 +/dev/ttyMFD(.*)? u:object_r:tty_device:s0 +/system/bin/gpsd u:object_r:gpsd_exec:s0 +/system/bin/gpscerd u:object_r:gpsd_exec:s0 + +# mmgr +/dev/socket/mmgr[0-9]* u:object_r:mmgr_socket:s0 +/dev/mdm_apcdmp0 u:object_r:radio_device:s0 +/system/bin/mmgr u:object_r:mmgr_exec:s0 +/sys/devices/pci0000:00/0000:00:10.0/hsic/hsic0/hsic_enable u:object_r:sysfs_hsic_enable:s0 +/sys/devices/pci0000:00/0000:00:10.0/hsic_enable u:object_r:sysfs_hsic_enable:s0 +/sys/devices/pci0000:00/0000:00:04.2/power/control u:object_r:sysfs_uart_power_ctrl:s0 +/sys/devices/pci0000:00/0000:00:04.3/power/control u:object_r:sysfs_uart_power_ctrl:s0 +/dev/mdm_ctrl(.*)? u:object_r:tty_device:s0 +/dev/ttyACM(.*)? u:object_r:tty_device:s0 +/dev/ttyXMM(.*)? u:object_r:tty_device:s0 + +# hdcpd +/system/bin/hdcpd u:object_r:hdcpd_exec:s0 +/data/hdcp(/.*)? u:object_r:hdcpd_data_file:s0 + +# sensorhubd +/system/bin/sensorhubd u:object_r:sensorhubd_exec:s0 +/sys/devices/platform/80860F41:04/i2c-5/5-0040/control u:object_r:sysfs_hwmon_control:s0 +/dev/socket/sensorhubd u:object_r:sensorhubd_socket:s0 +/dev/i2c(.*)? u:object_r:i2c_device:s0 +/sys/class/gpio/gpio59/value u:object_r:sysfs_gpio_value:s0 +/sys/class/gpio/gpio95/value u:object_r:sysfs_gpio_value:s0 +/sys/devices/pci0000:00/0000:00:16.1/control u:object_r:sysfs_hwmon_control:s0 + +# nvm_server +/system/bin/nvm_server u:object_r:nvm_server_exec:s0 +/dev/socket/nvm-ctl[0-9]* u:object_r:nvm_ctl_socket:s0 + +# ueventd +/sys/devices/pci0000:00/0000:00:10.0/L2_autosuspend_enable u:object_r:sysfs_autosuspend_enable:s0 + +# crashlogd +/system/bin/crashlogd u:object_r:dumpstate_exec:s0 + +# bd_prov (bluetooth) +/system/bin/bd_prov u:object_r:bd_prov_exec:s0 + +# vw drm +/sys/devices/pci0000:00/0000:00:02.0/resource0 u:object_r:sysfs_drm_resource:s0 +/sys/devices/pci0000:00/0000:00:02.0/drm/(.*)? u:object_r:sysfs_drm_resource:s0 + +# thermal management +/sys/devices/platform/coretemp.0/(.*)? u:object_r:sysfs_thermal_management:s0 +/sys/devices/virtual/thermal(.*)? u:object_r:sysfs_thermal_management:s0 +/dev/socket/logconfig u:object_r:thermal_socket:s0 +/sys/devices/virtual/powercap/intel-rapl/intel-rapl:0(/.*)? u:object_r:sysfs_thermal_management:s0 + +# CPU +/dev/msr[0-3] u:object_r:msr_device:s0 + +# healthd +/dev/max170xx u:object_r:tty_device:s0 + +# camera +/dev/media0 u:object_r:camera_device:s0 +/dev/v4l-subdev(.*)? u:object_r:camera_device:s0 + +# fg_conf +/system/bin/fg_conf u:object_r:fg_conf_exec:s0 + +# wlan_prov +/system/bin/wlan_prov u:object_r:wlan_prov_exec:s0 + +# bcu_cpufreqrel +/system/bin/bcu_cpufreqrel u:object_r:bcu_cpufreqrel_exec:s0 + +# logcat for all the init scripts +/system/bin/logcat u:object_r:logcat_exec:s0 + +# nfc +/data/nfc(/.*)? u:object_r:nfc_data_file:s0 + +# pvrsrvctl +/system/bin/pvrsrvctl u:object_r:pvrsrvctl_exec:s0 +/system/vendor/bin/pvrsrvctl u:object_r:pvrsrvctl_exec:s0 + +# dpstmgr +/system/bin/dpstmgr u:object_r:dpstmgr_exec:s0 + +# rfid_monzaxd +/system/bin/rfid_monzaxd u:object_r:rfid_monzaxd_exec:s0 + +# rild +/sys/kernel/modem_nvram/dump u:object_r:radio_device:s0 +/dev/socket/rild[0-9]+ u:object_r:rild_socket:s0 +/dev/socket/rild-debug[0-9]+ u:object_r:rild_debug_socket:s0 + +# sl_si_service +/system/bin/sl_si_service u:object_r:sl_si_service_exec:s0 + +# factory files +/factory(/.*)? u:object_r:factory_file:s0 + +# config files +/config(/.*)? u:object_r:config_file:s0 + +# log files +/logs(/.*)? u:object_r:log_file:s0 + +# system_server +/dev/block/mmcblk0p9 u:object_r:tmpfs_block_device:s0 + +#Bug Reporter +/system/etc/packlogs.sh u:object_r:dumpstate_exec:s0 diff --git a/assets/fs_supersu.patch b/assets/fs_supersu.patch new file mode 100644 index 0000000..d4eb89b --- /dev/null +++ b/assets/fs_supersu.patch @@ -0,0 +1,18 @@ +diff --git a/include/private/android_filesystem_config.h b/include/private/android_filesystem_config.h +index 5d9c3ea..21ab7c7 100644 +--- a/include/private/android_filesystem_config.h ++++ b/include/private/android_filesystem_config.h +@@ -223,6 +223,13 @@ static const struct fs_path_config android_dirs[] = { + ** and will allow partial matches. + */ + static const struct fs_path_config android_files[] = { ++ { 00755, AID_ROOT, AID_ROOT, 0, "system/etc/install-recovery.sh" }, ++ { 00755, AID_ROOT, AID_ROOT, 0, "system/xbin/daemonsu" }, ++ { 00755, AID_ROOT, AID_ROOT, 0, "system/xbin/sugote" }, ++ { 00755, AID_ROOT, AID_ROOT, 0, "system/xbin/sugote-mksh" }, ++ { 00755, AID_ROOT, AID_ROOT, 0, "system/xbin/supolicy" }, ++ { 00755, AID_ROOT, AID_ROOT, 0, "system/bin/.ext/.su" }, ++ + { 00440, AID_ROOT, AID_SHELL, 0, "system/etc/init.goldfish.rc" }, + { 00550, AID_ROOT, AID_SHELL, 0, "system/etc/init.goldfish.sh" }, + { 00440, AID_ROOT, AID_SHELL, 0, "system/etc/init.trout.rc" }, diff --git a/assets/make_ext4fs.patch b/assets/make_ext4fs.patch new file mode 100644 index 0000000..dc38b55 --- /dev/null +++ b/assets/make_ext4fs.patch @@ -0,0 +1,78 @@ +diff --git a/core/libsparse/output_file.c b/core/libsparse/output_file.c +index cd30800..8e24f3f 100644 +--- a/core/libsparse/output_file.c ++++ b/core/libsparse/output_file.c +@@ -36,7 +36,9 @@ + + #ifndef USE_MINGW + #include ++#ifndef O_BINARY + #define O_BINARY 0 ++#endif + #else + #define ftruncate64 ftruncate + #endif +@@ -48,6 +50,13 @@ + #define off64_t off_t + #endif + ++#ifdef __CYGWIN__ ++#define lseek64 lseek ++#define ftruncate64 ftruncate ++#define mmap64 mmap ++#define off64_t off_t ++#endif ++ + #define min(a, b) \ + ({ typeof(a) _a = (a); typeof(b) _b = (b); (_a < _b) ? _a : _b; }) + +diff --git a/core/libsparse/sparse_read.c b/core/libsparse/sparse_read.c +index 8e188e9..baeb62a 100644 +--- a/core/libsparse/sparse_read.c ++++ b/core/libsparse/sparse_read.c +@@ -40,6 +40,11 @@ + #define off64_t off_t + #endif + ++#ifdef __CYGWIN__ ++#define lseek64 lseek ++#define off64_t off_t ++#endif ++ + #define SPARSE_HEADER_MAJOR_VER 1 + #define SPARSE_HEADER_LEN (sizeof(sparse_header_t)) + #define CHUNK_HEADER_LEN (sizeof(chunk_header_t)) +diff --git a/extras/ext4_utils/ext4_utils.h b/extras/ext4_utils/ext4_utils.h +index 499753f..08d67a1 100644 +--- a/extras/ext4_utils/ext4_utils.h ++++ b/extras/ext4_utils/ext4_utils.h +@@ -45,6 +45,13 @@ extern "C" { + #define off64_t off_t + #endif + ++#ifdef __CYGWIN__ ++#define lseek64 lseek ++#define ftruncate64 ftruncate ++#define mmap64 mmap ++#define off64_t off_t ++#endif ++ + #include "ext4_sb.h" + + extern int force; +diff --git a/extras/ext4_utils/ext4fixup.c b/extras/ext4_utils/ext4fixup.c +index 184cd0d..11912ba 100644 +--- a/extras/ext4_utils/ext4fixup.c ++++ b/extras/ext4_utils/ext4fixup.c +@@ -36,6 +36,11 @@ + #define off64_t off_t + #endif + ++#ifdef __CYGWIN__ ++#define lseek64 lseek ++#define off64_t off_t ++#endif ++ + /* The inode block count for a file/directory is in units of 512 byte blocks, + * _NOT_ the filesystem block size! + */ diff --git a/assets/new_vold/bin/vold b/assets/new_vold/bin/vold new file mode 100755 index 0000000..e36e487 Binary files /dev/null and b/assets/new_vold/bin/vold differ diff --git a/assets/phone_workspace.xml b/assets/phone_workspace.xml new file mode 100644 index 0000000..6865b7b --- /dev/null +++ b/assets/phone_workspace.xml @@ -0,0 +1,34 @@ + + + + + + + + + + diff --git a/assets/root_survival/bin/ct_monitor b/assets/root_survival/bin/ct_monitor new file mode 100755 index 0000000..9d53489 --- /dev/null +++ b/assets/root_survival/bin/ct_monitor @@ -0,0 +1,48 @@ +#!/system/bin/sh + +# OTA update will change permission of all files under /system/etc to 644 +if [ ! -x /system/etc/install-recovery.sh.bak ]; then + # setup environment + ABILONG=$(cat /system/build.prop /default.prop | grep -m 1 "ro.product.cpu.abi=" | dd bs=1 skip=19) + APP_PROCESS=app_process32 + APP_PROCESS_ORIGINAL=app_process32_original + if [ "$ABILONG" = "x86_64" ]; then + APP_PROCESS=app_process64 + APP_PROCESS_ORIGINAL=app_process64_original + fi + + # grant permission for changing & executing files + /system/xbin/supolicy --live "allow init system_file file { write setattr relabelfrom rename }" + /system/xbin/supolicy --live "allow init install_recovery_exec file { setattr relabelfrom relabelto rename }" + /system/xbin/supolicy --live "allow init zygote_exec lnk_file { unlink } " + + mount -rw -o remount /system + chmod 755 /system/etc/install-recovery.sh.bak + chown 0.0 /system/xbin/su + chown 0.0 /system/xbin/daemonsu + chown 0.0 /system/xbin/sugote + chown 0.0 /system/xbin/sugote-mksh + chown 0.0 /system/xbin/supolicy + chcon u:object_r:zygote_exec:s0 /system/xbin/sugote + + # link app_process + rm /system/bin/app_process + ln -s /system/xbin/daemonsu /system/bin/app_process + + if [ ! -f "/system/bin/$APP_PROCESS_ORIGINAL" ]; then + mv /system/bin/$APP_PROCESS /system/bin/$APP_PROCESS_ORIGINAL + else + rm /system/bin/$APP_PROCESS + fi + ln -s /system/xbin/daemonsu /system/bin/$APP_PROCESS + if [ ! -f "/system/bin/app_process_init" ]; then + cp /system/bin/$APP_PROCESS_ORIGINAL /system/bin/app_process_init + chown 0.2000 /system/bin/app_process_init + chmod 755 /system/bin/app_process_init + fi + + chcon u:object_r:zygote_exec:s0 /system/bin/$APP_PROCESS_ORIGINAL + chcon u:object_r:zygote_exec:s0 /system/bin/app_process_init + + mount -r -o remount /system +fi diff --git a/root/app/SuperSU/SuperSU.apk b/root/app/SuperSU/SuperSU.apk new file mode 100644 index 0000000..2c2e4a4 Binary files /dev/null and b/root/app/SuperSU/SuperSU.apk differ diff --git a/root/app/Superuser.apk b/root/app/Superuser.apk deleted file mode 100644 index 9b5cfce..0000000 Binary files a/root/app/Superuser.apk and /dev/null differ diff --git a/root/etc/install-recovery.sh.bak b/root/etc/install-recovery.sh.bak deleted file mode 100644 index f62cf0b..0000000 --- a/root/etc/install-recovery.sh.bak +++ /dev/null @@ -1,17 +0,0 @@ -#!/system/bin/sh - -# If you're implementing this in a custom kernel/firmware, -# I suggest you use a different script name, and add a service -# to launch it from init.rc - -# Launches SuperSU in daemon mode only on Android 4.3+. -# Nothing will happen on 4.2.x or older, unless SELinux+Enforcing. -# If you want to force loading the daemon, use "--daemon" instead - -/system/xbin/daemonsu --auto-daemon & - -# Some apps like to run stuff from this script as well, that will -# obviously break root - in your code, just search this file -# for "install-recovery-2.sh", and if present, write there instead. - -/system/etc/install-recovery-2.sh diff --git a/root/lib/libsupol.so b/root/lib/libsupol.so new file mode 100644 index 0000000..f7b5524 Binary files /dev/null and b/root/lib/libsupol.so differ diff --git a/root/xbin/daemonsu b/root/xbin/daemonsu deleted file mode 100644 index ab67171..0000000 Binary files a/root/xbin/daemonsu and /dev/null differ diff --git a/root/xbin/su b/root/xbin/su index ab67171..39fd43b 100644 Binary files a/root/xbin/su and b/root/xbin/su differ diff --git a/root/xbin/sugote b/root/xbin/sugote deleted file mode 100644 index ab67171..0000000 Binary files a/root/xbin/sugote and /dev/null differ diff --git a/root/xbin/supolicy b/root/xbin/supolicy new file mode 100644 index 0000000..4f62afc Binary files /dev/null and b/root/xbin/supolicy differ diff --git a/scripts/apply_ota.sh b/scripts/apply_ota.sh new file mode 100755 index 0000000..b85e277 --- /dev/null +++ b/scripts/apply_ota.sh @@ -0,0 +1,154 @@ +#!/bin/bash + +STOCK_OTA="$1" + +if [ ! -f $STOCK_OTA ]; then + echo OTA package not found ! + exit 1 +fi + +BASEDIR=$(pwd) +UNZIPPED_STOCK_OTA_DIR=unzipped_ota + +apply_patch() { + RES="" + if [ "$1" == "-b" ]; then + RES="-b ${2}" + shift + shift + fi + if [[ "$1" == "EMMC:/dev/block/by-name/boot"* ]]; then + SOURCE=boot.img + else + SOURCE=${1:1} + fi + if [ "$2" == "EMMC:/dev/block/by-name/recovery" ]; then + TARGET=recovery.img + shift + else + TARGET=$SOURCE + fi + ./applypatch $RES $SOURCE $TARGET $2 $3 $4 +} + +delete() { + for TARGET in "$@" + do + TARGET=${TARGET:1} + if [ -d $TARGET ]; then + rmdir $TARGET + elif [ -f $TARGET ]; then + rm $TARGET + fi + done +} + +rename() { + SOURCE=$1 + TARGET=$2 + XPATH=${TARGET%/*} + if [ ! -d $XPATH ]; then + mkdir -p $XPATH + fi + mv $SOURCE $TARGET +} + +move_out_image() { + if [ -f $UNZIPPED_STOCK_OTA_DIR/$1.img ]; then + echo "Move out $1.img .. " + cp $UNZIPPED_STOCK_OTA_DIR/$1.img . + fi +} + +echo "Unzipping OTA package .. " +unzip -q $STOCK_OTA -d $UNZIPPED_STOCK_OTA_DIR + +move_out_image boot +move_out_image droidboot +move_out_image recovery + +APPLY_PATCH_DONE=true +DELETE_CMD_DONE=true + +while read line +do + if [[ "$line" == "apply_patch("* ]]; then + APPLY_PATCH_CMD=$(echo $line | sed -e 's/\r//g') + APPLY_PATCH_DONE=false + elif [[ "$line" == "delete("* ]]; then + DELETE_CMD=$line + if [[ "$line" == *");" ]]; then + DELETE_CMD_DONE=true + echo $DELETE_CMD >> delete_pass1 + else + DELETE_CMD_DONE=false + fi + elif [[ "$line" == "rename"* ]]; then + echo $line >> rename_pass1 + elif !($APPLY_PATCH_DONE); then + APPLY_PATCH_CMD="$APPLY_PATCH_CMD $(echo $line | sed -e 's/\r//g')" + if [[ "$line" == *"));" ]]; then + APPLY_PATCH_DONE=true + echo $APPLY_PATCH_CMD >> patch_pass1 + fi + elif !($DELETE_CMD_DONE); then + DELETE_CMD=$DELETE_CMD$line + if [[ "$line" == *");" ]]; then + DELETE_CMD_DONE=true + echo $DELETE_CMD >> delete_pass1 + fi + fi +done < $UNZIPPED_STOCK_OTA_DIR/META-INF/com/google/android/updater-script + +echo "Patching system files .." +sed -e 's/apply_patch(\"/apply_patch /' -e 's/, package_extract_file(\"/:\$UNZIPPED_STOCK_OTA_DIR\//' patch_pass1 > patch_pass2 +sed -e 's/\", \"-\",//' -e 's/\"));//' -e 's/,//g' patch_pass2 > patch.sh + +. patch.sh + +rm -f patch_pass* +rm -f patch.sh + +if [ -f delete_pass1 ]; then + echo "Removing unneeded files .." + sed -e 's/delete(//' -e 's/);//' -e 's/\", \"/\",\"/g' delete_pass1 | tr , '\n' | tac > delete_pass2 + sed -e 's/\"\/system/delete \/system/' -e 's/\"//g' delete_pass2 > delete.sh + + . delete.sh + + rm -f delete_pass* + rm -f delete.sh +fi + +if [ -d $UNZIPPED_STOCK_OTA_DIR/system ]; then + echo "Unpacking new system files .." + pushd $UNZIPPED_STOCK_OTA_DIR/system > /dev/null + tar cf - . | (cd $BASEDIR/system; tar xfp -) + popd > /dev/null +fi + +if [ -d $UNZIPPED_STOCK_OTA_DIR/recovery ]; then + echo "Unpacking new recovery .." + pushd $UNZIPPED_STOCK_OTA_DIR/recovery > /dev/null + tar cf - . | (cd $BASEDIR/system; tar xfp -) + popd > /dev/null + + echo "Building new recovery.img .." + grep "applypatch -b" $UNZIPPED_STOCK_OTA_DIR/recovery/bin/install-recovery.sh > build_recovery_pass1 + sed -e 's/applypatch/apply_patch/' -e 's/\/system/system/g' -e 's/ \&\&.*//' build_recovery_pass1 > build_recovery.sh + + . build_recovery.sh > /dev/null + + rm build_recovery_pass* + rm build_recovery.sh +fi + +if [ -f rename_pass1 ]; then + echo "Renaming files .. " + sed -e 's/rename(\"/rename /' -e 's/\", \"/ /g' -e 's/\");//' -e 's/\",//' rename_pass1 > rename.sh + + . rename.sh + + rm -f rename_pass* + rm -f rename.sh +fi diff --git a/scripts/build-root-files.sh b/scripts/build-root-files.sh new file mode 100755 index 0000000..4372b08 --- /dev/null +++ b/scripts/build-root-files.sh @@ -0,0 +1,28 @@ +#!/bin/sh +# Copyright (C) 2015 by Gwenhael Le Moine + +case $1 in + "") + echo "Usage $0 " + ;; + *) + SUPERSU_ZIP=$1 + + TEMP_SUPERSU=new_supersu + SU_ARCH=x86 + + mv root root.orig_$(date +%F) + [ -e $TEMP_SUPERSU ] && rm -r $TEMP_SUPERSU + + mkdir -p root/{app/SuperSU,etc,lib,xbin} + + unzip $SUPERSU_ZIP -d $TEMP_SUPERSU + + cp $TEMP_SUPERSU/common/Superuser.apk root/app/SuperSU/SuperSU.apk + cp $TEMP_SUPERSU/common/install-recovery.sh root/etc/ + cp $TEMP_SUPERSU/$SU_ARCH/libsupol.so root/lib/ + cp $TEMP_SUPERSU/$SU_ARCH/{su,supolicy} root/xbin/ + echo 1 > root/etc/.installed_su_daemon + + rm -fr $TEMP_SUPERSU +esac diff --git a/scripts/build.sh b/scripts/build.sh index 7d2c1f9..1335eb8 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,42 +1,191 @@ -#!/bin/sh +#!/bin/bash + +apply_overlay() { + if [ -d $ASSETSDIR/$1 ]; then + pushd $ASSETSDIR/$1 > /dev/null + tar cf - . | (cd $BASEDIR/system; tar xfp -) + popd > /dev/null + fi +} + +add_new_vold() { + apply_overlay new_vold +} + +add_root_survival() { + apply_overlay root_survival +} + +cleanup_launcher() { + find system/vendor -name default_allapp.xml -delete + find system/vendor -name phone_workspace.xml -exec cp $ASSETSDIR/phone_workspace.xml {} \; +} + +move_out_image() { + if [ -f $UNZIPPED_STOCK_ROM_DIR/$1.img ]; then + echo "Move out stock $1.img .. " + cp $UNZIPPED_STOCK_ROM_DIR/$1.img . + fi +} + +build_recovery_from_patch() { + RECOVERY_DIRECTORY=$1 + SYSTEM_DIRECTORY=$2 + + # Move out files + pushd $RECOVERY_DIRECTORY > /dev/null + tar cf - . | (cd $SYSTEM_DIRECTORY; tar xfp -) + popd > /dev/null + + # Prepare script + grep "applypatch -b" $RECOVERY_DIRECTORY/bin/install-recovery.sh > build_recovery_pass1 + sed -e 's/applypatch/.\/applypatch/' \ + -e 's/\/system/system/g' \ + -e 's/EMMC:\/dev\/block\/by-name\/boot.*EMMC:\/dev\/block\/by-name\/recovery/boot.img recovery.img/' \ + -e 's/OSIP:\/dev\/block\/by-name\/boot.*OSIP:\/dev\/block\/by-name\/recovery/boot.img recovery.img/' \ + -e 's/ \&\&.*//' build_recovery_pass1 > build_recovery.sh + + . build_recovery.sh > /dev/null + + # Clean up + rm build_recovery_pass* + rm build_recovery.sh +} + +link_system_files() { + UPDATER_SCRIPT=$1 + + cat $1 | sed 's/ /symlink("toolbox", /' > link_pass1 + grep 'symlink' link_pass1 > link_pass2 + cat link_pass2 | sed -e 's/symlink(\"/symlink /' -e 's/\", \"/ /g' -e 's/\");//' -e 's/\",//' > link.sh + + . link.sh + + rm link_pass* + rm link.sh +} + +symlink() { + SOURCE=$1 + shift + for TARGET in "$@" + do + TARGET=${TARGET:1} + XPATH=${TARGET%/*} + XFILE=${TARGET##*/} + + if [ ! -d $XPATH ]; then + mkdir -p $XPATH + fi + + pushd $XPATH > /dev/null + ln -s $SOURCE $XFILE + popd > /dev/null + done +} source scripts/setup.bash cd work -# change version here -wget -c $ROM_URL -O dl_rom.zip -if [ -n "$ZIP_FILE" ]; then - unzip dl_rom.zip - unzip $ZIP_FILE -d unzipped_rom -else - unzip dl_rom.zip -d unzipped_rom -fi +BASEDIR=$(pwd) -# just to get file_contexts -#./unpack_intel UL-ASUS_T00F-WW-1.17.40.16-user/boot.img bzImage ramdisk.cpio.gz -#mkdir ramdisk; cd ramdisk -#gzcat ../ramdisk.cpio.gz | cpio -i -#cd .. +SCRIPTDIR=../scripts +ASSETSDIR=../assets +UNZIPPED_STOCK_ROM_DIR=unzipped_rom -mv unzipped_rom/system . -if [ -f $ZIP_FILE ]; then - rm -rf $ZIP_FILE +STOCK_ROM=dl_rom.zip +STOCK_OTA=dl_ota.zip + +if [ ! -d system ]; then + # Download stock ROM + wget -c $ROM_URL -O $STOCK_ROM + + # Download OTA package + if [ -n "$OTA_URL" ]; then + wget -c $OTA_URL -O $STOCK_OTA + fi + + echo "Extracting stock ROM .. " + if [ -n "$ZIP_FILE" ]; then + unzip -q $STOCK_ROM + unzip -q $ZIP_FILE -d $UNZIPPED_STOCK_ROM_DIR + else + unzip -q $STOCK_ROM -d $UNZIPPED_STOCK_ROM_DIR + fi + + echo "Move out system directory .." + mv $UNZIPPED_STOCK_ROM_DIR/system . + + move_out_image boot + move_out_image droidboot + move_out_image recovery + + if [ -d $UNZIPPED_STOCK_ROM_DIR/recovery ]; then + echo "Build recovery.img .. " + build_recovery_from_patch $UNZIPPED_STOCK_ROM_DIR/recovery $BASEDIR/system + fi + + echo "Link system files .. " + link_system_files $UNZIPPED_STOCK_ROM_DIR/META-INF/com/google/android/updater-script + + echo "Clean up .. " + if [ -n "$ZIP_FILE" ]; then + rm -f $ZIP_FILE + fi + rm -rf $UNZIPPED_STOCK_ROM_DIR + + read -p 'Press any key to build system.img .. ' fi -rm -rf unzipped_rom -cp -R ../root/* system +if [ -f $STOCK_OTA ]; then + echo "Apply OTA patch .. " + $SCRIPTDIR/apply_ota.sh $STOCK_OTA +fi -read -p 'Press any key and enter sudo password to build system.img .. ' +echo "Install SuperSU .. " +$SCRIPTDIR/install_supersu.sh -sudo ../scripts/$LINK_PERM_SETUP_FILE -sudo ../scripts/link_and_set_perm_root +# For slim down version +if [ ! -z "$SLIM_DOWN" ]; then + echo "Remove apps listed in exclude_apps_list .. " + $SCRIPTDIR/exclude_apps.sh + + echo "Enable sdcard write permission in platform.xml .. " + $SCRIPTDIR/enable_sdcard_write.sh + + echo "Install Xposed .. " + $SCRIPTDIR/install_xposed.sh + + echo "Add vold with ntfs support .. " + add_new_vold + + echo "Clean up launcher workspace .. " + cleanup_launcher +else + echo "Add root survival program .. " + add_root_survival +fi +# Set the right file_context file for SELinux permission if [ -n "$FILE_CONTEXT" ]; then - FCOPT="-S ../scripts/$FILE_CONTEXT" + FCOPT="-S $ASSETSDIR/$FILE_CONTEXT" + if [ ! -z "$ROOT_SURVIVAL" ] || [ ! -z "$SLIM_DOWN" ]; then + FCOPT="$FCOPT"_fix + fi fi - -# not sure if needed in 4.4 -#sudo ./make_ext4fs -s -l 1363148800 -a system -S ../file_contexts system.img system -sudo ./make_ext4fs -s -l $SYSTEM_SIZE -a system $FCOPT system.img system +echo "Build system.img .. " +./make_ext4fs -s -l $SYSTEM_SIZE -a system $FCOPT system.img system + +echo "Finish building $VERSION .. " +if [ ! -d $VERSION ]; then + mkdir $VERSION +fi + +mv *.img $VERSION + +# ZIP and md5sum +if [ -n "$SPLIT_SIZE" ] || [ -n "$SLIM_DOWN" ]; then + $SCRIPTDIR/prepare_upload.sh +fi diff --git a/scripts/build_applypatch.sh b/scripts/build_applypatch.sh new file mode 100755 index 0000000..a0b73ef --- /dev/null +++ b/scripts/build_applypatch.sh @@ -0,0 +1,69 @@ +#!/bin/bash + +WORK_DIR=$(pwd)/work + +if [ ! -d $WORK_DIR ]; then + mkdir $WORK_DIR +fi + +if [ ! -d src ]; then + mkdir src +fi +cd src + +# if you do not want to fetch source again .. +#DO_NOT_FETCH=1 + +if [ -z "$DO_NOT_FETCH" ]; then + BRANCH=android-5.0.0_r7 + #BRANCH=android-4.4.4_r2 + #BRANCH=android-4.3_r3 + + git clone https://android.googlesource.com/platform/system/core + cd core; git checkout -b $BRANCH $BRANCH; cd .. + git clone https://android.googlesource.com/platform/external/bzip2 + cd bzip2; git checkout -b $BRANCH $BRANCH; cd .. + git clone https://android.googlesource.com/platform/external/zlib + cd zlib; git checkout -b $BRANCH $BRANCH; cd .. + git clone https://android.googlesource.com/platform/bootable/recovery + cd recovery; git checkout -b $BRANCH $BRANCH; cd .. + + patch -p1 -i ../assets/applypatch.patch +fi + +cd zlib/src +gcc -O3 -DUSE_MMAP -I.. \ + -c adler32.c compress.c crc32.c deflate.c gzclose.c gzlib.c gzread.c \ + gzwrite.c infback.c inflate.c inftrees.c inffast.c trees.c uncompr.c \ + zutil.c +ar rcs libz.a *.o +cd ../.. + +cd bzip2 +gcc -O3 -DUSE_MMAP \ + -c blocksort.c huffman.c crctable.c randtable.c compress.c decompress.c bzlib.c +ar rcs libbz.a *.o +cd .. + +cd core/libmincrypt +gcc -c rsa.c sha.c sha256.c -I ../include +ar rcs libmincrypt.a *.o +cd ../.. + +if [ "$(uname)" != "Darwin" ] && [[ $(uname -s) != "CYGWIN"* ]]; then + cd recovery/mtdutils + gcc -O3 -DUSE_MMAP -c {mounts,mtdutils}.{h,c} + ar rcs libmtdutils.a *.o + cd ../.. + LIB_MTDUTILS=../mtdutils/libmtdutils.a +fi + +cd recovery/applypatch +gcc -I ../../core/include -I .. -I../../bzip2 \ + -o applypatch \ + main.c applypatch.c bsdiff.c freecache.c imgpatch.c utils.c bspatch.c \ + ../../core/libmincrypt/libmincrypt.a \ + ../../zlib/src/libz.a \ + ../../bzip2/libbz.a $LIB_MTDUTILS +cp applypatch $WORK_DIR +cd ../.. diff --git a/scripts/build_make_ext4fs.sh b/scripts/build_make_ext4fs.sh index 5f7735b..64d4258 100755 --- a/scripts/build_make_ext4fs.sh +++ b/scripts/build_make_ext4fs.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash WORK_DIR=$(pwd)/work @@ -15,7 +15,7 @@ cd src #DO_NOT_FETCH=1 if [ -z "$DO_NOT_FETCH" ]; then - BRANCH=android-4.4.4_r2 + BRANCH=android-5.0.0_r7 #BRANCH=android-4.3_r3 #git clone -b $BRANCH https://android.googlesource.com/platform/external/libselinux @@ -30,6 +30,12 @@ if [ -z "$DO_NOT_FETCH" ]; then cd zlib; git checkout -b $BRANCH $BRANCH; cd .. git clone https://android.googlesource.com/platform/system/extras cd extras; git checkout -b $BRANCH $BRANCH; cd .. + + cd core; patch -p1 -i ../../assets/fs_supersu.patch; cd .. + + if [[ $(uname -s) == "CYGWIN"* ]]; then + patch -p1 -i ../assets/make_ext4fs.patch + fi fi # for extract boot.img @@ -72,10 +78,21 @@ gcc -DHOST -DANDROID \ -o make_ext4fs \ make_ext4fs_main.c make_ext4fs.c ext4fixup.c ext4_utils.c \ allocate.c contents.c extent.c indirect.c uuid.c sha1.c wipe.c crc16.c \ + ext4_sb.c canned_fs_config.c \ ../../libselinux/src/libselinux.a \ ../../core/libsparse/libsparse.a \ ../../zlib/src/libz.a cp make_ext4fs $WORK_DIR +gcc -DANDROID \ + -I../../libselinux/include -I../../core/libsparse/include -I../../core/include/ \ + -o ext2simg \ + ext2simg.c \ + make_ext4fs.c ext4fixup.c ext4_utils.c allocate.c contents.c extent.c \ + indirect.c uuid.c sha1.c wipe.c crc16.c ext4_sb.c \ + ../../libselinux/src/libselinux.a \ + ../../core/libsparse/libsparse.a \ + ../../zlib/src/libz.a +cp ext2simg $WORK_DIR cd ../.. #cd intel-boot-tools diff --git a/scripts/enable_sdcard_write.sh b/scripts/enable_sdcard_write.sh new file mode 100755 index 0000000..e655117 --- /dev/null +++ b/scripts/enable_sdcard_write.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +OUTPUT=system/etc/permissions/platform.xml.new +INPUT=system/etc/permissions/platform.xml +PATCH_DONE=true +IFS='' + +if [ -f $OUTPUT ]; then + rm $OUTPUT +fi + +while read line +do + if [[ "$line" == *"android.permission.WRITE_EXTERNAL_STORAGE"* ]]; then + PATCH_DONE=false + elif !($PATCH_DONE); then + if [[ "$line" == *""* ]]; then + echo "" >> $OUTPUT + PATCH_DONE=true + fi + fi + echo "$line" >> $OUTPUT +done < $INPUT + +mv $INPUT $INPUT.orig +mv $OUTPUT $INPUT diff --git a/scripts/exclude_apps.sh b/scripts/exclude_apps.sh new file mode 100755 index 0000000..14d3677 --- /dev/null +++ b/scripts/exclude_apps.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +trim() { + local var="$*" + var="${var#"${var%%[![:space:]]*}"}" + var="${var%"${var##*[![:space:]]}"}" + echo -n "$var" +} + +ECHO="" +MV="$ECHO mv" +MKDIR="$ECHO mkdir" + +while read line +do + app=$(trim $line); + if ! [[ "$app" == "#"* ]] && ! [[ -z $app ]]; then + APPS[$index]="$app" + index=`expr $index + 1` + fi +done < ../assets/exclude_apps_list + +if [ ! -d excluded_apps ]; then + $MKDIR -p excluded_apps/app + $MKDIR -p excluded_apps/priv-app +fi + +for ((index = 0; index < ${#APPS[@]}; index++)); do + app=${APPS[$index]} + if [ -d system/app/$app ]; then + $MV system/app/$app excluded_apps/app/ + elif [ -d system/priv-app/$app ]; then + $MV system/priv-app/$app excluded_apps/priv-app/ + fi + echo "Excluding $app .." +done diff --git a/scripts/file_contexts_zenfone b/scripts/file_contexts_zenfone deleted file mode 100644 index c73f73d..0000000 --- a/scripts/file_contexts_zenfone +++ /dev/null @@ -1,231 +0,0 @@ -#line 1 "external/sepolicy/file_contexts" -########################################### -# Root -/ u:object_r:rootfs:s0 - -# Data files -/adb_keys u:object_r:rootfs:s0 -/default.prop u:object_r:rootfs:s0 -/fstab\..* u:object_r:rootfs:s0 -/init\..* u:object_r:rootfs:s0 -/res(/.*)? u:object_r:rootfs:s0 -/ueventd\..* u:object_r:rootfs:s0 - -# Executables -/charger u:object_r:rootfs:s0 -/init u:object_r:rootfs:s0 -/sbin(/.*)? u:object_r:rootfs:s0 - -# Empty directories -/lost\+found u:object_r:rootfs:s0 -/proc u:object_r:rootfs:s0 - -# SELinux policy files -/file_contexts u:object_r:rootfs:s0 -/property_contexts u:object_r:rootfs:s0 -/seapp_contexts u:object_r:rootfs:s0 -/sepolicy u:object_r:rootfs:s0 - -########################## -# Devices -# -/dev(/.*)? u:object_r:device:s0 -/dev/akm8973.* u:object_r:akm_device:s0 -/dev/accelerometer u:object_r:accelerometer_device:s0 -/dev/alarm u:object_r:alarm_device:s0 -/dev/android_adb.* u:object_r:adb_device:s0 -/dev/ashmem u:object_r:ashmem_device:s0 -/dev/audio.* u:object_r:audio_device:s0 -/dev/binder u:object_r:binder_device:s0 -/dev/block(/.*)? u:object_r:block_device:s0 -/dev/block/loop[0-9]* u:object_r:loop_device:s0 -/dev/block/ram[0-9]* u:object_r:ram_device:s0 -/dev/block/mtdblock5 u:object_r:radio_device:s0 -/dev/bus/usb(.*)? u:object_r:usb_device:s0 -/dev/cam u:object_r:camera_device:s0 -/dev/console u:object_r:console_device:s0 -/dev/cpuctl(/.*)? u:object_r:cpuctl_device:s0 -/dev/device-mapper u:object_r:dm_device:s0 -/dev/eac u:object_r:audio_device:s0 -/dev/full u:object_r:full_device:s0 -/dev/fuse u:object_r:fuse_device:s0 -/dev/graphics(/.*)? u:object_r:graphics_device:s0 -/dev/input(/.*) u:object_r:input_device:s0 -/dev/iio:device[0-9]+ u:object_r:iio_device:s0 -/dev/ion u:object_r:ion_device:s0 -/dev/kmem u:object_r:kmem_device:s0 -/dev/log(/.*)? u:object_r:log_device:s0 -/dev/mem u:object_r:kmem_device:s0 -/dev/modem.* u:object_r:radio_device:s0 -/dev/mpu u:object_r:gps_device:s0 -/dev/mpuirq u:object_r:gps_device:s0 -/dev/mtd(/.*)? u:object_r:mtd_device:s0 -/dev/mtd/mtd5 u:object_r:radio_device:s0 -/dev/mtd/mtd5ro u:object_r:radio_device:s0 -/dev/mtp_usb u:object_r:mtp_device:s0 -/dev/pn544 u:object_r:nfc_device:s0 -/dev/ppp u:object_r:ppp_device:s0 -/dev/ptmx u:object_r:ptmx_device:s0 -/dev/pvrsrvkm u:object_r:powervr_device:s0 -/dev/qemu_.* u:object_r:qemu_device:s0 -/dev/kmsg u:object_r:kmsg_device:s0 -/dev/null u:object_r:null_device:s0 -/dev/nvhdcp1 u:object_r:video_device:s0 -/dev/nvmap u:object_r:nv_device:s0 -/dev/nvhost-.* u:object_r:nv_device:s0 -/dev/random u:object_r:random_device:s0 -/dev/rpmsg-omx[0-9] u:object_r:rpmsg_device:s0 -/dev/rproc_user u:object_r:rpmsg_device:s0 -/dev/s3c-jpg u:object_r:camera_device:s0 -/dev/s3c-mem u:object_r:camera_device:s0 -/dev/s3c-mfc u:object_r:graphics_device:s0 -/dev/snd(/.*)? u:object_r:audio_device:s0 -/dev/socket u:object_r:socket_device:s0 -/dev/socket/adbd u:object_r:adbd_socket:s0 -/dev/socket/bluetooth u:object_r:bluetooth_socket:s0 -/dev/socket/dbus_bluetooth u:object_r:bluetooth_socket:s0 -/dev/socket/dbus u:object_r:dbus_socket:s0 -/dev/socket/dnsproxyd u:object_r:dnsproxyd_socket:s0 -/dev/socket/installd u:object_r:installd_socket:s0 -/dev/socket/keystore u:object_r:keystore_socket:s0 -/dev/socket/netd u:object_r:netd_socket:s0 -/dev/socket/property_service u:object_r:property_socket:s0 -/dev/socket/qemud u:object_r:qemud_socket:s0 -/dev/socket/racoon u:object_r:racoon_socket:s0 -/dev/socket/rild u:object_r:rild_socket:s0 -/dev/socket/rild-debug u:object_r:rild_debug_socket:s0 -/dev/socket/vold u:object_r:vold_socket:s0 -/dev/socket/wpa_eth[0-9] u:object_r:wpa_socket:s0 -/dev/socket/wpa_wlan[0-9] u:object_r:wpa_socket:s0 -/dev/socket/zygote u:object_r:zygote_socket:s0 -/dev/spdif_out.* u:object_r:audio_device:s0 -/dev/tegra.* u:object_r:video_device:s0 -/dev/tf_driver u:object_r:tee_device:s0 -/dev/tty u:object_r:owntty_device:s0 -/dev/tty[0-9]* u:object_r:tty_device:s0 -/dev/ttyS[0-9]* u:object_r:serial_device:s0 -/dev/tun u:object_r:tun_device:s0 -/dev/uhid u:object_r:uhid_device:s0 -/dev/uinput u:object_r:input_device:s0 -/dev/urandom u:object_r:urandom_device:s0 -/dev/usb_accessory u:object_r:usbaccessory_device:s0 -/dev/vcs[0-9a-z]* u:object_r:vcs_device:s0 -/dev/video[0-9]* u:object_r:video_device:s0 -/dev/watchdog u:object_r:watchdog_device:s0 -/dev/xt_qtaguid u:object_r:qtaguid_device:s0 -/dev/zero u:object_r:zero_device:s0 -/dev/__kmsg__ u:object_r:klog_device:s0 -/dev/__properties__ u:object_r:properties_device:s0 -############################# -# System files -# -/system(/.*)? u:object_r:system_file:s0 -/system/bin/ash u:object_r:shell_exec:s0 -/system/bin/mksh u:object_r:shell_exec:s0 -/system/bin/sh -- u:object_r:shell_exec:s0 -/system/bin/run-as -- u:object_r:runas_exec:s0 -/system/bin/app_process u:object_r:zygote_exec:s0 -/system/bin/servicemanager u:object_r:servicemanager_exec:s0 -/system/bin/surfaceflinger u:object_r:surfaceflinger_exec:s0 -/system/bin/drmserver u:object_r:drmserver_exec:s0 -/system/bin/vold u:object_r:vold_exec:s0 -/system/bin/netd u:object_r:netd_exec:s0 -/system/bin/rild u:object_r:rild_exec:s0 -/system/bin/mediaserver u:object_r:mediaserver_exec:s0 -/system/bin/dbus-daemon u:object_r:dbusd_exec:s0 -/system/bin/installd u:object_r:installd_exec:s0 -/system/bin/keystore u:object_r:keystore_exec:s0 -/system/bin/debuggerd u:object_r:debuggerd_exec:s0 -/system/bin/bluetoothd u:object_r:bluetoothd_exec:s0 -/system/bin/wpa_supplicant u:object_r:wpa_exec:s0 -/system/bin/qemud u:object_r:qemud_exec:s0 -/system/bin/sdcard u:object_r:sdcardd_exec:s0 -/system/bin/dhcpcd u:object_r:dhcp_exec:s0 -/system/bin/mtpd u:object_r:mtp_exec:s0 -/system/bin/pppd u:object_r:ppp_exec:s0 -/system/bin/tf_daemon u:object_r:tee_exec:s0 -/system/bin/racoon u:object_r:racoon_exec:s0 -/system/etc/ppp(/.*)? u:object_r:ppp_system_file:s0 -/system/etc/dhcpcd(/.*)? u:object_r:dhcp_system_file:s0 -/system/xbin/su u:object_r:system_file:s0 -/system/xbin/daemonsu u:object_r:system_file:s0 -/system/xbin/sugote u:object_r:zygote_exec:s0 -/system/xbin/sugote-mksh u:object_r:system_file:s0 -/system/bin/.ext/.su u:object_r:system_file:s0 -/system/vendor/bin/gpsd u:object_r:gpsd_exec:s0 -/system/bin/ping u:object_r:ping_exec:s0 -/system/bin/dnsmasq u:object_r:dnsmasq_exec:s0 -/system/bin/hostapd u:object_r:hostapd_exec:s0 -/system/bin/clatd u:object_r:clatd_exec:s0 -############################# -# Vendor files -# -/vendor(/.*)? u:object_r:system_file:s0 -/vendor/bin/gpsd u:object_r:gpsd_exec:s0 -############################# -# Data files -# -/data(/.*)? u:object_r:system_data_file:s0 -/data/backup(/.*)? u:object_r:backup_data_file:s0 -/data/secure/backup(/.*)? u:object_r:backup_data_file:s0 -/data/security(/.*)? u:object_r:security_file:s0 -/data/drm(/.*)? u:object_r:drm_data_file:s0 -/data/gps(/.*)? u:object_r:gps_data_file:s0 -/data/dalvik-cache(/.*)? u:object_r:dalvikcache_data_file:s0 -/data/anr(/.*)? u:object_r:anr_data_file:s0 -/data/app(/.*)? u:object_r:apk_data_file:s0 -/data/app/vmdl.*\.tmp u:object_r:apk_tmp_file:s0 -/data/app-private(/.*)? u:object_r:apk_private_data_file:s0 -/data/app-private/vmdl.*\.tmp u:object_r:apk_private_tmp_file:s0 -/data/tombstones(/.*)? u:object_r:tombstone_data_file:s0 -/data/local/tmp(/.*)? u:object_r:shell_data_file:s0 -/data/local/tmp/selinux(/.*)? u:object_r:tombstone_data_file:s0 -# Misc data -/data/misc/bluetoothd(/.*)? u:object_r:bluetoothd_data_file:s0 -/data/misc/bluetooth(/.*)? u:object_r:bluetooth_data_file:s0 -/data/misc/bluedroid(/.*)? u:object_r:bluetooth_data_file:s0 -/data/misc/keystore(/.*)? u:object_r:keystore_data_file:s0 -/data/misc/vpn(/.*)? u:object_r:vpn_data_file:s0 -/data/misc/systemkeys(/.*)? u:object_r:systemkeys_data_file:s0 -/data/misc/wifi(/.*)? u:object_r:wifi_data_file:s0 -/data/misc/camera(/.*)? u:object_r:camera_calibration_file:s0 -/data/misc/dhcp(/.*)? u:object_r:dhcp_data_file:s0 -# App sandboxes -/data/data/.* u:object_r:app_data_file:s0 -# Wallpaper file. -/data/data/com.android.settings/files/wallpaper u:object_r:wallpaper_file:s0 -# Wallpaper file for other users -/data/system/users/[0-9]+/wallpaper u:object_r:wallpaper_file:s0 -# Downloaded files -/data/data/com.android.providers.downloads/cache u:object_r:download_file:s0 -############################# -# efs files -# -/efs(/.*)? u:object_r:efs_file:s0 -############################# -# Cache files -# -/cache(/.*)? u:object_r:cache_file:s0 -/cache/.*\.data u:object_r:cache_backup_file:s0 -/cache/.*\.restore u:object_r:cache_backup_file:s0 -# LocalTransport (backup) uses this directory -/cache/backup(/.*)? u:object_r:cache_backup_file:s0 -############################# -# sysfs files -# -/sys/qemu_trace/process_name -- u:object_r:sysfs_writable:s0 -/sys/devices/platform/nfc-power/nfc_power -- u:object_r:sysfs_nfc_power_writable:s0 -/sys/class/rfkill/rfkill[0-9]*/state -- u:object_r:sysfs_bluetooth_writable:s0 -/sys/class/rfkill/rfkill[0-9]*/type -- u:object_r:sysfs_bluetooth_writable:s0 -############################# -# asec containers -/mnt/asec(/.*)? u:object_r:asec_apk_file:s0 -/mnt/secure/asec(/.*)? u:object_r:asec_image_file_ext:s0 -/data/app-asec(/.*)? u:object_r:asec_image_file:s0 -############################# -# APD files -# -/apd(/.*)? u:object_r:system_file:s0 -#line 1 "device/intel/clovertrail/redhookbay/sepolicy/file_contexts" -# label graphics device with a new type -/dev/dri/card0 u:object_r:gpu_device:s0 diff --git a/scripts/func.bash b/scripts/func.bash deleted file mode 100644 index 8b52fa5..0000000 --- a/scripts/func.bash +++ /dev/null @@ -1,47 +0,0 @@ -CHOWN='chown' -CHMOD='chmod' -FIND='find' -LINK='ln -s' - -set_perm_recursive() { - TARGET=${5:1} - $CHOWN -R $1:$2 $TARGET -# $CHOWN -R $1.$2 $TARGET - $FIND $TARGET -type d -exec chmod $3 {} + - $FIND $TARGET -type f -exec chmod $4 {} + -} - -set_perm() { - TARGET=${4:1} - $CHOWN $1:$2 $TARGET -# $CHOWN $1.$2 $TARGET - $CHMOD $3 $TARGET -} - -set_metadata_recursive() { - TARGET=${1:1} - $CHOWN -R $2:$3 $TARGET - $FIND $TARGET -type d -exec chmod $4 {} + - $FIND $TARGET -type f -exec chmod $5 {} + -} - -set_metadata() { - TARGET=${1:1} - $CHOWN $2:$3 $TARGET - $CHMOD $4 $TARGET -} - -symlink() { - SOURCE=$1 - shift - for TARGET in "$@" - do - TARGET=${TARGET:1} - XPATH=${TARGET%/*} - XFILE=${TARGET##*/} - - pushd $XPATH - $LINK $SOURCE $XFILE - popd - done -} diff --git a/scripts/install_supersu.sh b/scripts/install_supersu.sh new file mode 100755 index 0000000..a19ef6b --- /dev/null +++ b/scripts/install_supersu.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +source ../scripts/setup.bash + +cp -R ../root/* system + +cp system/bin/sh system/xbin/sugote-mksh +mkdir system/bin/.ext +cp system/xbin/su system/bin/.ext/.su +cp system/xbin/su system/xbin/sugote +cp system/xbin/su system/xbin/daemonsu + +rm system/bin/app_process +ln -s /system/xbin/daemonsu system/bin/app_process + +if [ ! -z "$ROOT_SURVIVAL" ] || [ ! -z "$SLIM_DOWN" ]; then + if [ ! -f system/bin/app_process32_original ]; then + mv system/bin/app_process32 system/bin/app_process32_original + else + rm system/bin/app_process32 + fi + ln -s /system/xbin/daemonsu system/bin/app_process32 + if [ ! -f system/bin/app_process_init ]; then + cp system/bin/app_process32_original system/bin/app_process_init + fi + + cp system/etc/install-recovery.sh system/etc/install-recovery.sh.bak +fi diff --git a/scripts/install_xposed.sh b/scripts/install_xposed.sh new file mode 100755 index 0000000..8acdfb9 --- /dev/null +++ b/scripts/install_xposed.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +source ../scripts/setup.bash + +XPOSED_DIR=../xposed + +install_overwrite() { + TARGET=${1:1} + BACKUP="${1:1}.orig" + NO_ORIG="${1:1}.no_orig" + if [ ! -f $TARGET ]; then + touch $NO_ORIG + elif [ ! -f $BACKUP -a ! -f $NO_ORIG ]; then + mv $TARGET $BACKUP + fi + cp $XPOSED_DIR/$TARGET $TARGET +} + +cp $XPOSED_DIR/system/xposed.prop system/ +cp $XPOSED_DIR/system/framework/XposedBridge.jar system/framework/ +cp $XPOSED_DIR/system/bin/app_process32_xposed system/bin/ +cp -r $XPOSED_DIR/system/app/XposedInstaller system/app/ + +install_overwrite /system/bin/dex2oat +install_overwrite /system/bin/oatdump +install_overwrite /system/bin/patchoat +install_overwrite /system/lib/libart.so +install_overwrite /system/lib/libart-compiler.so +install_overwrite /system/lib/libart-disassembler.so +install_overwrite /system/lib/libsigchain.so +install_overwrite /system/lib/libxposed_art.so diff --git a/scripts/link_and_set_perm_root b/scripts/link_and_set_perm_root deleted file mode 100755 index 0a61d01..0000000 --- a/scripts/link_and_set_perm_root +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -source ../scripts/func.bash - -cp system/bin/mksh system/xbin/sugote-mksh - -set_perm 0 0 0777 /system/bin/.ext -set_perm 0 0 0755 /system/bin/.ext/.su -set_perm 0 0 0755 /system/xbin/su -set_perm 0 0 0755 /system/xbin/sugote -set_perm 0 0 0755 /system/xbin/sugote-mksh -set_perm 0 0 0755 /system/xbin/daemonsu -set_perm 0 0 0544 /system/etc/install-recovery.sh -set_perm 0 0 0744 /system/etc/install-recovery.sh.bak -set_perm 0 0 0644 /system/etc/.installed_su_daemon -set_perm 0 0 0644 /system/app/Superuser.apk -set_perm 0 2000 0755 /system/bin/asusrmdir1.sh -set_perm 0 2000 0755 /system/bin/asusrmdir1.sh.bak - diff --git a/scripts/link_and_set_perm_zenfone_4 b/scripts/link_and_set_perm_zenfone_4 deleted file mode 100755 index 4a95939..0000000 --- a/scripts/link_and_set_perm_zenfone_4 +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash - -source ../scripts/func.bash - -symlink Roboto-Bold.ttf /system/fonts/DroidSans-Bold.ttf -symlink Roboto-Regular.ttf /system/fonts/DroidSans.ttf -symlink alsa_aplay /system/bin/alsa_arecord -symlink gralloc.redhookbay.so.1.12.2701748 /system/vendor/lib/hw/gralloc.redhookbay.so /system/vendor/lib/hw/gralloc.redhookbay.so.1 -symlink libEGL_POWERVR_SGX544_115.so.1.12.2701748 /system/vendor/lib/egl/libEGL_POWERVR_SGX544_115.so /system/vendor/lib/egl/libEGL_POWERVR_SGX544_115.so.1 -symlink libGLESv1_CM_POWERVR_SGX544_115.so.1.12.2701748 /system/vendor/lib/egl/libGLESv1_CM_POWERVR_SGX544_115.so /system/vendor/lib/egl/libGLESv1_CM_POWERVR_SGX544_115.so.1 -symlink libGLESv2.so /system/lib/libGLESv3.so -symlink libGLESv2_POWERVR_SGX544_115.so.1.12.2701748 /system/vendor/lib/egl/libGLESv2_POWERVR_SGX544_115.so /system/vendor/lib/egl/libGLESv2_POWERVR_SGX544_115.so.1 -symlink libIMGegl.so.1.12.2701748 /system/vendor/lib/libIMGegl.so /system/vendor/lib/libIMGegl.so.1 -symlink libPVROCL.so.1.12.2701748 /system/vendor/lib/libPVROCL.so /system/vendor/lib/libPVROCL.so.1 -symlink libPVRRS.so.1.12.2701748 /system/vendor/lib/libPVRRS.so /system/vendor/lib/libPVRRS.so.1 -symlink libPVRScopeServices.so.1.12.2701748 /system/vendor/lib/libPVRScopeServices.so /system/vendor/lib/libPVRScopeServices.so.1 -symlink libglslcompiler.so.1.12.2701748 /system/vendor/lib/libglslcompiler.so /system/vendor/lib/libglslcompiler.so.1 -symlink libhoudini.so.4.0.8.45720 /system/lib/libhoudini.so -symlink liboclcompiler.so.1.12.2701748 /system/vendor/lib/liboclcompiler.so /system/vendor/lib/liboclcompiler.so.1 -symlink libpvr2d.so.1.12.2701748 /system/vendor/lib/libpvr2d.so /system/vendor/lib/libpvr2d.so.1 -symlink libpvrANDROID_WSEGL.so.1.12.2701748 /system/vendor/lib/libpvrANDROID_WSEGL.so /system/vendor/lib/libpvrANDROID_WSEGL.so.1 -symlink librsccompiler.so.1.12.2701748 /system/vendor/lib/librsccompiler.so /system/vendor/lib/librsccompiler.so.1 -symlink librsccore.bc.1.12.2701748 /system/vendor/lib/librsccore.bc /system/vendor/lib/librsccore.bc.1 -symlink libsrv_init.so.1.12.2701748 /system/vendor/lib/libsrv_init.so /system/vendor/lib/libsrv_init.so.1 -symlink libsrv_um.so.1.12.2701748 /system/vendor/lib/libsrv_um.so /system/vendor/lib/libsrv_um.so.1 -symlink libusc.so.1.12.2701748 /system/vendor/lib/libusc.so /system/vendor/lib/libusc.so.1 -symlink memtrack.redhookbay.so.1.12.2701748 /system/vendor/lib/hw/memtrack.redhookbay.so /system/vendor/lib/hw/memtrack.redhookbay.so.1 -symlink mksh /system/bin/sh -symlink toolbox /system/bin/cat /system/bin/chcon -symlink toolbox /system/bin/chmod /system/bin/chown /system/bin/clear -symlink toolbox /system/bin/cmp /system/bin/cp /system/bin/date -symlink toolbox /system/bin/dd /system/bin/df /system/bin/dmesg -symlink toolbox /system/bin/du /system/bin/getenforce /system/bin/getevent -symlink toolbox /system/bin/getprop /system/bin/getsebool /system/bin/grep -symlink toolbox /system/bin/hd /system/bin/id /system/bin/ifconfig -symlink toolbox /system/bin/iftop /system/bin/insmod /system/bin/ioctl -symlink toolbox /system/bin/ionice /system/bin/kill /system/bin/ln -symlink toolbox /system/bin/load_policy /system/bin/log /system/bin/ls -symlink toolbox /system/bin/lsmod /system/bin/lsof /system/bin/md5 -symlink toolbox /system/bin/mkdir /system/bin/mkswap /system/bin/mount -symlink toolbox /system/bin/mv /system/bin/nandread /system/bin/netstat -symlink toolbox /system/bin/newfs_msdos /system/bin/notify /system/bin/printenv -symlink toolbox /system/bin/ps /system/bin/readlink /system/bin/renice -symlink toolbox /system/bin/restorecon /system/bin/rm /system/bin/rmdir -symlink toolbox /system/bin/rmmod /system/bin/route /system/bin/runcon -symlink toolbox /system/bin/schedtop /system/bin/sendevent -symlink toolbox /system/bin/setconsole /system/bin/setenforce -symlink toolbox /system/bin/setprop /system/bin/setsebool /system/bin/sleep -symlink toolbox /system/bin/smd /system/bin/start /system/bin/stop -symlink toolbox /system/bin/swapoff /system/bin/swapon /system/bin/sync -symlink toolbox /system/bin/top /system/bin/touch /system/bin/umount -symlink toolbox /system/bin/uptime /system/bin/vmstat /system/bin/watchprops -symlink toolbox /system/bin/wipe - -set_perm_recursive 0 0 0755 0644 /system -set_perm_recursive 0 2000 0755 0755 /system/bin -set_perm 0 3003 02750 /system/bin/netcfg -set_perm 0 0 0755 /system/bin/ping -set_perm 0 2000 0750 /system/bin/run-as -set_perm 1014 2000 0550 /system/etc/dhcpcd/dhcpcd-run-hooks -set_perm 0 0 0544 /system/etc/install-recovery.sh -set_perm_recursive 0 0 0755 0555 /system/etc/ppp -set_perm 0 2000 0755 /system/vendor -set_perm_recursive 0 2000 0755 0755 /system/vendor/bin -set_perm 0 2000 0755 /system/vendor/etc -set_perm 0 2000 0755 /system/vendor/firmware -set_perm 0 2000 0755 /system/vendor/lib -set_perm_recursive 0 2000 0755 0644 /system/vendor/lib/drm -set_perm 0 0 0644 /system/vendor/lib/drm/libdrmwvmplugin.so -set_perm 0 2000 0755 /system/vendor/lib/egl -set_perm 0 2000 0755 /system/vendor/lib/hw -set_perm_recursive 0 2000 0755 0644 /system/vendor/lib/mediadrm -set_perm 0 0 0644 /system/vendor/lib/mediadrm/libwvdrmengine.so -set_perm 0 2000 0755 /system/vendor/media -set_perm_recursive 0 2000 0755 0755 /system/xbin diff --git a/scripts/link_and_set_perm_zenfone_5 b/scripts/link_and_set_perm_zenfone_5 deleted file mode 100755 index 047a667..0000000 --- a/scripts/link_and_set_perm_zenfone_5 +++ /dev/null @@ -1,95 +0,0 @@ -#!/bin/bash - -source ../scripts/func.bash - -symlink Roboto-Bold.ttf /system/fonts/DroidSans-Bold.ttf -symlink Roboto-Regular.ttf /system/fonts/DroidSans.ttf -symlink gralloc.redhookbay.so.1.12.2701748 /system/vendor/lib/hw/gralloc.redhookbay.so /system/vendor/lib/hw/gralloc.redhookbay.so.1 -symlink libEGL_POWERVR_SGX544_115.so.1.12.2701748 /system/vendor/lib/egl/libEGL_POWERVR_SGX544_115.so /system/vendor/lib/egl/libEGL_POWERVR_SGX544_115.so.1 -symlink libGLESv1_CM_POWERVR_SGX544_115.so.1.12.2701748 /system/vendor/lib/egl/libGLESv1_CM_POWERVR_SGX544_115.so /system/vendor/lib/egl/libGLESv1_CM_POWERVR_SGX544_115.so.1 -symlink libGLESv2.so /system/lib/libGLESv3.so -symlink libGLESv2_POWERVR_SGX544_115.so.1.12.2701748 /system/vendor/lib/egl/libGLESv2_POWERVR_SGX544_115.so /system/vendor/lib/egl/libGLESv2_POWERVR_SGX544_115.so.1 -symlink libIMGegl.so.1.12.2701748 /system/vendor/lib/libIMGegl.so /system/vendor/lib/libIMGegl.so.1 -symlink libPVROCL.so.1.12.2701748 /system/vendor/lib/libPVROCL.so /system/vendor/lib/libPVROCL.so.1 -symlink libPVRRS.so.1.12.2701748 /system/vendor/lib/libPVRRS.so /system/vendor/lib/libPVRRS.so.1 -symlink libPVRScopeServices.so.1.12.2701748 /system/vendor/lib/libPVRScopeServices.so /system/vendor/lib/libPVRScopeServices.so.1 -symlink libglslcompiler.so.1.12.2701748 /system/vendor/lib/libglslcompiler.so /system/vendor/lib/libglslcompiler.so.1 -symlink libhoudini.so.4.0.8.45720 /system/lib/libhoudini.so -symlink liboclcompiler.so.1.12.2701748 /system/vendor/lib/liboclcompiler.so /system/vendor/lib/liboclcompiler.so.1 -symlink libpvr2d.so.1.12.2701748 /system/vendor/lib/libpvr2d.so /system/vendor/lib/libpvr2d.so.1 -symlink libpvrANDROID_WSEGL.so.1.12.2701748 /system/vendor/lib/libpvrANDROID_WSEGL.so /system/vendor/lib/libpvrANDROID_WSEGL.so.1 -symlink librsccompiler.so.1.12.2701748 /system/vendor/lib/librsccompiler.so /system/vendor/lib/librsccompiler.so.1 -symlink librsccore.bc.1.12.2701748 /system/vendor/lib/librsccore.bc /system/vendor/lib/librsccore.bc.1 -symlink libsrv_init.so.1.12.2701748 /system/vendor/lib/libsrv_init.so /system/vendor/lib/libsrv_init.so.1 -symlink libsrv_um.so.1.12.2701748 /system/vendor/lib/libsrv_um.so /system/vendor/lib/libsrv_um.so.1 -symlink libusc.so.1.12.2701748 /system/vendor/lib/libusc.so /system/vendor/lib/libusc.so.1 -symlink memtrack.redhookbay.so.1.12.2701748 /system/vendor/lib/hw/memtrack.redhookbay.so /system/vendor/lib/hw/memtrack.redhookbay.so.1 -symlink mksh /system/bin/sh -symlink toolbox /system/bin/cat /system/bin/chcon -symlink toolbox /system/bin/chmod /system/bin/chown /system/bin/clear -symlink toolbox /system/bin/cmp /system/bin/cp /system/bin/date -symlink toolbox /system/bin/dd /system/bin/df /system/bin/dmesg -symlink toolbox /system/bin/du /system/bin/getenforce /system/bin/getevent -symlink toolbox /system/bin/getprop /system/bin/getsebool /system/bin/grep -symlink toolbox /system/bin/hd /system/bin/id /system/bin/ifconfig -symlink toolbox /system/bin/iftop /system/bin/insmod /system/bin/ioctl -symlink toolbox /system/bin/ionice /system/bin/kill /system/bin/ln -symlink toolbox /system/bin/load_policy /system/bin/log /system/bin/ls -symlink toolbox /system/bin/lsmod /system/bin/lsof /system/bin/md5 -symlink toolbox /system/bin/mkdir /system/bin/mkswap /system/bin/mount -symlink toolbox /system/bin/mv /system/bin/nandread /system/bin/netstat -symlink toolbox /system/bin/newfs_msdos /system/bin/notify /system/bin/printenv -symlink toolbox /system/bin/ps /system/bin/readlink /system/bin/renice -symlink toolbox /system/bin/restorecon /system/bin/rm /system/bin/rmdir -symlink toolbox /system/bin/rmmod /system/bin/route /system/bin/runcon -symlink toolbox /system/bin/schedtop /system/bin/sendevent -symlink toolbox /system/bin/setconsole /system/bin/setenforce -symlink toolbox /system/bin/setprop /system/bin/setsebool /system/bin/sleep -symlink toolbox /system/bin/smd /system/bin/start /system/bin/stop -symlink toolbox /system/bin/swapoff /system/bin/swapon /system/bin/sync -symlink toolbox /system/bin/top /system/bin/touch /system/bin/umount -symlink toolbox /system/bin/uptime /system/bin/vmstat /system/bin/watchprops -symlink toolbox /system/bin/wipe - -set_metadata_recursive /system 0 0 0755 0644 -set_metadata_recursive /system/bin 0 2000 0755 0755 -set_metadata /system/bin/app_process 0 2000 0755 -set_metadata /system/bin/clatd 0 2000 0755 -set_metadata /system/bin/dbus-daemon 0 2000 0755 -set_metadata /system/bin/debuggerd 0 2000 0755 -set_metadata /system/bin/dhcpcd 0 2000 0755 -set_metadata /system/bin/dnsmasq 0 2000 0755 -set_metadata /system/bin/drmserver 0 2000 0755 -set_metadata /system/bin/hostapd 0 2000 0755 -set_metadata /system/bin/installd 0 2000 0755 -set_metadata /system/bin/keystore 0 2000 0755 -set_metadata /system/bin/mediaserver 0 2000 0755 -set_metadata /system/bin/mksh 0 2000 0755 -set_metadata /system/bin/mtpd 0 2000 0755 -set_metadata /system/bin/netcfg 0 3003 02750 -set_metadata /system/bin/netd 0 2000 0755 -set_metadata /system/bin/ping 0 0 0755 -set_metadata /system/bin/pppd 0 2000 0755 -set_metadata /system/bin/racoon 0 2000 0755 -set_metadata /system/bin/rild 0 2000 0755 -set_metadata /system/bin/run-as 0 2000 0750 -set_metadata /system/bin/sdcard 0 2000 0755 -set_metadata /system/bin/servicemanager 0 2000 0755 -set_metadata /system/bin/surfaceflinger 0 2000 0755 -set_metadata /system/bin/vold 0 2000 0755 -set_metadata /system/bin/wpa_supplicant 0 2000 0755 -set_metadata_recursive /system/etc/dhcpcd 0 0 0755 0644 -set_metadata /system/etc/dhcpcd/dhcpcd-run-hooks 1014 2000 0550 -set_metadata_recursive /system/etc/ppp 0 0 0755 0555 -set_metadata /system/vendor 0 2000 0755 -set_metadata_recursive /system/vendor/bin 0 2000 0755 0755 -set_metadata /system/vendor/etc 0 2000 0755 -set_metadata /system/vendor/lib 0 2000 0755 -set_metadata_recursive /system/vendor/lib/drm 0 2000 0755 0644 -set_metadata /system/vendor/lib/drm/libdrmwvmplugin.so 0 0 0644 -set_metadata /system/vendor/lib/egl 0 2000 0755 -set_metadata /system/vendor/lib/hw 0 2000 0755 -set_metadata_recursive /system/vendor/lib/mediadrm 0 2000 0755 0644 -set_metadata /system/vendor/lib/mediadrm/libwvdrmengine.so 0 0 0644 -set_metadata /system/vendor/media 0 2000 0755 -set_metadata_recursive /system/xbin 0 2000 0755 0755 diff --git a/scripts/link_and_set_perm_zenfone_6 b/scripts/link_and_set_perm_zenfone_6 deleted file mode 100755 index fdfdff0..0000000 --- a/scripts/link_and_set_perm_zenfone_6 +++ /dev/null @@ -1,95 +0,0 @@ -#!/bin/bash - -source ../scripts/func.bash - -symlink Roboto-Bold.ttf /system/fonts/DroidSans-Bold.ttf -symlink Roboto-Regular.ttf /system/fonts/DroidSans.ttf -symlink gralloc.redhookbay.so.1.12.2701748 /system/vendor/lib/hw/gralloc.redhookbay.so /system/vendor/lib/hw/gralloc.redhookbay.so.1 -symlink libEGL_POWERVR_SGX544_115.so.1.12.2701748 /system/vendor/lib/egl/libEGL_POWERVR_SGX544_115.so /system/vendor/lib/egl/libEGL_POWERVR_SGX544_115.so.1 -symlink libGLESv1_CM_POWERVR_SGX544_115.so.1.12.2701748 /system/vendor/lib/egl/libGLESv1_CM_POWERVR_SGX544_115.so /system/vendor/lib/egl/libGLESv1_CM_POWERVR_SGX544_115.so.1 -symlink libGLESv2.so /system/lib/libGLESv3.so -symlink libGLESv2_POWERVR_SGX544_115.so.1.12.2701748 /system/vendor/lib/egl/libGLESv2_POWERVR_SGX544_115.so /system/vendor/lib/egl/libGLESv2_POWERVR_SGX544_115.so.1 -symlink libIMGegl.so.1.12.2701748 /system/vendor/lib/libIMGegl.so /system/vendor/lib/libIMGegl.so.1 -symlink libPVROCL.so.1.12.2701748 /system/vendor/lib/libPVROCL.so /system/vendor/lib/libPVROCL.so.1 -symlink libPVRRS.so.1.12.2701748 /system/vendor/lib/libPVRRS.so /system/vendor/lib/libPVRRS.so.1 -symlink libPVRScopeServices.so.1.12.2701748 /system/vendor/lib/libPVRScopeServices.so /system/vendor/lib/libPVRScopeServices.so.1 -symlink libglslcompiler.so.1.12.2701748 /system/vendor/lib/libglslcompiler.so /system/vendor/lib/libglslcompiler.so.1 -symlink libhoudini.so.4.0.8.45720 /system/lib/libhoudini.so -symlink liboclcompiler.so.1.12.2701748 /system/vendor/lib/liboclcompiler.so /system/vendor/lib/liboclcompiler.so.1 -symlink libpvr2d.so.1.12.2701748 /system/vendor/lib/libpvr2d.so /system/vendor/lib/libpvr2d.so.1 -symlink libpvrANDROID_WSEGL.so.1.12.2701748 /system/vendor/lib/libpvrANDROID_WSEGL.so /system/vendor/lib/libpvrANDROID_WSEGL.so.1 -symlink librsccompiler.so.1.12.2701748 /system/vendor/lib/librsccompiler.so /system/vendor/lib/librsccompiler.so.1 -symlink librsccore.bc.1.12.2701748 /system/vendor/lib/librsccore.bc /system/vendor/lib/librsccore.bc.1 -symlink libsrv_init.so.1.12.2701748 /system/vendor/lib/libsrv_init.so /system/vendor/lib/libsrv_init.so.1 -symlink libsrv_um.so.1.12.2701748 /system/vendor/lib/libsrv_um.so /system/vendor/lib/libsrv_um.so.1 -symlink libusc.so.1.12.2701748 /system/vendor/lib/libusc.so /system/vendor/lib/libusc.so.1 -symlink memtrack.redhookbay.so.1.12.2701748 /system/vendor/lib/hw/memtrack.redhookbay.so /system/vendor/lib/hw/memtrack.redhookbay.so.1 -symlink mksh /system/bin/sh -symlink toolbox /system/bin/cat /system/bin/chcon -symlink toolbox /system/bin/chmod /system/bin/chown /system/bin/clear -symlink toolbox /system/bin/cmp /system/bin/cp /system/bin/date -symlink toolbox /system/bin/dd /system/bin/df /system/bin/dmesg -symlink toolbox /system/bin/du /system/bin/getenforce /system/bin/getevent -symlink toolbox /system/bin/getprop /system/bin/getsebool /system/bin/grep -symlink toolbox /system/bin/hd /system/bin/id /system/bin/ifconfig -symlink toolbox /system/bin/iftop /system/bin/insmod /system/bin/ioctl -symlink toolbox /system/bin/ionice /system/bin/kill /system/bin/ln -symlink toolbox /system/bin/load_policy /system/bin/log /system/bin/ls -symlink toolbox /system/bin/lsmod /system/bin/lsof /system/bin/md5 -symlink toolbox /system/bin/mkdir /system/bin/mkswap /system/bin/mount -symlink toolbox /system/bin/mv /system/bin/nandread /system/bin/netstat -symlink toolbox /system/bin/newfs_msdos /system/bin/notify /system/bin/printenv -symlink toolbox /system/bin/ps /system/bin/readlink /system/bin/renice -symlink toolbox /system/bin/restorecon /system/bin/rm /system/bin/rmdir -symlink toolbox /system/bin/rmmod /system/bin/route /system/bin/runcon -symlink toolbox /system/bin/schedtop /system/bin/sendevent -symlink toolbox /system/bin/setconsole /system/bin/setenforce -symlink toolbox /system/bin/setprop /system/bin/setsebool /system/bin/sleep -symlink toolbox /system/bin/smd /system/bin/start /system/bin/stop -symlink toolbox /system/bin/swapoff /system/bin/swapon /system/bin/sync -symlink toolbox /system/bin/top /system/bin/touch /system/bin/umount -symlink toolbox /system/bin/uptime /system/bin/vmstat /system/bin/watchprops -symlink toolbox /system/bin/wipe - -set_metadata_recursive /system 0 0 0755 0644 capabilities 0x0 selabel u:object_r:system_file:s0 -set_metadata_recursive /system/bin 0 2000 0755 0755 capabilities 0x0 selabel u:object_r:system_file:s0 -set_metadata /system/bin/app_process 0 2000 0755 capabilities 0x0 selabel u:object_r:zygote_exec:s0 -set_metadata /system/bin/clatd 0 2000 0755 capabilities 0x0 selabel u:object_r:clatd_exec:s0 -set_metadata /system/bin/dbus-daemon 0 2000 0755 capabilities 0x0 selabel u:object_r:dbusd_exec:s0 -set_metadata /system/bin/debuggerd 0 2000 0755 capabilities 0x0 selabel u:object_r:debuggerd_exec:s0 -set_metadata /system/bin/dhcpcd 0 2000 0755 capabilities 0x0 selabel u:object_r:dhcp_exec:s0 -set_metadata /system/bin/dnsmasq 0 2000 0755 capabilities 0x0 selabel u:object_r:dnsmasq_exec:s0 -set_metadata /system/bin/drmserver 0 2000 0755 capabilities 0x0 selabel u:object_r:drmserver_exec:s0 -set_metadata /system/bin/hostapd 0 2000 0755 capabilities 0x0 selabel u:object_r:hostapd_exec:s0 -set_metadata /system/bin/installd 0 2000 0755 capabilities 0x0 selabel u:object_r:installd_exec:s0 -set_metadata /system/bin/keystore 0 2000 0755 capabilities 0x0 selabel u:object_r:keystore_exec:s0 -set_metadata /system/bin/mediaserver 0 2000 0755 capabilities 0x0 selabel u:object_r:mediaserver_exec:s0 -set_metadata /system/bin/mksh 0 2000 0755 capabilities 0x0 selabel u:object_r:shell_exec:s0 -set_metadata /system/bin/mtpd 0 2000 0755 capabilities 0x0 selabel u:object_r:mtp_exec:s0 -set_metadata /system/bin/netcfg 0 3003 02750 capabilities 0x0 selabel u:object_r:system_file:s0 -set_metadata /system/bin/netd 0 2000 0755 capabilities 0x0 selabel u:object_r:netd_exec:s0 -set_metadata /system/bin/ping 0 0 0755 capabilities 0x0 selabel u:object_r:ping_exec:s0 -set_metadata /system/bin/pppd 0 2000 0755 capabilities 0x0 selabel u:object_r:ppp_exec:s0 -set_metadata /system/bin/racoon 0 2000 0755 capabilities 0x0 selabel u:object_r:racoon_exec:s0 -set_metadata /system/bin/rild 0 2000 0755 capabilities 0x0 selabel u:object_r:rild_exec:s0 -set_metadata /system/bin/run-as 0 2000 0750 capabilities 0xc0 selabel u:object_r:runas_exec:s0 -set_metadata /system/bin/sdcard 0 2000 0755 capabilities 0x0 selabel u:object_r:sdcardd_exec:s0 -set_metadata /system/bin/servicemanager 0 2000 0755 capabilities 0x0 selabel u:object_r:servicemanager_exec:s0 -set_metadata /system/bin/surfaceflinger 0 2000 0755 capabilities 0x0 selabel u:object_r:surfaceflinger_exec:s0 -set_metadata /system/bin/vold 0 2000 0755 capabilities 0x0 selabel u:object_r:vold_exec:s0 -set_metadata /system/bin/wpa_supplicant 0 2000 0755 capabilities 0x0 selabel u:object_r:wpa_exec:s0 -set_metadata_recursive /system/etc/dhcpcd 0 0 0755 0644 capabilities 0x0 selabel u:object_r:dhcp_system_file:s0 -set_metadata /system/etc/dhcpcd/dhcpcd-run-hooks 1014 2000 0550 capabilities 0x0 selabel u:object_r:dhcp_system_file:s0 -set_metadata_recursive /system/etc/ppp 0 0 0755 0555 capabilities 0x0 selabel u:object_r:ppp_system_file:s0 -set_metadata /system/vendor 0 2000 0755 capabilities 0x0 selabel u:object_r:system_file:s0 -set_metadata_recursive /system/vendor/bin 0 2000 0755 0755 capabilities 0x0 selabel u:object_r:system_file:s0 -set_metadata /system/vendor/etc 0 2000 0755 capabilities 0x0 selabel u:object_r:system_file:s0 -set_metadata /system/vendor/lib 0 2000 0755 capabilities 0x0 selabel u:object_r:system_file:s0 -set_metadata_recursive /system/vendor/lib/drm 0 2000 0755 0644 capabilities 0x0 selabel u:object_r:system_file:s0 -set_metadata /system/vendor/lib/drm/libdrmwvmplugin.so 0 0 0644 capabilities 0x0 selabel u:object_r:system_file:s0 -set_metadata /system/vendor/lib/egl 0 2000 0755 capabilities 0x0 selabel u:object_r:system_file:s0 -set_metadata /system/vendor/lib/hw 0 2000 0755 capabilities 0x0 selabel u:object_r:system_file:s0 -set_metadata_recursive /system/vendor/lib/mediadrm 0 2000 0755 0644 capabilities 0x0 selabel u:object_r:system_file:s0 -set_metadata /system/vendor/lib/mediadrm/libwvdrmengine.so 0 0 0644 capabilities 0x0 selabel u:object_r:system_file:s0 -set_metadata /system/vendor/media 0 2000 0755 capabilities 0x0 selabel u:object_r:system_file:s0 -set_metadata_recursive /system/xbin 0 2000 0755 0755 capabilities 0x0 selabel u:object_r:system_file:s0 diff --git a/scripts/prepare_upload.sh b/scripts/prepare_upload.sh new file mode 100755 index 0000000..fe803b7 --- /dev/null +++ b/scripts/prepare_upload.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +source ../scripts/setup.bash + +if [ ! -z "$SLIM_DOWN" ]; then + VARIANT=slim +else + VARIANT=full +fi + +cd $VERSION +md5sum boot.img > md5sum +md5sum droidboot.img >> md5sum +md5sum recovery.img >> md5sum + +if [ -n "$SPLIT_SIZE" ]; then +# 7z a -mx9 -v$SPLIT_SIZE system.img.zip system.img + zip ${VERSION}_system_w_root.zip system.img -s $SPLIT_SIZE + md5sum *.z* >> md5sum +else + zip system-${VARIANT}.img.zip system.img + md5sum system-${VARIANT}.img.zip >> md5sum +fi diff --git a/scripts/setup.bash b/scripts/setup.bash index 038110f..62f6d8f 100644 --- a/scripts/setup.bash +++ b/scripts/setup.bash @@ -1,17 +1,34 @@ -# ZenFon 4 -#LINK_PERM_SETUP_FILE=link_and_set_perm_zenfone_4 -#ROM_URL=http://dlcdnet.asus.com/pub/ASUS/ZenFone/A400CG/ASUS_T00I_WW_6_5_30_UpdateLauncher.zip -#ZIP_FILE=UL-ASUS_T00I-WW-6.5.30.0-user.zip -#SYSTEM_SIZE=1363148800 +# ZenFone 2 Z00A +VERSION=Z00A_WW_2.20.40.174 +LINK_PERM_SETUP_FILE=link_and_set_perm_z00a +ROM_URL=http://dlcdnet.asus.com/pub/ASUS/ZenFone/ZE551ML/UL-Z00A-WW-2.20.40.168-user.zip +SYSTEM_SIZE=2415919104 +FILE_CONTEXT=file_contexts_z00a +OTA_URL=http://fota.asus.com/delta_package/phone/WW_Z00A/formal/WW_2.20.40.168_20160202_1100_user_rel-user-WW_Z00A-WW_2.20.40.174_20160310_4150_user_rel-user-WW_Z00A-20160311/WW_Z00A-20160202-20160310-20160311.zip + +# ZenFone 2 Z008 +#VERSION=Z008_WW_2.20.40.138 +#LINK_PERM_SETUP_FILE=link_and_set_perm_z008 +#ROM_URL=http://dlcdnet.asus.com/pub/ASUS/ZenFone/ZE550ML/UL-Z008-WW-2.20.40.138-user.zip +#SYSTEM_SIZE=2415919104 +#FILE_CONTEXT=file_contexts_z008 +#OTA_URL=http://fota.asus.com/delta_package/phone/WW_Z008/formal/WW_2.20.40.130_20151104_2543_user_rel-user-WW_Z008-WW_2.20.40.135_20151218_0990_user_rel-user-WW_Z008-20151218/WW_Z008-20151104-20151218-20151218.zip -# ZenFone 5 -LINK_PERM_SETUP_FILE=link_and_set_perm_zenfone_5 -ROM_URL=http://dlcdnet.asus.com/pub/ASUS/ZenFone/A500CG/UL-ASUS_T00F-TW-2.20.40.9-user.zip -SYSTEM_SIZE=1363148800 -FILE_CONTEXT=file_contexts_zenfone +# ZenFone 5 T00F +#VERSION=T00F_WW_3.24.40.87 +#LINK_PERM_SETUP_FILE=link_and_set_perm_t00f +#ROM_URL=http://dlcdnet.asus.com/pub/ASUS/ZenFone/A500CG/UL-ASUS_T00F-WW-3.24.40.87-user.zip +#SYSTEM_SIZE=1363148800 +#FILE_CONTEXT=file_contexts_t00f -# ZenFone 6 -#LINK_PERM_SETUP_FILE=link_and_set_perm_zenfone_6 -#ROM_URL=http://dlcdnet.asus.com/pub/ASUS/ZenFone/A600CG/UL-ASUS_T00G-TW-2.20.40.8-user.zip +# ZenFone 6 T00G +#VERSION=T00G_WW_3.24.40.87 +#LINK_PERM_SETUP_FILE=link_and_set_perm_t00g +#ROM_URL=http://dlcdnet.asus.com/pub/ASUS/ZenFone/A600CG/UL-ASUS_T00F-WW-3.24.40.87-user.zip #SYSTEM_SIZE=1363148800 -#FILE_CONTEXT=file_contexts_zenfone +#FILE_CONTEXT=file_contexts_t00g + +# Uncomment to add root survival function (fix su binary notification and preserve root after OTA upgrade) +ROOT_SURVIVAL=1 + +#SPLIT_SIZE=200m diff --git a/xposed/system/app/XposedInstaller/XposedInstaller_3.0_alpha4.apk b/xposed/system/app/XposedInstaller/XposedInstaller_3.0_alpha4.apk new file mode 100644 index 0000000..350d6ec Binary files /dev/null and b/xposed/system/app/XposedInstaller/XposedInstaller_3.0_alpha4.apk differ diff --git a/xposed/system/bin/app_process32_xposed b/xposed/system/bin/app_process32_xposed new file mode 100644 index 0000000..f3f3144 Binary files /dev/null and b/xposed/system/bin/app_process32_xposed differ diff --git a/xposed/system/bin/dex2oat b/xposed/system/bin/dex2oat new file mode 100644 index 0000000..89a792d Binary files /dev/null and b/xposed/system/bin/dex2oat differ diff --git a/xposed/system/bin/oatdump b/xposed/system/bin/oatdump new file mode 100644 index 0000000..11d876b Binary files /dev/null and b/xposed/system/bin/oatdump differ diff --git a/xposed/system/bin/patchoat b/xposed/system/bin/patchoat new file mode 100644 index 0000000..2918aa2 Binary files /dev/null and b/xposed/system/bin/patchoat differ diff --git a/xposed/system/framework/XposedBridge.jar b/xposed/system/framework/XposedBridge.jar new file mode 100644 index 0000000..d523903 Binary files /dev/null and b/xposed/system/framework/XposedBridge.jar differ diff --git a/xposed/system/lib/libart-compiler.so b/xposed/system/lib/libart-compiler.so new file mode 100644 index 0000000..9b7ebb8 Binary files /dev/null and b/xposed/system/lib/libart-compiler.so differ diff --git a/xposed/system/lib/libart-disassembler.so b/xposed/system/lib/libart-disassembler.so new file mode 100644 index 0000000..4ce5c20 Binary files /dev/null and b/xposed/system/lib/libart-disassembler.so differ diff --git a/xposed/system/lib/libart.so b/xposed/system/lib/libart.so new file mode 100644 index 0000000..e8d6a3f Binary files /dev/null and b/xposed/system/lib/libart.so differ diff --git a/xposed/system/lib/libsigchain.so b/xposed/system/lib/libsigchain.so new file mode 100644 index 0000000..6e9e62a Binary files /dev/null and b/xposed/system/lib/libsigchain.so differ diff --git a/xposed/system/lib/libxposed_art.so b/xposed/system/lib/libxposed_art.so new file mode 100644 index 0000000..658f940 Binary files /dev/null and b/xposed/system/lib/libxposed_art.so differ diff --git a/xposed/system/xposed.prop b/xposed/system/xposed.prop new file mode 100644 index 0000000..a43b731 --- /dev/null +++ b/xposed/system/xposed.prop @@ -0,0 +1,4 @@ +version=80 +arch=x86 +minsdk=21 +maxsdk=21