From 9410c190cdba8b0bcf665a11959fc7532467ab71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tufan=20Bar=C4=B1=C5=9F=20Y=C4=B1ld=C4=B1r=C4=B1m?= Date: Thu, 27 Oct 2022 17:49:48 +0300 Subject: [PATCH 1/3] fix php8+ compatibility issues for Archive --- README.md | 6 +++--- composer.json | 5 +++-- lib/ApkParser/Archive.php | 42 +++++++++++++++++++++++---------------- 3 files changed, 31 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 8f33931..0215fec 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ application name, description, device feature access permission it requires, etc files contained in the APK file to a given directory. ### Requirements - -PHP 7.3+ +PHP 8.0+ +PHP 7.3+ is in [2.x.x](https://github.com/tufanbarisyildirim/php-apk-parser/tree/v2.x.x) branch ### Installation @@ -34,7 +34,7 @@ your changes. That's all! Thanks JetBrains for the free open source license - + Jetbrains diff --git a/composer.json b/composer.json index 83f60fe..7625ade 100644 --- a/composer.json +++ b/composer.json @@ -18,11 +18,12 @@ } ], "require": { - "php": ">=7.3", + "php": ">=8.0", "ext-simplexml": "*", "ext-json": "*", "ext-libxml": "*", - "ext-mbstring": "*" + "ext-mbstring": "*", + "ext-zip": "*" }, "require-dev": { "phpunit/phpunit": "^8.5" diff --git a/lib/ApkParser/Archive.php b/lib/ApkParser/Archive.php index f53ae8a..ff65493 100644 --- a/lib/ApkParser/Archive.php +++ b/lib/ApkParser/Archive.php @@ -24,10 +24,10 @@ class Archive extends \ZipArchive /** - * @param bool $file + * @param bool|string $file * @throws \Exception */ - public function __construct($file = false) + public function __construct(string|bool $file = false) { if ($file && is_file($file)) { $this->open($file); @@ -41,11 +41,12 @@ public function __construct($file = false) * Get a file from apk Archive by name. * * @param string $name - * @param int $length - * @param int $flags - * @return mixed + * @param int|null $length + * @param int|null $flags + * @return string|false + * @throws \Exception */ - public function getFromName($name, $length = null, $flags = null) + public function getFromName(string $name, int $length = null, int $flags = null): string|false { if (strtolower(substr($name, -4)) == '.xml') { $xmlParser = new XmlParser(new Stream($this->getStream($name))); @@ -59,7 +60,7 @@ public function getFromName($name, $length = null, $flags = null) * Returns an ApkStream which contains AndroidManifest.xml * @return Stream */ - public function getManifestStream() + public function getManifestStream(): Stream { return new Stream($this->getStream('AndroidManifest.xml')); } @@ -67,25 +68,26 @@ public function getManifestStream() /** * @return SeekableStream */ - public function getResourcesStream() + public function getResourcesStream(): SeekableStream { return new SeekableStream($this->getStream('resources.arsc')); } /** * Returns an \ApkParser\Stream instance which contains classes.dex file - * @returns \ApkParser\Stream + * @returns Stream + * @throws \Exception */ - public function getClassesDexStream() + public function getClassesDexStream(): Stream { return new Stream($this->getStream('classes.dex')); } /** * Apk file path. - * @return string + * @return bool|string */ - public function getApkPath() + public function getApkPath(): bool|string { return $this->filePath; } @@ -94,19 +96,25 @@ public function getApkPath() * Apk file name * @return string */ - public function getApkName() + public function getApkName(): string { return $this->fileName; } - public function extractTo($destination, $entries = null) + /** + * @param string $pathto + * @param array|string|null $files + * @return bool + * @throws \Exception + */ + public function extractTo(string $pathto, array|string|null $files = null): bool { - if ($extResult = parent::extractTo($destination, $entries)) { - $xmlFiles = Utils::globRecursive($destination . '/*.xml'); + if ($extResult = parent::extractTo($pathto, $files)) { + $xmlFiles = Utils::globRecursive($pathto . '/*.xml'); foreach ($xmlFiles as $xmlFile) { - if ($xmlFile == ($destination . "/AndroidManifest.xml")) { + if ($xmlFile == ($pathto . "/AndroidManifest.xml")) { XmlParser::decompressFile($xmlFile); } } From 83fc8d1ecaf944a0004b71f7815733fdc5ef75cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tufan=20Bar=C4=B1=C5=9F=20Y=C4=B1ld=C4=B1r=C4=B1m?= Date: Thu, 27 Oct 2022 17:50:29 +0300 Subject: [PATCH 2/3] stop testing on php < 8 --- .github/workflows/tests.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ea0b7b5..6d72b5f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,8 +7,6 @@ jobs: strategy: matrix: php-version: - - '7.3' - - '7.4' - '8.0' - '8.1' From 5e82447aee4eac5cc733a774df188917c3352b28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tufan=20Bar=C4=B1=C5=9F=20Y=C4=B1ld=C4=B1r=C4=B1m?= Date: Sat, 19 Nov 2022 13:02:14 +0300 Subject: [PATCH 3/3] tidy up --- Makefile | 8 + README.md | 4 +- lib/ApkParser/Config.php | 4 +- lib/ApkParser/Manifest.php | 1234 +++++++++++++------------- lib/ApkParser/ManifestXmlElement.php | 4 +- 5 files changed, 631 insertions(+), 623 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d209636 --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +PHP = php +COMPOSER = composer +M = $(shell printf "\033[34;1m>>\033[0m") + +.PHONY: test +test: + $(info $(M) runing tests...) + $(COMPOSER) tests \ No newline at end of file diff --git a/README.md b/README.md index 0215fec..5f474c0 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,9 @@ application name, description, device feature access permission it requires, etc files contained in the APK file to a given directory. ### Requirements + PHP 8.0+ -PHP 7.3+ is in [2.x.x](https://github.com/tufanbarisyildirim/php-apk-parser/tree/v2.x.x) branch +PHP 7.3+ is in [2.x.x](https://github.com/tufanbarisyildirim/php-apk-parser/tree/v2.x.x) branch ### Installation @@ -37,7 +38,6 @@ Thanks JetBrains for the free open source license Jetbrains - ### License Apk Parser is [MIT licensed](./LICENSE.md). diff --git a/lib/ApkParser/Config.php b/lib/ApkParser/Config.php index d847b5a..68795fc 100644 --- a/lib/ApkParser/Config.php +++ b/lib/ApkParser/Config.php @@ -31,8 +31,8 @@ public function __construct(array $config = []) { $this->config = array_merge( [ - 'tmp_path' => sys_get_temp_dir(), - 'jar_path' => __DIR__ . '/Dex/dedexer.jar', + 'tmp_path' => sys_get_temp_dir(), + 'jar_path' => __DIR__ . '/Dex/dedexer.jar', 'manifest_only' => true ], $config diff --git a/lib/ApkParser/Manifest.php b/lib/ApkParser/Manifest.php index bd8a88d..815cc5d 100644 --- a/lib/ApkParser/Manifest.php +++ b/lib/ApkParser/Manifest.php @@ -22,1082 +22,1082 @@ class Manifest extends Xml * @var mixed */ public static $permissions = array( - 'ACCESS_CHECKIN_PROPERTIES' => 'Allows read/write access to the "properties" table in the checkin database, to change values that get uploaded.', - 'ACCESS_COARSE_LOCATION' => 'Allows an app to access approximate location derived from network location sources such as cell towers and Wi-Fi.', - 'ACCESS_FINE_LOCATION' => 'Allows an app to access precise location from location sources such as GPS, cell towers, and Wi-Fi.', - 'ACCESS_LOCATION_EXTRA_COMMANDS' => 'Allows an application to access extra location provider commands.', - 'ACCESS_MOCK_LOCATION' => 'Allows an application to create mock location providers for testing.', - 'ACCESS_NETWORK_STATE' => 'Allows applications to access information about networks.', - 'ACCESS_NOTIFICATION_POLICY' => 'Marker permission for applications that wish to access notification policy.', - 'ACCESS_SURFACE_FLINGER' => 'Allows an application to use SurfaceFlinger\'s low level features.', - 'ACCESS_WIFI_STATE' => 'Allows applications to access information about Wi-Fi networks', - 'ACCOUNT_MANAGER' => 'Allows applications to call into AccountAuthenticators.', - 'ADD_VOICEMAIL' => 'Allows an application to add voicemails into the system.', - 'AUTHENTICATE_ACCOUNTS' => 'Allows an application to act as an AccountAuthenticator for the AccountManager.', - 'BATTERY_STATS' => 'Allows an application to collect battery statistics.', - 'BIND_ACCESSIBILITY_SERVICE' => 'Must be required by an AccessibilityService,to ensure that only the system can bind to it.', - 'BIND_APPWIDGET' => 'Allows an application to tell the AppWidget service which application can access AppWidget\'s data.', - 'BIND_CARRIER_MESSAGING_SERVICE' => 'The system process that is allowed to bind to services in carrier apps will have this permission. Carrier apps should use this permission to protect their services that only the system is allowed to bind to.', - 'BIND_CARRIER_SERVICES' => 'The system process that is allowed to bind to services in carrier apps will have this permission. Carrier apps should use this permission to protect their services that only the system is allowed to bind to.', - 'BIND_CHOOSER_TARGET_SERVICE' => 'Must be required by a ChooserTargetService, to ensure that only the system can bind to it.', - 'BIND_DEVICE_ADMIN' => 'Must be required by device administration receiver, to ensure that only the system can interact with it.', - 'BIND_DREAM_SERVICE' => 'Must be required by an DreamService, to ensure that only the system can bind to it.', - 'BIND_INCALL_SERVICE' => 'Must be required by a InCallService, to ensure that only the system can bind to it.', - 'BIND_INPUT_METHOD' => 'Must be required by an InputMethodService, to ensure that only the system can bind to it.', - 'BIND_MIDI_DEVICE_SERVICE' => 'Must be required by an MidiDeviceService, to ensure that only the system can bind to it.', - 'BIND_NFC_SERVICE' => 'Must be required by a HostApduService or OffHostApduService to ensure that only the system can bind to it.', - 'BIND_NOTIFICATION_LISTENER_SERVICE' => 'Must be required by an NotificationListenerService, to ensure that only the system can bind to it.', - 'BIND_PRINT_SERVICE' => 'Must be required by a PrintService, to ensure that only the system can bind to it.', - 'BIND_REMOTEVIEWS' => 'Must be required by a RemoteViewsService, to ensure that only the system can bind to it.', - 'BIND_TELECOM_CONNECTION_SERVICE' => 'Must be required by a ConnectionService, to ensure that only the system can bind to it.', - 'BIND_TEXT_SERVICE' => 'Must be required by a TextService (e.g. SpellCheckerService) to ensure that only the system can bind to it.', - 'BIND_TV_INPUT' => 'Must be required by a TvInputService to ensure that only the system can bind to it.', - 'BIND_VOICE_INTERACTION' => 'Must be required by a VoiceInteractionService, to ensure that only the system can bind to it.', - 'BIND_VPN_SERVICE' => 'Must be required by a VpnService, to ensure that only the system can bind to it.', - 'BIND_WALLPAPER' => 'Must be required by a WallpaperService, to ensure that only the system can bind to it.', - 'BLUETOOTH' => 'Allows applications to connect to paired bluetooth devices.', - 'BLUETOOTH_ADMIN' => 'Allows applications to discover and pair bluetooth devices.', - 'BLUETOOTH_PRIVILEGED' => 'Allows applications to pair bluetooth devices without user interaction.', - 'BODY_SENSORS' => 'Allows an application to access data from sensors that the user uses to measure what is happening inside his/her body, such as heart rate.', - 'BRICK' => 'Required to be able to disable the device (very dangerous!).', - 'BROADCAST_PACKAGE_REMOVED' => 'Allows an application to broadcast a notification that an application package has been removed.', - 'BROADCAST_SMS' => 'Allows an application to broadcast an SMS receipt notification.', - 'BROADCAST_STICKY' => 'Allows an application to broadcast sticky intents.', - 'BROADCAST_WAP_PUSH' => 'Allows an application to broadcast a WAP PUSH receipt notification.', - 'CALL_PHONE' => 'Allows an application to initiate a phone call without going through the Dialer user interface for the user to confirm the call being placed.', - 'CALL_PRIVILEGED' => 'Allows an application to call any phone number, including emergency numbers, without going through the Dialer user interface for the user to confirm the call being placed.', - 'CAMERA' => 'Required to be able to access the camera device.', - 'CAPTURE_AUDIO_OUTPUT' => 'Allows an application to capture audio output.', - 'CAPTURE_SECURE_VIDEO_OUTPUT' => 'Allows an application to capture secure video output.', - 'CAPTURE_VIDEO_OUTPUT' => 'Allows an application to capture video output.', - 'CHANGE_COMPONENT_ENABLED_STATE' => 'Allows an application to change whether an application component (other than its own) is enabled or not.', - 'CHANGE_CONFIGURATION' => 'Allows an application to modify the current configuration, such as locale.', - 'CHANGE_NETWORK_STATE' => 'Allows applications to change network connectivity state.', - 'CHANGE_WIFI_MULTICAST_STATE' => 'Allows applications to enter Wi-Fi Multicast mode.', - 'CHANGE_WIFI_STATE' => 'Allows applications to change Wi-Fi connectivity state.', - 'CLEAR_APP_CACHE' => 'Allows an application to clear the caches of all installed applications on the device.', - 'CLEAR_APP_USER_DATA' => 'Allows an application to clear user data.', - 'CONTROL_LOCATION_UPDATES' => 'Allows enabling/disabling location update notifications from the radio.', - 'DELETE_CACHE_FILES' => 'Allows an application to delete cache files.', - 'DELETE_PACKAGES' => 'Allows an application to delete packages.', - 'DEVICE_POWER' => 'Allows low-level access to power management.', - 'DIAGNOSTIC' => 'Allows applications to RW to diagnostic resources.', - 'DISABLE_KEYGUARD' => 'Allows applications to disable the keyguard.', - 'DUMP' => 'Allows an application to retrieve state dump information from system services.', - 'EXPAND_STATUS_BAR' => 'Allows an application to expand or collapse the status bar.', - 'FACTORY_TEST' => 'Run as a manufacturer test application, running as the root user.', - 'FLASHLIGHT' => 'Allows access to the flashlight.', - 'FORCE_BACK' => 'Allows an application to force a BACK operation on whatever is the top activity.', - 'GET_ACCOUNTS' => 'Allows access to the list of accounts in the Accounts Service.', - 'GET_ACCOUNTS_PRIVILEGED' => 'Allows access to the list of accounts in the Accounts Service.', - 'GET_PACKAGE_SIZE' => 'Allows an application to find out the space used by any package.', - 'GET_TASKS' => 'Allows an application to get information about the currently or recently running tasks.', - 'GET_TOP_ACTIVITY_INFO' => 'Allows an application to retrieve private information about the current top activity, such as any assist context it can provide.', - 'GLOBAL_SEARCH' => 'This permission can be used on content providers to allow the global search system to access their data.', - 'HARDWARE_TEST' => 'Allows access to hardware peripherals.', - 'INJECT_EVENTS' => 'Allows an application to inject user events (keys, touch, trackball) into the event stream and deliver them to ANY window.', - 'INSTALL_LOCATION_PROVIDER' => 'Allows an application to install a location provider into the Location Manager.', - 'INSTALL_PACKAGES' => 'Allows an application to install packages.', - 'INSTALL_SHORTCUT' => 'Allows an application to install a shortcut in Launcher.', - 'INTERNAL_SYSTEM_WINDOW' => 'Allows an application to open windows that are for use by parts of the system user interface.', - 'INTERNET' => 'Allows applications to open network sockets.', - 'KILL_BACKGROUND_PROCESSES' => 'Allows an application to call killBackgroundProcesses(String).', - 'LOCATION_HARDWARE' => 'Allows an application to use location features in hardware, such as the geofencing api.', - 'MANAGE_ACCOUNTS' => 'Allows an application to manage the list of accounts in the AccountManager.', - 'MANAGE_APP_TOKENS' => 'Allows an application to manage (create, destroy, Z-order) application tokens in the window manager.', - 'MANAGE_DOCUMENTS' => 'Allows an application to manage access to documents, usually as part of a document picker.', - 'MASTER_CLEAR' => 'Not for use by third-party applications.', - 'MEDIA_CONTENT_CONTROL' => 'Allows an application to know what content is playing and control its playback.', - 'MODIFY_AUDIO_SETTINGS' => 'Allows an application to modify global audio setting.s.', - 'MODIFY_PHONE_STATE' => 'Allows modification of the telephony state - power on, mmi, etc.', - 'MOUNT_FORMAT_FILESYSTEMS' => 'Allows formatting file systems for removable storage.', - 'MOUNT_UNMOUNT_FILESYSTEMS' => 'Allows mounting and unmounting file systems for removable storage.', - 'NFC' => 'Allows applications to perform I/O operations over NFC.', - 'PACKAGE_USAGE_STATS' => 'Allows an application to collect component usage statistics.', - 'PERSISTENT_ACTIVITY' => 'This constant was deprecated in API level 9. This functionality will be removed in the future; please do not use. Allow an application to make its activities persistent.', - 'PROCESS_OUTGOING_CALLS' => 'Allows an application to monitor, modify, or abort outgoing calls.', - 'READ_CALENDAR' => 'Allows an application to read the user\'s calendar data.', - 'READ_CALL_LOG' => 'Allows an application to read the user\'s call log.', - 'READ_CONTACTS' => 'Allows an application to read the user\'s contacts data.', - 'READ_EXTERNAL_STORAGE' => 'Allows an application to read from external storage.', - 'READ_FRAME_BUFFER' => 'Allows an application to take screen shots and more generally get access to the frame buffer data.', - 'READ_HISTORY_BOOKMARKS' => 'Allows an application to read (but not write) the user\'s browsing history and bookmarks.', - 'READ_INPUT_STATE' => 'This constant was deprecated in API level 16. The API that used this permission has been removed.', - 'READ_LOGS' => 'Allows an application to read the low-level system log files.', - 'READ_PHONE_STATE' => 'Allows read only access to phone state.', - 'READ_PROFILE' => 'Allows an application to read the user\'s personal profile data.', - 'READ_SMS' => 'Allows an application to read SMS messages.', - 'READ_SOCIAL_STREAM' => 'Allows an application to read from the user\'s social stream.', - 'READ_SYNC_SETTINGS' => 'Allows applications to read the sync settings.', - 'READ_SYNC_STATS' => 'Allows applications to read the sync stats.', - 'READ_USER_DICTIONARY' => 'Allows an application to read the user dictionary.', - 'READ_VOICEMAIL' => 'Allows an application to read voicemails in the system.', - 'REBOOT' => 'Required to be able to reboot the device.', - 'RECEIVE_BOOT_COMPLETED' => 'Allows an application to receive the ACTION_BOOT_COMPLETED that is broadcast after the system finishes booting.', - 'RECEIVE_MMS' => 'Allows an application to monitor incoming MMS messages, to record or perform processing on them.', - 'RECEIVE_SMS' => 'Allows an application to monitor incoming SMS messages, to record or perform processing on them.', - 'RECEIVE_WAP_PUSH' => 'Allows an application to monitor incoming WAP push messages.', - 'RECORD_AUDIO' => 'Allows an application to record audio.', - 'REORDER_TASKS' => 'Allows an application to change the Z-order of tasks', + 'ACCESS_CHECKIN_PROPERTIES' => 'Allows read/write access to the "properties" table in the checkin database, to change values that get uploaded.', + 'ACCESS_COARSE_LOCATION' => 'Allows an app to access approximate location derived from network location sources such as cell towers and Wi-Fi.', + 'ACCESS_FINE_LOCATION' => 'Allows an app to access precise location from location sources such as GPS, cell towers, and Wi-Fi.', + 'ACCESS_LOCATION_EXTRA_COMMANDS' => 'Allows an application to access extra location provider commands.', + 'ACCESS_MOCK_LOCATION' => 'Allows an application to create mock location providers for testing.', + 'ACCESS_NETWORK_STATE' => 'Allows applications to access information about networks.', + 'ACCESS_NOTIFICATION_POLICY' => 'Marker permission for applications that wish to access notification policy.', + 'ACCESS_SURFACE_FLINGER' => 'Allows an application to use SurfaceFlinger\'s low level features.', + 'ACCESS_WIFI_STATE' => 'Allows applications to access information about Wi-Fi networks', + 'ACCOUNT_MANAGER' => 'Allows applications to call into AccountAuthenticators.', + 'ADD_VOICEMAIL' => 'Allows an application to add voicemails into the system.', + 'AUTHENTICATE_ACCOUNTS' => 'Allows an application to act as an AccountAuthenticator for the AccountManager.', + 'BATTERY_STATS' => 'Allows an application to collect battery statistics.', + 'BIND_ACCESSIBILITY_SERVICE' => 'Must be required by an AccessibilityService,to ensure that only the system can bind to it.', + 'BIND_APPWIDGET' => 'Allows an application to tell the AppWidget service which application can access AppWidget\'s data.', + 'BIND_CARRIER_MESSAGING_SERVICE' => 'The system process that is allowed to bind to services in carrier apps will have this permission. Carrier apps should use this permission to protect their services that only the system is allowed to bind to.', + 'BIND_CARRIER_SERVICES' => 'The system process that is allowed to bind to services in carrier apps will have this permission. Carrier apps should use this permission to protect their services that only the system is allowed to bind to.', + 'BIND_CHOOSER_TARGET_SERVICE' => 'Must be required by a ChooserTargetService, to ensure that only the system can bind to it.', + 'BIND_DEVICE_ADMIN' => 'Must be required by device administration receiver, to ensure that only the system can interact with it.', + 'BIND_DREAM_SERVICE' => 'Must be required by an DreamService, to ensure that only the system can bind to it.', + 'BIND_INCALL_SERVICE' => 'Must be required by a InCallService, to ensure that only the system can bind to it.', + 'BIND_INPUT_METHOD' => 'Must be required by an InputMethodService, to ensure that only the system can bind to it.', + 'BIND_MIDI_DEVICE_SERVICE' => 'Must be required by an MidiDeviceService, to ensure that only the system can bind to it.', + 'BIND_NFC_SERVICE' => 'Must be required by a HostApduService or OffHostApduService to ensure that only the system can bind to it.', + 'BIND_NOTIFICATION_LISTENER_SERVICE' => 'Must be required by an NotificationListenerService, to ensure that only the system can bind to it.', + 'BIND_PRINT_SERVICE' => 'Must be required by a PrintService, to ensure that only the system can bind to it.', + 'BIND_REMOTEVIEWS' => 'Must be required by a RemoteViewsService, to ensure that only the system can bind to it.', + 'BIND_TELECOM_CONNECTION_SERVICE' => 'Must be required by a ConnectionService, to ensure that only the system can bind to it.', + 'BIND_TEXT_SERVICE' => 'Must be required by a TextService (e.g. SpellCheckerService) to ensure that only the system can bind to it.', + 'BIND_TV_INPUT' => 'Must be required by a TvInputService to ensure that only the system can bind to it.', + 'BIND_VOICE_INTERACTION' => 'Must be required by a VoiceInteractionService, to ensure that only the system can bind to it.', + 'BIND_VPN_SERVICE' => 'Must be required by a VpnService, to ensure that only the system can bind to it.', + 'BIND_WALLPAPER' => 'Must be required by a WallpaperService, to ensure that only the system can bind to it.', + 'BLUETOOTH' => 'Allows applications to connect to paired bluetooth devices.', + 'BLUETOOTH_ADMIN' => 'Allows applications to discover and pair bluetooth devices.', + 'BLUETOOTH_PRIVILEGED' => 'Allows applications to pair bluetooth devices without user interaction.', + 'BODY_SENSORS' => 'Allows an application to access data from sensors that the user uses to measure what is happening inside his/her body, such as heart rate.', + 'BRICK' => 'Required to be able to disable the device (very dangerous!).', + 'BROADCAST_PACKAGE_REMOVED' => 'Allows an application to broadcast a notification that an application package has been removed.', + 'BROADCAST_SMS' => 'Allows an application to broadcast an SMS receipt notification.', + 'BROADCAST_STICKY' => 'Allows an application to broadcast sticky intents.', + 'BROADCAST_WAP_PUSH' => 'Allows an application to broadcast a WAP PUSH receipt notification.', + 'CALL_PHONE' => 'Allows an application to initiate a phone call without going through the Dialer user interface for the user to confirm the call being placed.', + 'CALL_PRIVILEGED' => 'Allows an application to call any phone number, including emergency numbers, without going through the Dialer user interface for the user to confirm the call being placed.', + 'CAMERA' => 'Required to be able to access the camera device.', + 'CAPTURE_AUDIO_OUTPUT' => 'Allows an application to capture audio output.', + 'CAPTURE_SECURE_VIDEO_OUTPUT' => 'Allows an application to capture secure video output.', + 'CAPTURE_VIDEO_OUTPUT' => 'Allows an application to capture video output.', + 'CHANGE_COMPONENT_ENABLED_STATE' => 'Allows an application to change whether an application component (other than its own) is enabled or not.', + 'CHANGE_CONFIGURATION' => 'Allows an application to modify the current configuration, such as locale.', + 'CHANGE_NETWORK_STATE' => 'Allows applications to change network connectivity state.', + 'CHANGE_WIFI_MULTICAST_STATE' => 'Allows applications to enter Wi-Fi Multicast mode.', + 'CHANGE_WIFI_STATE' => 'Allows applications to change Wi-Fi connectivity state.', + 'CLEAR_APP_CACHE' => 'Allows an application to clear the caches of all installed applications on the device.', + 'CLEAR_APP_USER_DATA' => 'Allows an application to clear user data.', + 'CONTROL_LOCATION_UPDATES' => 'Allows enabling/disabling location update notifications from the radio.', + 'DELETE_CACHE_FILES' => 'Allows an application to delete cache files.', + 'DELETE_PACKAGES' => 'Allows an application to delete packages.', + 'DEVICE_POWER' => 'Allows low-level access to power management.', + 'DIAGNOSTIC' => 'Allows applications to RW to diagnostic resources.', + 'DISABLE_KEYGUARD' => 'Allows applications to disable the keyguard.', + 'DUMP' => 'Allows an application to retrieve state dump information from system services.', + 'EXPAND_STATUS_BAR' => 'Allows an application to expand or collapse the status bar.', + 'FACTORY_TEST' => 'Run as a manufacturer test application, running as the root user.', + 'FLASHLIGHT' => 'Allows access to the flashlight.', + 'FORCE_BACK' => 'Allows an application to force a BACK operation on whatever is the top activity.', + 'GET_ACCOUNTS' => 'Allows access to the list of accounts in the Accounts Service.', + 'GET_ACCOUNTS_PRIVILEGED' => 'Allows access to the list of accounts in the Accounts Service.', + 'GET_PACKAGE_SIZE' => 'Allows an application to find out the space used by any package.', + 'GET_TASKS' => 'Allows an application to get information about the currently or recently running tasks.', + 'GET_TOP_ACTIVITY_INFO' => 'Allows an application to retrieve private information about the current top activity, such as any assist context it can provide.', + 'GLOBAL_SEARCH' => 'This permission can be used on content providers to allow the global search system to access their data.', + 'HARDWARE_TEST' => 'Allows access to hardware peripherals.', + 'INJECT_EVENTS' => 'Allows an application to inject user events (keys, touch, trackball) into the event stream and deliver them to ANY window.', + 'INSTALL_LOCATION_PROVIDER' => 'Allows an application to install a location provider into the Location Manager.', + 'INSTALL_PACKAGES' => 'Allows an application to install packages.', + 'INSTALL_SHORTCUT' => 'Allows an application to install a shortcut in Launcher.', + 'INTERNAL_SYSTEM_WINDOW' => 'Allows an application to open windows that are for use by parts of the system user interface.', + 'INTERNET' => 'Allows applications to open network sockets.', + 'KILL_BACKGROUND_PROCESSES' => 'Allows an application to call killBackgroundProcesses(String).', + 'LOCATION_HARDWARE' => 'Allows an application to use location features in hardware, such as the geofencing api.', + 'MANAGE_ACCOUNTS' => 'Allows an application to manage the list of accounts in the AccountManager.', + 'MANAGE_APP_TOKENS' => 'Allows an application to manage (create, destroy, Z-order) application tokens in the window manager.', + 'MANAGE_DOCUMENTS' => 'Allows an application to manage access to documents, usually as part of a document picker.', + 'MASTER_CLEAR' => 'Not for use by third-party applications.', + 'MEDIA_CONTENT_CONTROL' => 'Allows an application to know what content is playing and control its playback.', + 'MODIFY_AUDIO_SETTINGS' => 'Allows an application to modify global audio setting.s.', + 'MODIFY_PHONE_STATE' => 'Allows modification of the telephony state - power on, mmi, etc.', + 'MOUNT_FORMAT_FILESYSTEMS' => 'Allows formatting file systems for removable storage.', + 'MOUNT_UNMOUNT_FILESYSTEMS' => 'Allows mounting and unmounting file systems for removable storage.', + 'NFC' => 'Allows applications to perform I/O operations over NFC.', + 'PACKAGE_USAGE_STATS' => 'Allows an application to collect component usage statistics.', + 'PERSISTENT_ACTIVITY' => 'This constant was deprecated in API level 9. This functionality will be removed in the future; please do not use. Allow an application to make its activities persistent.', + 'PROCESS_OUTGOING_CALLS' => 'Allows an application to monitor, modify, or abort outgoing calls.', + 'READ_CALENDAR' => 'Allows an application to read the user\'s calendar data.', + 'READ_CALL_LOG' => 'Allows an application to read the user\'s call log.', + 'READ_CONTACTS' => 'Allows an application to read the user\'s contacts data.', + 'READ_EXTERNAL_STORAGE' => 'Allows an application to read from external storage.', + 'READ_FRAME_BUFFER' => 'Allows an application to take screen shots and more generally get access to the frame buffer data.', + 'READ_HISTORY_BOOKMARKS' => 'Allows an application to read (but not write) the user\'s browsing history and bookmarks.', + 'READ_INPUT_STATE' => 'This constant was deprecated in API level 16. The API that used this permission has been removed.', + 'READ_LOGS' => 'Allows an application to read the low-level system log files.', + 'READ_PHONE_STATE' => 'Allows read only access to phone state.', + 'READ_PROFILE' => 'Allows an application to read the user\'s personal profile data.', + 'READ_SMS' => 'Allows an application to read SMS messages.', + 'READ_SOCIAL_STREAM' => 'Allows an application to read from the user\'s social stream.', + 'READ_SYNC_SETTINGS' => 'Allows applications to read the sync settings.', + 'READ_SYNC_STATS' => 'Allows applications to read the sync stats.', + 'READ_USER_DICTIONARY' => 'Allows an application to read the user dictionary.', + 'READ_VOICEMAIL' => 'Allows an application to read voicemails in the system.', + 'REBOOT' => 'Required to be able to reboot the device.', + 'RECEIVE_BOOT_COMPLETED' => 'Allows an application to receive the ACTION_BOOT_COMPLETED that is broadcast after the system finishes booting.', + 'RECEIVE_MMS' => 'Allows an application to monitor incoming MMS messages, to record or perform processing on them.', + 'RECEIVE_SMS' => 'Allows an application to monitor incoming SMS messages, to record or perform processing on them.', + 'RECEIVE_WAP_PUSH' => 'Allows an application to monitor incoming WAP push messages.', + 'RECORD_AUDIO' => 'Allows an application to record audio.', + 'REORDER_TASKS' => 'Allows an application to change the Z-order of tasks', 'REQUEST_IGNORE_BATTERY_OPTIMIZATIONS' => 'Permission an application must hold in order to use ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS. This is a normal permission: an app requesting it will always be granted the permission, without the user needing to approve or see it', - 'REQUEST_INSTALL_PACKAGES' => 'Allows an application to request installing packages. Apps targeting APIs greater than 25 must hold this permission in order to use ACTION_INSTALL_PACKAGE', - 'RESTART_PACKAGES' => 'This constant was deprecated in API level 8. The restartPackage(String) API is no longer supported.', - 'SEND_RESPOND_VIA_MESSAGE' => 'Allows an application (Phone) to send a request to other applications to handle the respond-via-message action during incoming calls.', - 'SEND_SMS' => 'Allows an application to send SMS messages.', - 'SET_ACTIVITY_WATCHER' => 'Allows an application to watch and control how activities are started globally in the system.', - 'SET_ALARM' => 'Allows an application to broadcast an Intent to set an alarm for the user.', - 'SET_ALWAYS_FINISH' => 'Allows an application to control whether activities are immediately finished when put in the background.', - 'SET_ANIMATION_SCALE' => 'Modify the global animation scaling factor.', - 'SET_DEBUG_APP' => 'Configure an application for debugging.', - 'SET_ORIENTATION' => 'Allows low-level access to setting the orientation (actually rotation) of the screen.', - 'SET_POINTER_SPEED' => 'Allows low-level access to setting the pointer speed.', - 'SET_PREFERRED_APPLICATIONS' => 'This constant was deprecated in API level 7. No longer useful, see addPackageToPreferred(String) for details.', - 'SET_PROCESS_LIMIT' => 'Allows an application to set the maximum number of (not needed) application processes that can be running.', - 'SET_TIME' => 'Allows applications to set the system time.', - 'SET_TIME_ZONE' => 'Allows applications to set the system time zone.', - 'SET_WALLPAPER' => 'Allows applications to set the wallpaper.', - 'SET_WALLPAPER_HINTS' => 'Allows applications to set the wallpaper hints.', - 'SIGNAL_PERSISTENT_PROCESSES' => 'Allow an application to request that a signal be sent to all persistent processes.', - 'STATUS_BAR' => 'Allows an application to open, close, or disable the status bar and its icons.', - 'SUBSCRIBED_FEEDS_READ' => 'Allows an application to allow access the subscribed feeds ContentProvider.', - 'SUBSCRIBED_FEEDS_WRITE' => '', - 'SYSTEM_ALERT_WINDOW' => 'Allows an application to open windows using the type TYPE_SYSTEM_ALERT, shown on top of all other applications.', - 'TRANSMIT_IR' => 'Allows using the device\'s IR transmitter, if available.', - 'UNINSTALL_SHORTCUT' => 'Allows an application to uninstall a shortcut in Launche.r', - 'UPDATE_DEVICE_STATS' => 'Allows an application to update device statistics.', - 'USE_CREDENTIALS' => 'Allows an application to request authtokens from the AccountManager.', - 'USE_FINGERPRINT' => 'Allows an app to use fingerprint hardware.', - 'USE_SIP' => 'Allows an application to use SIP service.', - 'VIBRATE' => 'Allows access to the vibrator.', - 'WAKE_LOCK' => 'Allows using PowerManager WakeLocks to keep processor from sleeping or screen from dimming.', - 'WRITE_APN_SETTINGS' => 'Allows applications to write the apn settings.', - 'WRITE_CALENDAR' => 'Allows an application to write (but not read) the user\'s calendar data.', - 'WRITE_CALL_LOG' => 'Allows an application to write (but not read) the user\'s contacts data.', - 'WRITE_CONTACTS' => 'Allows an application to write (but not read) the user\'s contacts data.', - 'WRITE_EXTERNAL_STORAGE' => 'Allows an application to write to external storage.', - 'WRITE_GSERVICES' => 'Allows an application to modify the Google service map.', - 'WRITE_HISTORY_BOOKMARKS' => 'Allows an application to write (but not read) the user\'s browsing history and bookmarks.', - 'WRITE_PROFILE' => 'Allows an application to write (but not read) the user\'s personal profile data.', - 'WRITE_SECURE_SETTINGS' => 'Allows an application to read or write the secure system settings.', - 'WRITE_SETTINGS' => 'Allows an application to read or write the system settings.', - 'WRITE_SMS' => 'Allows an application to write SMS messages.', - 'WRITE_SOCIAL_STREAM' => 'Allows an application to write (but not read) the user\'s social stream data.', - 'WRITE_SYNC_SETTINGS' => 'Allows applications to write the sync settings.', - 'WRITE_USER_DICTIONARY' => 'Allows an application to write to the user dictionary.', - 'WRITE_VOICEMAIL' => 'Allows an application to modify and remove existing voicemails in the system.' + 'REQUEST_INSTALL_PACKAGES' => 'Allows an application to request installing packages. Apps targeting APIs greater than 25 must hold this permission in order to use ACTION_INSTALL_PACKAGE', + 'RESTART_PACKAGES' => 'This constant was deprecated in API level 8. The restartPackage(String) API is no longer supported.', + 'SEND_RESPOND_VIA_MESSAGE' => 'Allows an application (Phone) to send a request to other applications to handle the respond-via-message action during incoming calls.', + 'SEND_SMS' => 'Allows an application to send SMS messages.', + 'SET_ACTIVITY_WATCHER' => 'Allows an application to watch and control how activities are started globally in the system.', + 'SET_ALARM' => 'Allows an application to broadcast an Intent to set an alarm for the user.', + 'SET_ALWAYS_FINISH' => 'Allows an application to control whether activities are immediately finished when put in the background.', + 'SET_ANIMATION_SCALE' => 'Modify the global animation scaling factor.', + 'SET_DEBUG_APP' => 'Configure an application for debugging.', + 'SET_ORIENTATION' => 'Allows low-level access to setting the orientation (actually rotation) of the screen.', + 'SET_POINTER_SPEED' => 'Allows low-level access to setting the pointer speed.', + 'SET_PREFERRED_APPLICATIONS' => 'This constant was deprecated in API level 7. No longer useful, see addPackageToPreferred(String) for details.', + 'SET_PROCESS_LIMIT' => 'Allows an application to set the maximum number of (not needed) application processes that can be running.', + 'SET_TIME' => 'Allows applications to set the system time.', + 'SET_TIME_ZONE' => 'Allows applications to set the system time zone.', + 'SET_WALLPAPER' => 'Allows applications to set the wallpaper.', + 'SET_WALLPAPER_HINTS' => 'Allows applications to set the wallpaper hints.', + 'SIGNAL_PERSISTENT_PROCESSES' => 'Allow an application to request that a signal be sent to all persistent processes.', + 'STATUS_BAR' => 'Allows an application to open, close, or disable the status bar and its icons.', + 'SUBSCRIBED_FEEDS_READ' => 'Allows an application to allow access the subscribed feeds ContentProvider.', + 'SUBSCRIBED_FEEDS_WRITE' => '', + 'SYSTEM_ALERT_WINDOW' => 'Allows an application to open windows using the type TYPE_SYSTEM_ALERT, shown on top of all other applications.', + 'TRANSMIT_IR' => 'Allows using the device\'s IR transmitter, if available.', + 'UNINSTALL_SHORTCUT' => 'Allows an application to uninstall a shortcut in Launche.r', + 'UPDATE_DEVICE_STATS' => 'Allows an application to update device statistics.', + 'USE_CREDENTIALS' => 'Allows an application to request authtokens from the AccountManager.', + 'USE_FINGERPRINT' => 'Allows an app to use fingerprint hardware.', + 'USE_SIP' => 'Allows an application to use SIP service.', + 'VIBRATE' => 'Allows access to the vibrator.', + 'WAKE_LOCK' => 'Allows using PowerManager WakeLocks to keep processor from sleeping or screen from dimming.', + 'WRITE_APN_SETTINGS' => 'Allows applications to write the apn settings.', + 'WRITE_CALENDAR' => 'Allows an application to write (but not read) the user\'s calendar data.', + 'WRITE_CALL_LOG' => 'Allows an application to write (but not read) the user\'s contacts data.', + 'WRITE_CONTACTS' => 'Allows an application to write (but not read) the user\'s contacts data.', + 'WRITE_EXTERNAL_STORAGE' => 'Allows an application to write to external storage.', + 'WRITE_GSERVICES' => 'Allows an application to modify the Google service map.', + 'WRITE_HISTORY_BOOKMARKS' => 'Allows an application to write (but not read) the user\'s browsing history and bookmarks.', + 'WRITE_PROFILE' => 'Allows an application to write (but not read) the user\'s personal profile data.', + 'WRITE_SECURE_SETTINGS' => 'Allows an application to read or write the secure system settings.', + 'WRITE_SETTINGS' => 'Allows an application to read or write the system settings.', + 'WRITE_SMS' => 'Allows an application to write SMS messages.', + 'WRITE_SOCIAL_STREAM' => 'Allows an application to write (but not read) the user\'s social stream data.', + 'WRITE_SYNC_SETTINGS' => 'Allows applications to write the sync settings.', + 'WRITE_USER_DICTIONARY' => 'Allows an application to write to the user dictionary.', + 'WRITE_VOICEMAIL' => 'Allows an application to modify and remove existing voicemails in the system.' ); public static $permission_flags = array( - 'ACCESS_CHECKIN_PROPERTIES' => + 'ACCESS_CHECKIN_PROPERTIES' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'ACCESS_COARSE_LOCATION' => + 'ACCESS_COARSE_LOCATION' => array( - 'cost' => false, + 'cost' => false, 'warning' => true, - 'danger' => false, + 'danger' => false, ), - 'ACCESS_FINE_LOCATION' => + 'ACCESS_FINE_LOCATION' => array( - 'cost' => false, + 'cost' => false, 'warning' => true, - 'danger' => false, + 'danger' => false, ), - 'ACCESS_LOCATION_EXTRA_COMMANDS' => + 'ACCESS_LOCATION_EXTRA_COMMANDS' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'ACCESS_MOCK_LOCATION' => + 'ACCESS_MOCK_LOCATION' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'ACCESS_NETWORK_STATE' => + 'ACCESS_NETWORK_STATE' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'ACCESS_SURFACE_FLINGER' => + 'ACCESS_SURFACE_FLINGER' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'ACCESS_WIFI_STATE' => + 'ACCESS_WIFI_STATE' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'ACCOUNT_MANAGER' => + 'ACCOUNT_MANAGER' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'ADD_VOICEMAIL' => + 'ADD_VOICEMAIL' => array( - 'cost' => false, + 'cost' => false, 'warning' => true, - 'danger' => true, + 'danger' => true, ), - 'AUTHENTICATE_ACCOUNTS' => + 'AUTHENTICATE_ACCOUNTS' => array( - 'cost' => false, + 'cost' => false, 'warning' => true, - 'danger' => true, + 'danger' => true, ), - 'BATTERY_STATS' => + 'BATTERY_STATS' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'BIND_ACCESSIBILITY_SERVICE' => + 'BIND_ACCESSIBILITY_SERVICE' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'BIND_APPWIDGET' => + 'BIND_APPWIDGET' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'BIND_DEVICE_ADMIN' => + 'BIND_DEVICE_ADMIN' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'BIND_DREAM_SERVICE' => + 'BIND_DREAM_SERVICE' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'BIND_INPUT_METHOD' => + 'BIND_INPUT_METHOD' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'BIND_NFC_SERVICE' => + 'BIND_NFC_SERVICE' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), 'BIND_NOTIFICATION_LISTENER_SERVICE' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'BIND_PRINT_SERVICE' => + 'BIND_PRINT_SERVICE' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'BIND_REMOTEVIEWS' => + 'BIND_REMOTEVIEWS' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'BIND_TEXT_SERVICE' => + 'BIND_TEXT_SERVICE' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'BIND_TV_INPUT' => + 'BIND_TV_INPUT' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'BIND_VOICE_INTERACTION' => + 'BIND_VOICE_INTERACTION' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'BIND_VPN_SERVICE' => + 'BIND_VPN_SERVICE' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'BIND_WALLPAPER' => + 'BIND_WALLPAPER' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'BLUETOOTH' => + 'BLUETOOTH' => array( - 'cost' => false, + 'cost' => false, 'warning' => true, - 'danger' => false, + 'danger' => false, ), - 'BLUETOOTH_ADMIN' => + 'BLUETOOTH_ADMIN' => array( - 'cost' => false, + 'cost' => false, 'warning' => true, - 'danger' => false, + 'danger' => false, ), - 'BLUETOOTH_PRIVILEGED' => + 'BLUETOOTH_PRIVILEGED' => array( - 'cost' => false, + 'cost' => false, 'warning' => true, - 'danger' => false, + 'danger' => false, ), - 'BODY_SENSORS' => + 'BODY_SENSORS' => array( - 'cost' => false, + 'cost' => false, 'warning' => true, - 'danger' => true, + 'danger' => true, ), - 'BRICK' => + 'BRICK' => array( - 'cost' => false, + 'cost' => false, 'warning' => true, - 'danger' => true, + 'danger' => true, ), - 'BROADCAST_PACKAGE_REMOVED' => + 'BROADCAST_PACKAGE_REMOVED' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'BROADCAST_SMS' => + 'BROADCAST_SMS' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'BROADCAST_STICKY' => + 'BROADCAST_STICKY' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'BROADCAST_WAP_PUSH' => + 'BROADCAST_WAP_PUSH' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'CALL_PHONE' => + 'CALL_PHONE' => array( - 'cost' => true, + 'cost' => true, 'warning' => true, - 'danger' => false, + 'danger' => false, ), - 'CALL_PRIVILEGED' => + 'CALL_PRIVILEGED' => array( - 'cost' => true, + 'cost' => true, 'warning' => true, - 'danger' => true, + 'danger' => true, ), - 'CAMERA' => + 'CAMERA' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'CAPTURE_AUDIO_OUTPUT' => + 'CAPTURE_AUDIO_OUTPUT' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'CAPTURE_SECURE_VIDEO_OUTPUT' => + 'CAPTURE_SECURE_VIDEO_OUTPUT' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'CAPTURE_VIDEO_OUTPUT' => + 'CAPTURE_VIDEO_OUTPUT' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'CHANGE_COMPONENT_ENABLED_STATE' => + 'CHANGE_COMPONENT_ENABLED_STATE' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'CHANGE_CONFIGURATION' => + 'CHANGE_CONFIGURATION' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'CHANGE_NETWORK_STATE' => + 'CHANGE_NETWORK_STATE' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'CHANGE_WIFI_MULTICAST_STATE' => + 'CHANGE_WIFI_MULTICAST_STATE' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'CHANGE_WIFI_STATE' => + 'CHANGE_WIFI_STATE' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'CLEAR_APP_CACHE' => + 'CLEAR_APP_CACHE' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'CLEAR_APP_USER_DATA' => + 'CLEAR_APP_USER_DATA' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'CONTROL_LOCATION_UPDATES' => + 'CONTROL_LOCATION_UPDATES' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'DELETE_CACHE_FILES' => + 'DELETE_CACHE_FILES' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'DELETE_PACKAGES' => + 'DELETE_PACKAGES' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'DEVICE_POWER' => + 'DEVICE_POWER' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'DIAGNOSTIC' => + 'DIAGNOSTIC' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'DISABLE_KEYGUARD' => + 'DISABLE_KEYGUARD' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'DUMP' => + 'DUMP' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'EXPAND_STATUS_BAR' => + 'EXPAND_STATUS_BAR' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'FACTORY_TEST' => + 'FACTORY_TEST' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'FLASHLIGHT' => + 'FLASHLIGHT' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'FORCE_BACK' => + 'FORCE_BACK' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'GET_ACCOUNTS' => + 'GET_ACCOUNTS' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'GET_PACKAGE_SIZE' => + 'GET_PACKAGE_SIZE' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'GET_TASKS' => + 'GET_TASKS' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'GET_TOP_ACTIVITY_INFO' => + 'GET_TOP_ACTIVITY_INFO' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'GLOBAL_SEARCH' => + 'GLOBAL_SEARCH' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'HARDWARE_TEST' => + 'HARDWARE_TEST' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'INJECT_EVENTS' => + 'INJECT_EVENTS' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'INSTALL_LOCATION_PROVIDER' => + 'INSTALL_LOCATION_PROVIDER' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'INSTALL_PACKAGES' => + 'INSTALL_PACKAGES' => array( - 'cost' => false, + 'cost' => false, 'warning' => true, - 'danger' => true, + 'danger' => true, ), - 'INSTALL_SHORTCUT' => + 'INSTALL_SHORTCUT' => array( - 'cost' => false, + 'cost' => false, 'warning' => true, - 'danger' => true, + 'danger' => true, ), - 'INTERNAL_SYSTEM_WINDOW' => + 'INTERNAL_SYSTEM_WINDOW' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'INTERNET' => + 'INTERNET' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'KILL_BACKGROUND_PROCESSES' => + 'KILL_BACKGROUND_PROCESSES' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => true, + 'danger' => true, ), - 'LOCATION_HARDWARE' => + 'LOCATION_HARDWARE' => array( - 'cost' => false, + 'cost' => false, 'warning' => true, - 'danger' => false, + 'danger' => false, ), - 'MANAGE_ACCOUNTS' => + 'MANAGE_ACCOUNTS' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'MANAGE_APP_TOKENS' => + 'MANAGE_APP_TOKENS' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'MANAGE_DOCUMENTS' => + 'MANAGE_DOCUMENTS' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'MASTER_CLEAR' => + 'MASTER_CLEAR' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => true, + 'danger' => true, ), - 'MEDIA_CONTENT_CONTROL' => + 'MEDIA_CONTENT_CONTROL' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'MODIFY_AUDIO_SETTINGS' => + 'MODIFY_AUDIO_SETTINGS' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'MODIFY_PHONE_STATE' => + 'MODIFY_PHONE_STATE' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'MOUNT_FORMAT_FILESYSTEMS' => + 'MOUNT_FORMAT_FILESYSTEMS' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'MOUNT_UNMOUNT_FILESYSTEMS' => + 'MOUNT_UNMOUNT_FILESYSTEMS' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'NFC' => + 'NFC' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'PERSISTENT_ACTIVITY' => + 'PERSISTENT_ACTIVITY' => array( - 'cost' => false, + 'cost' => false, 'warning' => true, - 'danger' => true, + 'danger' => true, ), - 'PROCESS_OUTGOING_CALLS' => + 'PROCESS_OUTGOING_CALLS' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'READ_CALENDAR' => + 'READ_CALENDAR' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'READ_CALL_LOG' => + 'READ_CALL_LOG' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'READ_CONTACTS' => + 'READ_CONTACTS' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'READ_EXTERNAL_STORAGE' => + 'READ_EXTERNAL_STORAGE' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'READ_FRAME_BUFFER' => + 'READ_FRAME_BUFFER' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'READ_HISTORY_BOOKMARKS' => + 'READ_HISTORY_BOOKMARKS' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'READ_INPUT_STATE' => + 'READ_INPUT_STATE' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => true, + 'danger' => true, ), - 'READ_LOGS' => + 'READ_LOGS' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'READ_PHONE_STATE' => + 'READ_PHONE_STATE' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'READ_PROFILE' => + 'READ_PROFILE' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'READ_SMS' => + 'READ_SMS' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'READ_SOCIAL_STREAM' => + 'READ_SOCIAL_STREAM' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'READ_SYNC_SETTINGS' => + 'READ_SYNC_SETTINGS' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'READ_SYNC_STATS' => + 'READ_SYNC_STATS' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'READ_USER_DICTIONARY' => + 'READ_USER_DICTIONARY' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'READ_VOICEMAIL' => + 'READ_VOICEMAIL' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'REBOOT' => + 'REBOOT' => array( - 'cost' => false, + 'cost' => false, 'warning' => true, - 'danger' => true, + 'danger' => true, ), - 'RECEIVE_BOOT_COMPLETED' => + 'RECEIVE_BOOT_COMPLETED' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'RECEIVE_MMS' => + 'RECEIVE_MMS' => array( - 'cost' => false, + 'cost' => false, 'warning' => true, - 'danger' => false, + 'danger' => false, ), - 'RECEIVE_SMS' => + 'RECEIVE_SMS' => array( - 'cost' => false, + 'cost' => false, 'warning' => true, - 'danger' => false, + 'danger' => false, ), - 'RECEIVE_WAP_PUSH' => + 'RECEIVE_WAP_PUSH' => array( - 'cost' => false, + 'cost' => false, 'warning' => true, - 'danger' => false, + 'danger' => false, ), - 'RECORD_AUDIO' => + 'RECORD_AUDIO' => array( - 'cost' => false, + 'cost' => false, 'warning' => true, - 'danger' => false, + 'danger' => false, ), - 'REORDER_TASKS' => + 'REORDER_TASKS' => array( - 'cost' => false, + 'cost' => false, 'warning' => true, - 'danger' => false, + 'danger' => false, ), - 'RESTART_PACKAGES' => + 'RESTART_PACKAGES' => array( - 'cost' => false, + 'cost' => false, 'warning' => true, - 'danger' => true, + 'danger' => true, ), - 'SEND_RESPOND_VIA_MESSAGE' => + 'SEND_RESPOND_VIA_MESSAGE' => array( - 'cost' => false, + 'cost' => false, 'warning' => true, - 'danger' => true, + 'danger' => true, ), - 'SEND_SMS' => + 'SEND_SMS' => array( - 'cost' => true, + 'cost' => true, 'warning' => true, - 'danger' => false, + 'danger' => false, ), - 'SET_ACTIVITY_WATCHER' => + 'SET_ACTIVITY_WATCHER' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => true, + 'danger' => true, ), - 'SET_ALARM' => + 'SET_ALARM' => array( - 'cost' => false, + 'cost' => false, 'warning' => true, - 'danger' => false, + 'danger' => false, ), - 'SET_ALWAYS_FINISH' => + 'SET_ALWAYS_FINISH' => array( - 'cost' => false, + 'cost' => false, 'warning' => true, - 'danger' => true, + 'danger' => true, ), - 'SET_ANIMATION_SCALE' => + 'SET_ANIMATION_SCALE' => array( - 'cost' => false, + 'cost' => false, 'warning' => true, - 'danger' => true, + 'danger' => true, ), - 'SET_DEBUG_APP' => + 'SET_DEBUG_APP' => array( - 'cost' => false, + 'cost' => false, 'warning' => true, - 'danger' => true, + 'danger' => true, ), - 'SET_ORIENTATION' => + 'SET_ORIENTATION' => array( - 'cost' => false, + 'cost' => false, 'warning' => true, - 'danger' => true, + 'danger' => true, ), - 'SET_POINTER_SPEED' => + 'SET_POINTER_SPEED' => array( - 'cost' => false, + 'cost' => false, 'warning' => true, - 'danger' => true, + 'danger' => true, ), - 'SET_PREFERRED_APPLICATIONS' => + 'SET_PREFERRED_APPLICATIONS' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => true, + 'danger' => true, ), - 'SET_PROCESS_LIMIT' => + 'SET_PROCESS_LIMIT' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'SET_TIME' => + 'SET_TIME' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'SET_TIME_ZONE' => + 'SET_TIME_ZONE' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'SET_WALLPAPER' => + 'SET_WALLPAPER' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'SET_WALLPAPER_HINTS' => + 'SET_WALLPAPER_HINTS' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'SIGNAL_PERSISTENT_PROCESSES' => + 'SIGNAL_PERSISTENT_PROCESSES' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'STATUS_BAR' => + 'STATUS_BAR' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'SUBSCRIBED_FEEDS_READ' => + 'SUBSCRIBED_FEEDS_READ' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'SUBSCRIBED_FEEDS_WRITE' => + 'SUBSCRIBED_FEEDS_WRITE' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'SYSTEM_ALERT_WINDOW' => + 'SYSTEM_ALERT_WINDOW' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'TRANSMIT_IR' => + 'TRANSMIT_IR' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'UNINSTALL_SHORTCUT' => + 'UNINSTALL_SHORTCUT' => array( - 'cost' => false, + 'cost' => false, 'warning' => true, - 'danger' => false, + 'danger' => false, ), - 'UPDATE_DEVICE_STATS' => + 'UPDATE_DEVICE_STATS' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'USE_CREDENTIALS' => + 'USE_CREDENTIALS' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'USE_FINGERPRINT' => + 'USE_FINGERPRINT' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'USE_SIP' => + 'USE_SIP' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'VIBRATE' => + 'VIBRATE' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'WAKE_LOCK' => + 'WAKE_LOCK' => array( - 'cost' => false, + 'cost' => false, 'warning' => true, - 'danger' => false, + 'danger' => false, ), - 'WRITE_APN_SETTINGS' => + 'WRITE_APN_SETTINGS' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => true, + 'danger' => true, ), - 'WRITE_CALENDAR' => + 'WRITE_CALENDAR' => array( - 'cost' => false, + 'cost' => false, 'warning' => true, - 'danger' => false, + 'danger' => false, ), - 'WRITE_CALL_LOG' => + 'WRITE_CALL_LOG' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => true, + 'danger' => true, ), - 'WRITE_CONTACTS' => + 'WRITE_CONTACTS' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => true, + 'danger' => true, ), - 'WRITE_EXTERNAL_STORAGE' => + 'WRITE_EXTERNAL_STORAGE' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'WRITE_GSERVICES' => + 'WRITE_GSERVICES' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => true, + 'danger' => true, ), - 'WRITE_HISTORY_BOOKMARKS' => + 'WRITE_HISTORY_BOOKMARKS' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => true, + 'danger' => true, ), - 'WRITE_PROFILE' => + 'WRITE_PROFILE' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => true, + 'danger' => true, ), - 'WRITE_SECURE_SETTINGS' => + 'WRITE_SECURE_SETTINGS' => array( - 'cost' => false, + 'cost' => false, 'warning' => true, - 'danger' => false, + 'danger' => false, ), - 'WRITE_SETTINGS' => + 'WRITE_SETTINGS' => array( - 'cost' => false, + 'cost' => false, 'warning' => true, - 'danger' => false, + 'danger' => false, ), - 'WRITE_SMS' => + 'WRITE_SMS' => array( - 'cost' => false, + 'cost' => false, 'warning' => true, - 'danger' => false, + 'danger' => false, ), - 'WRITE_SOCIAL_STREAM' => + 'WRITE_SOCIAL_STREAM' => array( - 'cost' => false, + 'cost' => false, 'warning' => true, - 'danger' => false, + 'danger' => false, ), - 'WRITE_SYNC_SETTINGS' => + 'WRITE_SYNC_SETTINGS' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'WRITE_USER_DICTIONARY' => + 'WRITE_USER_DICTIONARY' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), - 'WRITE_VOICEMAIL' => + 'WRITE_VOICEMAIL' => array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ), ); private $xmlParser; diff --git a/lib/ApkParser/ManifestXmlElement.php b/lib/ApkParser/ManifestXmlElement.php index dbf149f..d4ea0b8 100644 --- a/lib/ApkParser/ManifestXmlElement.php +++ b/lib/ApkParser/ManifestXmlElement.php @@ -34,9 +34,9 @@ public function getPermissions($lang = 'en') 'flags' => isset($permissions[$permName]) ? $permissions[$permName]['flags'] : array( - 'cost' => false, + 'cost' => false, 'warning' => false, - 'danger' => false, + 'danger' => false, ) ); }