




































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





































































Question 1. Which component of Android’s security architecture is primarily responsible for enforcing the principle of least privilege for applications? A) Linux kernel B) Android Runtime (ART) C) Permission manager D) SELinux Answer: C Explanation: The permission manager evaluates an app’s manifest and grants only the permissions explicitly requested, enforcing least-privilege at the application layer. Question 2. In Android’s multi-layered security model, which layer provides hardware-based root of trust for boot verification? A) Application layer B) Kernel layer C) Hardware layer D) OS layer Answer: C Explanation: The hardware layer contains immutable boot ROM and TPM/StrongBox that start the chain of trust for Verified Boot. Question 3. What is the main difference between Full-Disk Encryption (FDE) and File-Based Encryption (FBE) in Android? A) FDE encrypts only system partitions, FBE encrypts user data files. B) FDE requires a device-wide password, FBE uses per-user keys. C) FDE encrypts data after boot, FBE encrypts data before boot. D) FDE uses asymmetric keys, FBE uses symmetric keys. Answer: B Explanation: FDE protects the entire userdata partition with a single key, while FBE encrypts each user’s files with separate keys derived from the user’s credentials. Question 4. Which SELinux mode enforces policy rules and denies any operation not explicitly allowed?
A) Permissive B) Enforcing C) Disabled D) Audit Answer: B Explanation: In Enforcing mode SELinux blocks any action that does not match an allow rule, providing mandatory access control. Question 5. How does Android verify the integrity of the boot image during Verified Boot? A) By checking the SHA-256 hash stored in the manifest. B) By validating a digital signature chained to the device’s hardware key. C) By comparing the boot image size with a known constant. D) By scanning the boot image for known malware signatures. Answer: B Explanation: Verified Boot uses a chain of trust where each boot component is signed; the signature is verified against a hardware-anchored key. Question 6. Which Android permission level is automatically granted to an app at install time without user interaction? A) Dangerous B) Normal C) Signature D) System Answer: B Explanation: Normal permissions are considered low-risk and are granted automatically by the package manager during installation. Question 7. When an Android app declares android:exported="true" for a Service, what security implication does this have? A) The Service can be started only by the same app. B) The Service is hidden from other apps. C) Other apps can bind or start the Service if they have matching intents.
Question 11. In Android’s network security configuration, which attribute disables cleartext (HTTP) traffic for a specific domain? A) B) C) D) Answer: A Explanation: Setting cleartextTrafficPermitted="false" inside a `` blocks HTTP for that domain. Question 12. Certificate pinning in Android helps mitigate which type of attack? A) Buffer overflow B) Man-in-the-middle (MITM) C) SQL injection D) Root exploit Answer: B Explanation: Pinning a known server certificate prevents attackers from presenting a fraudulent certificate, even if a CA is compromised. Question 13. Which API provides a user-friendly way to request biometric authentication on Android 9 (API 28) and later? A) FingerprintManager B) BiometricPrompt C) KeyguardManager D) SecurityTokenManager Answer: B Explanation: BiometricPrompt abstracts fingerprint, face, and iris authentication with a unified UI. Question 14. Which Android permission is required to scan for nearby Bluetooth devices starting from Android 12? A) BLUETOOTH
Answer: C Explanation: Android 12 introduced granular Bluetooth permissions; BLUETOOTH_SCAN is needed for device discovery. Question 15. What does the “Always-on VPN” setting enforce on an Android device? A) VPN connection only when the user opens a specific app. B) VPN connection is automatically established after boot and cannot be disabled without device admin. C) VPN is used only for Wi-Fi networks. D) VPN is limited to background services. Answer: B Explanation: “Always-on VPN” forces a VPN tunnel to stay up for all traffic, preventing bypass. Question 16. Which of the following is a characteristic of Android ransomware? A) It steals contacts and sends them to a remote server. B) It displays ads on the home screen. C) It encrypts user files and demands payment for decryption. D) It modifies the bootloader to persist. Answer: C Explanation: Ransomware encrypts user data and extorts the victim for a key to restore access. Question 17. Which Google Play Protect feature scans newly installed apps for known malware signatures? A) Real-time scanning B) Static code analysis C) Dynamic instrumentation D) Behavioral sandboxing
Explanation: FileProvider generates a content URI with temporary permissions, preventing path disclosure and enforcing ACLs. Question 21. Which Android permission group includes the READ_CONTACTS permission? A) Calendar B) Contacts C) Phone D) Body Sensors Answer: B Explanation: READ_CONTACTS belongs to the Contacts permission group, which is considered dangerous and requires runtime approval. Question 22. What does the android:sharedUserId attribute in the manifest enable? A) Running multiple apps under the same UID, allowing them to share data and permissions. B) Exporting activities to other apps. C) Restricting the app to a specific hardware feature. D) Declaring the app as a system app. Answer: A Explanation: sharedUserId lets apps with the same declared value run under a common Linux UID, sharing resources and permissions, but it increases attack surface. Question 23. Which of the following is a mitigation technique against intent-injection attacks? A) Declaring all activities as exported. B) Using explicit intents with component names. C) Allowing any app to send broadcasts. D) Disabling the Android manifest. Answer: B Explanation: Explicit intents specify the target component, preventing malicious apps from intercepting or spoofing the intent.
Question 24. In Android, which API level introduced scoped storage, changing how apps access external storage? A) API 21 B) API 23 C) API 29 D) API 30 Answer: C Explanation: Android 10 (API 29) introduced scoped storage, restricting direct file path access to external storage and encouraging use of MediaStore or SAF. Question 25. Which of the following best describes a “sandbox” in Android? A) A virtual machine that runs the entire OS. B) An isolated process with its own UID and limited permissions. C) A shared memory region for all apps. D) A debugging tool for developers. Answer: B Explanation: Each app runs in its own process with a unique UID, isolated from other apps, forming the sandbox. Question 26. Which Android feature helps protect cryptographic keys even on devices without a dedicated TEE? A) StrongBox B) Keymaster HAL C) Software-backed Keystore with hardware-derived root of trust D) Trusted Execution Environment (TEE) Answer: C Explanation: When a hardware TEE is unavailable, Android falls back to a software-backed Keystore that stores keys encrypted with a device-specific secret. Question 27. What is the effect of setting android:allowBackup="false" in the manifest? A) Disables OTA updates. B) Prevents the app’s data from being backed up by Google Backup Service.
Explanation: Android Lint includes checks for insecure coding patterns, such as hard-coded passwords. Question 31. What is the primary advantage of using the V4 signing scheme (APK Signature Scheme v4) introduced in Android 13? A) Supports signing of split APKs with a single signature. B) Enables per-file incremental signing for faster updates. C) Allows signing with elliptic-curve keys only. D) Removes the need for a keystore. Answer: B Explanation: V4 adds incremental signing, allowing only changed files to be re-signed, reducing update size and time. Question 32. Which Android API is used to enforce network security policies such as disabling cleartext traffic for the entire app? A) ConnectivityManager B) NetworkSecurityPolicy C) VpnService D) WifiManager Answer: B Explanation: NetworkSecurityPolicy provides runtime checks for cleartext traffic and other security configurations. Question 33. When an Android app uses KeyGenParameterSpec.Builder with setUserAuthenticationRequired(true), what does this enforce? A) The key can only be used after the device is unlocked with a PIN/password/biometric. B) The key is stored in clear text. C) The key is shared across all apps. D) The key is exported to external storage. Answer: A Explanation: setUserAuthenticationRequired ties key usage to successful user authentication, enhancing protection.
Question 34. Which of the following is NOT a valid reason to mark a BroadcastReceiver as android:exported="false"? A) To prevent other apps from sending it implicit intents. B) To limit the receiver to internal app events only. C) To allow the system to deliver boot completed broadcasts. D) To avoid accidental data leakage via broadcasts. Answer: C Explanation: System broadcasts can still be received even if exported=false as long as the receiver is registered in the manifest; the attribute does not block system intents. Question 35. What is the recommended way to store API keys that must be accessed by the app at runtime? A) Hard-code them in Java source files. B) Place them in plain-text in res/values/strings.xml. C) Store them in the Android Keystore as encrypted entries. D) Include them in the APK’s assets folder. Answer: C Explanation: Using the Keystore (or encrypted SharedPreferences with a key stored in the Keystore) protects the API key from extraction. Question 36. Which of the following Bluetooth pairing methods provides the highest security against eavesdropping? A) Just Works B) Passkey Entry C) Numeric Comparison D) Out-of-Band (OOB) Answer: D Explanation: OOB uses an external secure channel (e.g., NFC) to exchange pairing information, preventing man-in-the-middle attacks. Question 37. In Android, which file stores the list of trusted CA certificates used for TLS validation? A) /system/etc/security/cacerts
Answer: B Explanation: When backup is allowed, the backup service can export the app’s data, potentially exposing sensitive information. Question 41. Which of the following Android components can be used to expose data to other apps via a content URI? A) Service B) BroadcastReceiver C) ContentProvider D) Activity Answer: C Explanation: ContentProvider defines a contract for data sharing and returns content:// URIs that other apps can query. Question 42. Which Android API level introduced the “Scoped Storage” enforcement for apps targeting that version? A) API 27 B) API 28 C) API 29 D) API 30 Answer: C Explanation: API 29 (Android 10) made scoped storage mandatory for apps targeting the platform. Question 43. Which of the following is a common technique used by Android malware to gain persistence after device reboot? A) Registering a BOOT_COMPLETED broadcast receiver. B) Using AlarmManager with a repeating alarm. C) Storing data in SharedPreferences. D) Encrypting the boot image. Answer: A Explanation: A BOOT_COMPLETED receiver allows code to run automatically each time the device starts, providing persistence.
Question 44. What does the android:installLocation="internalOnly" attribute enforce? A) The app can be installed only on external SD cards. B) The app must be installed on internal storage, preventing movement to external media. C) The app can be installed on any storage location. D) The app is installed in a sandboxed virtual environment. Answer: B Explanation: internalOnly forces installation on the device’s internal storage, which is generally more secure than removable media. Question 45. Which of the following is the most secure way to transmit sensitive data from an Android app to a backend server? A) HTTP POST over port 80. B) HTTPS with TLS 1.2 or higher and certificate pinning. C) Sending data via SMS. D) Using a custom TCP socket without encryption. Answer: B Explanation: HTTPS provides encryption, and pinning ensures the client talks to the expected server, mitigating MITM attacks. Question 46. Which Android framework component is responsible for enforcing runtime permissions at the point of use? A) PackageManager B) ActivityManager C) PermissionControllerService D) AppOpsManager Answer: C Explanation: PermissionControllerService (part of the system UI) handles the user dialogs and records the grant status for runtime permissions. Question 47. In Android, which flag should be added to an Intent to prevent a malicious app from intercepting the broadcast? A) FLAG_ACTIVITY_NEW_TASK
Answer: B Explanation: Work Profiles create a separate container with its own policy set, keeping corporate data separate from personal data. Question 51. Which of the following is a direct consequence of setting android:debuggable="true" in a production APK? A) The app can be installed on the Play Store. B) The app’s code can be debugged and potentially inspected via adb. C) The app is automatically signed with a release key. D) The app runs in a sandbox with reduced permissions. Answer: B Explanation: debuggable=true allows adb to attach a debugger, exposing internal state and facilitating reverse engineering. Question 52. Which Android system service is responsible for enforcing SELinux policies? A) security service B) zygote process C) system_server D) selinux kernel module Answer: D Explanation: SELinux enforcement is performed by the kernel’s SELinux module, not a user-space service. Question 53. Which of the following is a recommended approach to protect against “Intent spoofing” when receiving data from other apps? A) Accept any incoming intent. B) Use Intent.getAction() without verification. C) Validate the sender’s UID with getCallingUid() in a BroadcastReceiver. D) Declare the receiver as exported. Answer: C Explanation: Checking the caller’s UID ensures the intent originates from a trusted source.
Question 54. In Android, which permission is required to access the device’s location in the background on Android 10 (API 29) and later? A) ACCESS_COARSE_LOCATION B) ACCESS_FINE_LOCATION C) ACCESS_BACKGROUND_LOCATION D) ACCESS_LOCATION_EXTRA_COMMANDS Answer: C Explanation: ACCESS_BACKGROUND_LOCATION explicitly grants location access when the app is not in the foreground. Question 55. Which of the following is a primary advantage of using the “SafetyNet Attestation API” in an Android app? A) It provides hardware-backed verification of device integrity. B) It replaces the need for runtime permissions. C) It disables the lock screen. D) It encrypts all network traffic automatically. Answer: A Explanation: SafetyNet attestation checks device integrity (boot state, system image, etc.) and returns a signed response. Question 56. Which Android build option enables “enforced” SELinux mode for user builds? A) ro.debuggable=1 B) ro.secure=0 C) ro.selinux=enforcing D) ro.adb.secure=1 Answer: C Explanation: Setting ro.selinux=enforcing forces SELinux to block violations instead of just logging them. Question 57. What is the purpose of the “Keymaster” HAL in Android’s security architecture? A) To provide a hardware abstraction layer for cryptographic operations and key management.
Answer: C Explanation: BiometricPrompt was added in Android 9 (API 28). Question 61. Which of the following is a recommended way to protect secret keys used for encrypting data at rest in an Android app? A) Store the key in a static Java field. B) Use the Android Keystore with hardware-backed protection. C) Write the key to a file on external storage. D) Embed the key in the app’s resources. Answer: B Explanation: The Keystore isolates keys from the app process and can store them in a TEE, preventing extraction. Question 62. What is the main security purpose of the “SafetyNet ReCAPTCHA” API? A) To verify that a user is a human and not a bot. B) To encrypt network traffic. C) To provide device attestation for integrity checks. D) To manage app signing keys. Answer: A Explanation: SafetyNet ReCAPTCHA challenges users to prove they are not automated scripts. Question 63. Which of the following Android system features can be leveraged to prevent an app from being installed on rooted devices? A) Checking Build.FINGERPRINT. B) Using SafetyNet Attestation and rejecting devices that fail integrity checks. C) Verifying the presence of Google Play Services. D) Detecting the device’s screen size. Answer: B Explanation: SafetyNet can detect rooting and custom ROMs; apps can refuse installation or limit functionality on compromised devices.
Question 64. Which Android component can be used to receive the BOOT_COMPLETED broadcast after device startup? A) Service B) BroadcastReceiver C) ContentProvider D) Activity Answer: B Explanation: A BroadcastReceiver registered for BOOT_COMPLETED will be invoked once the system finishes booting. Question 65. Which of the following is the most secure method for delivering OTA updates to an Android device? A) HTTP download without verification. B) Signed update packages verified by the bootloader using AVB. C) Copying the update file via USB mass storage. D) Sending the update via SMS. Answer: B Explanation: OTA packages are signed; the bootloader verifies the signature using AVB before applying the update, ensuring authenticity. Question 66. Which Android permission is considered “signature” level and can only be granted to apps signed with the same certificate as the declaring app? A) READ_CONTACTS B) ACCESS_WIFI_STATE C) WRITE_SECURE_SETTINGS D) CAMERA Answer: C Explanation: WRITE_SECURE_SETTINGS is a signature permission, granted only to apps sharing the platform’s signing key. Question 67. Which of the following is a typical symptom of a “Man-in-the-Middle” attack on an Android app that uses TLS without certificate pinning? A) The app crashes on launch.