Secure Android Design and Development (The Course)
$129.00
Minimum price
$179.00
Suggested price

Course Info

This course includes 5 attempts.

"Secure Android Design & Development" is a guideline for developers working with Android in various sectors, including automotive and mobile devices. This book deepens your understanding of system security architecture, which is crucial for effective design, development, and security.

It covers key principles and thoroughly examines Android's layered security model. With practical scenarios and tools for threat assessment, this guide empowers developers to create secure and resilient applications for any Android-enabled platform.

  • Comprehensive Coverage: Explore essential security principles and methodologies tailored for Android development across various industries, including automotive and mobile devices.
  • System-Level Security Insights: Gain a deeper understanding of system security architecture, enhancing your ability to design, develop, and secure robust applications.
  • Practical Guidance: Benefit from real-world scenarios and actionable strategies to effectively address security challenges through best practices.
  • Threat Assessment Tools: Learn to utilize modern tools and techniques for threat modeling throughout the development lifecycle.
  • For All Developers: Suitable for seasoned professionals and newcomers, making security concepts accessible and applicable.
  • Aligns with Android 15

Secure Android Development Guide – Best Practices for Android App Security

Share

Categories

  • Android
  • Computer Security

Course Material

  • 1. Brief
  • No magic at all!
  • Who is the course written for?
  • 2. The big picture
  • Do We Need to Secure an Android Application?
  • Different Use Cases and Their Security Considerations
  • Security as a Spectrum, Not a Binary Choice
  • Artboard 3 Created with Sketch.
    Exercise 1
  • icon/quiz Created with Sketch.
    Quiz 13 attempts allowed
  • 3. Principles and Methodologies
  • Gravity of principles (The rules of the game)
  • The Fail-Safe vs Fail-Secure Principle (Planning for the Unexpected)
  • Fail-Safe Principle in Software Development
  • Fail-Secure Principle
  • Saltzer-Schroeder article
  • Least Common Mechanism
  • The Significance of the Principle
  • Practical Examples
  • Artboard 3 Created with Sketch.
    Exercise 2
  • Separation of Privilege and Least Privilege
  • Some of the benefits of Least Privilege
  • Some of the benefits of the Separation of Privilege
  • Examples of Separation of Privilege & Least Privilege
  • Artboard 3 Created with Sketch.
    Exercise 3
  • The Zero Trust Principle: Trust No One, Verify Everything
  • Examples of Zero Trust
  • Access Control:
  • Micro-segmentation:
  • Multi-factor Authentication (MFA):
  • Applying Zero Trust to Android Development
  • SELinux & App permissions
  • Artboard 3 Created with Sketch.
    Exercise 4
  • KISS: The Principle of Least Complexity in Security
  • Examples of the Principle of Least Complexity in Android
  • Some KISS principle best practices
  • Artboard 3 Created with Sketch.
    Exercise 5
  • Defense in Depth
  • Examples
  • Physical Security:
  • Network Security:
  • Application Security:
  • Data Security:
  • User Training and Awareness:
  • Artboard 3 Created with Sketch.
    Exercise 6
  • Defensive, Offensive, and Aggressive Programming
  • Development stance
  • Development method (methodology)
  • Defensive programming
  • When to use Defensive programming
  • Pros
  • Cons
  • Offensive programming
  • What is acceptable?
  • What should be handled
  • Pros
  • Cons
  • Aggressive programming
  • Best practice
  • Artboard 3 Created with Sketch.
    Exercise 7
  • Notes on Modularity, cohesion, and coupling
  • The Importance of Software Design and Implementation Beyond Platform-Specific Techniques
  • Principles and Software Complexity
  • Software Complexity and Security Risks
  • Final Thoughts on Core Programming Concepts
  • Artboard 3 Created with Sketch.
    Exercise 8
  • icon/quiz Created with Sketch.
    Quiz 23 attempts allowed
  • 4. Securing the Development Lifecycle
  • Design Review
  • Artboard 3 Created with Sketch.
    Exercise 9
  • Code Review
  • The imperative role of code review
  • Kick-off Meeting
  • Code Review Checklist
  • Security Code Review Process
  • Preparation:
  • Static Analysis:
  • Dynamic Analysis:
  • Post-Review:
  • Manual Code Review
  • Developer Updates and Follow-up
  • Follow coding standards and best practices:
  • Look for common security vulnerabilities:
  • Understand the dependencies:
  • Conduct threat modeling:
  • Use automated tools and perform manual reviews:
  • Security Code Review Examples
  • An example of URL Injection
  • Artboard 3 Created with Sketch.
    Exercise 10
  • Regular Security Assessments
  • Importance of Regular Security Assessments
  • Important Elements of Continual Assessments
  • Artboard 3 Created with Sketch.
    Exercise 11
  • Security Requirements
  • Code Integrity
  • Booting Securely
  • Compiler Optimizations
  • Address Space Layout Randomization (ASLR)
  • Code Obfuscation
  • Data Protection
  • Authentication and Authorization
  • Strengthened Authentication
  • RBAC or role-based access Control
  • Incident Response
  • Monitoring and Logging
  • Updates on Security
  • Plan for Security Incident Response
  • Artboard 3 Created with Sketch.
    Exercise 12
  • Integrating Security Testing
  • Security Testing Methods
  • Static Application Security Testing and Static Code Analyzers (SAST)
  • Dynamic Application Security Testing (DAST)
  • Penetration Testing
  • Fuzz testing
  • Security Testing Techniques and Tools
  • Code Review
  • AI
  • Secure Code Libraries
  • Integrating Security Testing into Android Development
  • Continuous Integration Pipeline
  • Security Testing Examples
  • Artboard 3 Created with Sketch.
    Exercise 13
  • icon/quiz Created with Sketch.
    Quiz 33 attempts allowed
  • 5. Threat Modeling, Standards and Guidelines
  • Shostack’s Four Question Framework
  • Artboard 3 Created with Sketch.
    Exercise 14
  • Threat Modelling frameworks
  • TARA
  • Artboard 3 Created with Sketch.
    Exercise 15
  • Security Standards and Guidelines
  • Some organization to know
  • MITRE
  • CVE
  • CWE
  • OWASP
  • Choosing the Right Framework
  • Artboard 3 Created with Sketch.
    Exercise 16
  • Some keywords to know
  • Vulnerability Severity Score
  • Vulnerability Risk
  • Attack Vector
  • Attack Surface
  • Privilege Escalation
  • Zero-Day Vulnerability
  • Artboard 3 Created with Sketch.
    Exercise 17
  • icon/quiz Created with Sketch.
    Quiz 43 attempts allowed
  • 6. Attack and Defense
  • We don’t need to experience it again!
  • Why are we not learning from history?
  • Let’s simplify
  • All the ways to get inside
  • Different Scenarios
  • General steps
  • An insider
  • The plane is hijacked
  • No guard watching the doors
  • Shaky building
  • Superhero is forbidden!
  • You don’t know my language
  • He has a mask
  • Artboard 3 Created with Sketch.
    Exercise 18
  • How you will be attacked
  • Unfold the target
  • Extract information from the unfolded app
  • Look for a vulnerability
  • Examine the founding
  • Prepare to attack
  • Attack
  • Artboard 3 Created with Sketch.
    Exercise 19
  • How to Defend
  • Defensive Techniques
  • In the development process
  • Minimizing the surface attack
  • Compiler & tools
  • Run-time
  • Implementation & Language Specific
  • Data Protection
  • Network & protocols
  • OS Mechanisms
  • Libraries
  • System level
  • Testing
  • Artboard 3 Created with Sketch.
    Exercise 20
  • Act as a chief
  • icon/quiz Created with Sketch.
    Quiz 53 attempts allowed
  • 7. Common Programming Mistakes
  • Memory safety
  • The Challenge of Memory Safety in C and C++
  • Rust: A Safer Alternative?
  • Why Hasn’t Rust Been Widely Adopted Yet?
  • A Potential Transition Strategy
  • Artboard 3 Created with Sketch.
    Exercise 21
  • C and C++
  • Buffer overflow & Out-of-bund write
  • Expired pointer dereference (CWE-825)
  • Use after free (CWE-416)
  • Double free (CWE-415)
  • Out-of-Bounds Read (CWE-125)
  • Buffer Over-Read (CWE-126)
  • Buffer Under-Read (CWE-127)
  • NULL Pointer Dereference (CWE-476)
  • Access of Uninitialized Pointer (CWE-824)
  • Artboard 3 Created with Sketch.
    Exercise 22
  • Java
  • Serialization Vulnerabilities (CWE-502: Deserialization of Untrusted Data)
  • Ineffective Exception Handling (CWE-209: Information Exposure Through Error Messages)
  • Use of Reflection (CWE-470: Use of Externally-Controlled Input to Select Classes or Code)
  • Insecure Configuration and Hard-Coded Credentials (CWE-798: Use of Hard-coded Credentials)
  • Unchecked Input Leading to Injection (CWE-89: SQL Injection, CWE-79: XSS)
  • Integer Overflow/Underflow (CWE-190 / CWE-191)
  • Artboard 3 Created with Sketch.
    Exercise 23
  • Kotlin
  • Null Safety Misconceptions
  • Improper Coroutines Usage (Race Conditions and Data Races)
  • Extension Functions Misuse
  • Data Class Copy Functions
  • Default Parameters and Overloading
  • NULL Pointer Dereference (CWE-476)
  • Artboard 3 Created with Sketch.
    Exercise 24
  • Real world examples
  • Linux-Related CVEs
  • Android-Related CVEs
  • Artboard 3 Created with Sketch.
    Exercise 25
  • icon/quiz Created with Sketch.
    Quiz 63 attempts allowed
  • 8. Data Validation
  • Untrusted Data Sources
  • Types of Untrusted Data Sources
  • External storage:
  • User input:
  • Network connections:
  • Third-party libraries:
  • Dealing with Untrusted Data Sources
  • Input validation:
  • Encoding and escaping data:
  • Limiting third-party library usage:
  • Sandboxing and isolation:
  • Artboard 3 Created with Sketch.
    Exercise 26
  • Input Validation
  • Input Range Validation
  • Input Length Validation
  • Importance of Input Length Restrictions
  • Prevention of Buffer Overflow Attacks
  • Protection Against Denial of Service (DoS) Attacks
  • Data Integrity
  • Usability
  • Implementation Techniques
  • Whitelisting and Blacklisting
  • Input format
  • Regular Expressions
  • Type-checking and Casting
  • Application Framework and Library Input Validation
  • Some libraries and methods for input validation:
  • Real-life Incidents
  • The Morris Worm (1988):
  • The infamous Heartbleed bug that affected OpenSSL (2014):
  • Artboard 3 Created with Sketch.
    Exercise 27
  • Encoding Methods
  • HTML Encoding
  • URL Encoding
  • JavaScript Encoding
  • SQL Encoding or SQL Escaping
  • Unicode Encoding
  • Incidents and History
  • Artboard 3 Created with Sketch.
    Exercise 28
  • Sanitizing user inputs
  • Importance of Input Sanitization
  • SQL Injection:
  • Cross-site scripting (XSS):
  • Command Injection:
  • Buffer Overflow:
  • Why use Input Sanitization Libraries?
  • Input Sanitization Libraries for C/C++
  • Libinjection:
  • StringSan:
  • libtidy:
  • Input Sanitization Libraries for Java
  • OWASP ESAPI:
  • Apache Commons Validator:
  • Google Guava:
  • Input Sanitization Libraries in Kotlin (Android)
  • Android Saripaar:
  • Validators Kotlin:
  • Artboard 3 Created with Sketch.
    Exercise 29
  • icon/quiz Created with Sketch.
    Quiz 73 attempts allowed
  • 9. Android Security Model
  • Let’s open the onion layers
  • Artboard 3 Created with Sketch.
    Exercise 30
  • Application Sandbox and Android Runtime
  • Artboard 3 Created with Sketch.
    Exercise 31
  • Application Signing
  • Artboard 3 Created with Sketch.
    Exercise 32
  • Permission and Package Manager
  • Artboard 3 Created with Sketch.
    Exercise 33
  • SELinux
  • Artboard 3 Created with Sketch.
    Exercise 34
  • AndroidManifest and Components
  • Inter-process communication
  • AIDL (application level)
  • Service Binding
  • Interface Methods
  • AIDL Transaction Security
  • Bound Services Security
  • Cross-process Communication
  • Broadcasts and Intents
  • Android Broadcasts
  • Securing Android Broadcasts
  • Android Intents
  • Securing Android Intents
  • Content provider
  • Example Implementation
  • Artboard 3 Created with Sketch.
    Exercise 35
  • HAL Layer
  • System Daemon Isolation
  • Hardware Abstraction Security
  • Vendor HAL and Secure Implementation
  • Binderized HAL
  • HIDL (HAL Interface Definition Language)
  • Direct Memory Access (DMA)
  • Artboard 3 Created with Sketch.
    Exercise 36
  • Play Integrity
  • Play Integrity API: A Comprehensive Solution
  • Key Considerations for Play Integrity API Implementation
  • Play Integrity API Integration
  • Platform Compatibility
  • 9.1 Play Integrity API: A Comprehensive Solution
  • 9.2 Key Considerations for Play Integrity API Implementation
  • 9.3 Play Integrity API Integration
  • 9.4 Platform Compatibility
  • Artboard 3 Created with Sketch.
    Exercise 37
  • Jetpack libraries
  • icon/quiz Created with Sketch.
    Quiz 83 attempts allowed
  • 10. Protecting Data
  • Data life-cycle
  • In-Transit
  • In-Memory
  • Temporary
  • Persistent (Long-Term)
  • Artboard 3 Created with Sketch.
    Exercise 38
  • What Google has done to address insecure storage
  • Recent Android security improvements
  • Scoped Storage
  • Secure File Storage
  • Android Keychain and KeyStore for Secure Credential Storage
  • Keychain and KeyStore: A Brief Overview
  • Using the Android Keychain for Secure Credential Storage
  • Using the Android KeyStore for Secure Key Storage
  • Using Hardware-Backed Keys for Added Security
  • SharedPreference - Securely storing
  • Encrypt SQLite Database (SQLCipher + Room)
  • Dynamic Code Loading Restrictions (Android 14)
  • Artboard 3 Created with Sketch.
    Exercise 39
  • File Integrity Verification
  • Artboard 3 Created with Sketch.
    Exercise 40
  • Private Space
  • Artboard 3 Created with Sketch.
    Exercise 41
  • icon/quiz Created with Sketch.
    Quiz 93 attempts allowed
  • 11. Authentication, Network, and Protocols
  • Android AccountManager for Access Control
  • Credential Manager
  • Artboard 3 Created with Sketch.
    Exercise 42
  • Android Biometric Authentication
  • History of Biometric Authentication
  • Advantages of Biometric Authentication
  • Integrating Android Biometric Authentication
  • Potential Risks
  • Artboard 3 Created with Sketch.
    Exercise 43
  • Android Network Security Configuration
  • Overview
  • Components
  • Examples
  • Implementation
  • Artboard 3 Created with Sketch.
    Exercise 44
  • Sniffing
  • Security Considerations:
  • Best Practices
  • Traffic Protection
  • Data Handling
  • Artboard 3 Created with Sketch.
    Exercise 45
  • Certificate Pinning in Android Applications
  • What Is Certificate Pinning?
  • Another example for OkHttp
  • Artboard 3 Created with Sketch.
    Exercise 46
  • Implementing SSL/TLS for Android Network Communications
  • Artboard 3 Created with Sketch.
    Exercise 47
  • OAuth and OpenID Connect for Android Applications
  • OAuth
  • OAuth 2.0 defines four grant types (authorization flows) to acquire an access token:
  • OpenID Connect
  • OIDC extends OAuth by providing additional features like:
  • Implementing OAuth and OIDC in Android Applications
  • Artboard 3 Created with Sketch.
    Exercise 48
  • Bluetooth
  • Bluetooth Security Protocols
  • Classic Bluetooth vs. Bluetooth Low Energy (BLE)
  • Pairing Modes
  • Man-in-the-Middle (MITM) Protection
  • Bluetooth Profiles and Associated Risks
  • Securing BLE Advertising and GATT Communications
  • Nearby Permissions
  • Preventing Bluetooth Sniffing
  • Artboard 3 Created with Sketch.
    Exercise 49
  • icon/quiz Created with Sketch.
    Quiz 103 attempts allowed
  • 12. Practical Scenarios
  • Financial Android Application
  • Project Description
  • Architecture
  • 1) What are we building?
  • 2) What can go wrong?
  • 3) What are we going to do about it?
  • Protect Stored Data
  • Network Security & Anti-MITM
  • Credential & QR Security
  • Push Notification Safety
  • Logging & Cache Protections
  • 4) Did we do a good job?
  • Artboard 3 Created with Sketch.
    Exercise 50
  • Key Provider Service
  • Project Description
  • Architecture
  • 1) What are we building?
  • 2) What can go wrong?
  • 3) What are we going to do about it?
  • Restricting the AIDL Interface
  • Secure Key Storage
  • Secure Remote Fetch (If Applicable)
  • Minimal Privileges & SELinux
  • 4) Did we do a good job?
  • Artboard 3 Created with Sketch.
    Exercise 51
  • Sensor HAL Layer Daemon
  • Project Description
  • Architecture
  • 1) What are we building?
  • 2) What can go wrong?
  • 3) What are we going to do about it?
  • Secure SOME/IP
  • Subscription Access Control
  • DoS Mitigation
  • Privilege Separation
  • 4) Did we do a good job?
  • Artboard 3 Created with Sketch.
    Exercise 52
  • Vehicle Data Logger Application
  • Project Description
  • Architecture
  • 1) What are we building?
  • 2) What can go wrong?
  • 3) What are we going to do about it?
  • Encrypt Data at Rest
  • Secure Bluetooth Pairing & Transfer
  • Physical Security & Consent
  • Logs/Cache Management
  • 4) Did we do a good job?
  • Artboard 3 Created with Sketch.
    Exercise 53
  • icon/quiz Created with Sketch.
    Quiz 113 attempts allowed
  • 13. Compilers and Tools
  • Clang and GCC Security Features
  • Compiler Warnings
  • Stack Protection
  • Address Space Layout Randomization (ASLR)
  • Library order randomization
  • Data Execution Prevention (DEP)
  • Control Flow Integrity (CFI)
  • Fortify Source
  • Android Sanitizer
  • Artboard 3 Created with Sketch.
    Exercise 54
  • Obfuscation
  • What is Obfuscation?
  • Minifying or shrinking is not obfuscation!
  • ProGuard and its Role in Obfuscation
  • An Example of ProGuard’s Obfuscation
  • The most important features of ProGuard
  • Code Shrinking:
  • Code Obfuscation:
  • Code Optimization:
  • Pre-verification:
  • proguard-android.txt:
  • proguard-android-optimize.txt:
  • Pros and Cons of Using ProGuard
  • Pros:
  • Cons:
  • Retrofit
  • Gson
  • Room
  • R8
  • Artboard 3 Created with Sketch.
    Exercise 55
  • Notes on hiding keys, secrets and credentials
  • Artboard 3 Created with Sketch.
    Exercise 56
  • Static and Dynamic Analysis Tools
  • What is static and dynamic code analysis?
  • Static Code Analysis
  • C/C++
  • Java
  • Kotlin
  • Python
  • CppCheck output
  • cpplint output
  • checkstyle
  • Dynamic Code Analysis
  • C/C++
  • Java
  • Kotlin
  • Android
  • Python
  • Hints on Static Analyzer tools
  • Example of Dynamic Code Analysis in Android:
  • Artboard 3 Created with Sketch.
    Exercise 57
  • icon/quiz Created with Sketch.
    Quiz 123 attempts allowed
  • 14. Appendices
  • Last word
  • About the Author
  • Abbreviations Glossary
  • References
  • Security Standards and Guidelines
  • A detailed STRIDE and TARA comparison
  • Useful tools

Instructors

    • With over 15 years in embedded development, he specializes in creating system-level services for automotive, telecom, and industrial applications. His background in electronic engineering and focus on security give him a holistic understanding of systems across web, Windows, and embedded platforms. Throughout his career, he’s held roles from developer to project manager, deepening his expertise across multiple technical perspectives. Inspired by challenges in Android security, particularly in AAOS/AOSP, he wrote this book to share with developers.

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earnedover $14 millionwriting, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub