Latest / CyberCode Academy / Course 42 - Mobile Malware Analysis Fundamentals | Episode 4: iOS Security and Android Frameworks
Transcript
- 0:00Speaker 1: Look down at the device you might be holding right now,
- 0:02Speaker 1: or you know, the one sitting next to you on
- 0:04Speaker 1: your desk, you'll probably just think of it as a phone, right,
- 0:07Speaker 1: But it's really.
- 0:07Speaker 2: Not, No, definitely not. I mean that smooth glass and
- 0:10Speaker 2: the fluid animations, it's a really convincing disguise for a
- 0:15Speaker 2: literal supercomputer. Like it has significantly more processing power than
- 0:19Speaker 2: the mainframes that guided the Apollo missions to the Moon.
- 0:22Speaker 1: Which is wild to think about. And every single time
- 0:26Speaker 1: you walk past a coffee shop or drop into a
- 0:28Speaker 1: subway station or I don't know, download a seemingly harmless
- 0:32Speaker 1: flashlight app, that supercomputer is basically fighting off invisible automated
- 0:37Speaker 1: attacks in milliseconds.
- 0:39Speaker 2: Right. We carry around these sprawling, hidden digital metropolis in
- 0:42Speaker 2: our pockets. They're layered with incredibly complex code and security protocols,
- 0:47Speaker 2: and because it all works so seamlessly most of the time,
- 0:49Speaker 2: just to send a text or play a video, we
- 0:51Speaker 2: remain well completely oblivious to the chaos happening toneath the.
- 0:55Speaker 1: Surface, which is exactly our mission for this deep dive. Today.
- 0:58Speaker 1: We are cracking open to absolute titans of the mobile world,
- 1:02Speaker 1: iOS and Android.
- 1:04Speaker 2: Yeah, we're going to decode the architectural blueprints of how
- 1:07Speaker 2: they're built. You know, how they try to keep your data.
- 1:09Speaker 1: Safe, and how they sometimes completely fail at that.
- 1:12Speaker 2: Job exactly, and also this surprisingly chaotic history of how
- 1:17Speaker 2: they came to exist in the first place.
- 1:19Speaker 1: So to really understand what we're dealing with here, we
- 1:22Speaker 1: basically have to start by throwing out the word phone, right.
- 1:25Speaker 2: Oh absolutely. Colloquially sure, call it a phone, But structurally
- 1:30Speaker 2: it is a full blown desktop computer, shrunk down to
- 1:34Speaker 2: fit in the palm of your hand.
- 1:35Speaker 1: Okay, but if they are structurally desktop computers, I have
- 1:38Speaker 1: to assume they inherit like all the baggage that comes.
- 1:41Speaker 2: With that, every single piece of it. If a specific
- 1:44Speaker 2: type of vulnerability exists on a traditional desktop operating system,
- 1:48Speaker 2: a variation of it already exists or is currently being
- 1:51Speaker 2: engineered for a mobile device.
- 1:53Speaker 1: Okay, let me push back on that logic for a second, though.
- 1:55Speaker 1: If I have a literal desktop computer in my pocket,
- 1:58Speaker 1: why aren't we seeing massive world ending worms and viruses
- 2:02Speaker 1: completely bricking millions of smartphones like we used to see
- 2:05Speaker 1: on Windows computers back in the late nineties and early
- 2:09Speaker 1: two thousands.
- 2:10Speaker 2: That's a great question. It's because the architecture is completely different,
- 2:14Speaker 2: which changes the fundamental nature of the risk. And in
- 2:17Speaker 2: the cybersecurity world, we don't use the word risk casually.
- 2:21Speaker 1: Right, It's an actual calculation exactly.
- 2:23Speaker 2: We calculate it using a very specific formula. Mobile risk
- 2:27Speaker 2: is the summation of vulnerabilities, threats, and assets. When those
- 2:31Speaker 2: three things align, you get a risk.
- 2:33Speaker 1: And risk is basically defined as anything that leads to
- 2:36Speaker 1: harm or loss to a person or a company due
- 2:39Speaker 1: to that device. Sot on, let's break that formula down
- 2:42Speaker 1: a bit because threat and risk they usually get used
- 2:47Speaker 1: interchangeably in everyday conversation. So are we saying the thread
- 2:51Speaker 1: is the active element, like a burglar walking around your
- 2:53Speaker 1: neighborhood holding a crowbar. Yes, And the vulnerability is the
- 2:56Speaker 1: fact that you say, left your kitchen window unlock.
- 3:00Speaker 2: Perfect analogy, and your television sitting in the living room.
- 3:03Speaker 2: That's the asset. So the threat is the attacker or
- 3:06Speaker 2: the malicious code. The vulnerability is the flaw in the
- 3:09Speaker 2: software the unlocked window, and the risk is the calculated
- 3:13Speaker 2: likelihood that the burglar will actually find that specific window,
- 3:17Speaker 2: get inside and steal the TV.
- 3:18Speaker 1: Okay, So applying that to these devices, the risk profile
- 3:22Speaker 1: is completely unique because a desktop computer usually sits in
- 3:26Speaker 1: one locked office, right on one secure static network, But
- 3:31Speaker 1: a mobile device is a nightmare of physical and network variables.
- 3:35Speaker 2: Oh totally, First, just physical security. You can easily just
- 3:37Speaker 2: leave this supercomputer on a table at a restaurant, and
- 3:40Speaker 2: physical access changes the game entirely. If someone can physically
- 3:44Speaker 2: hold your device, the digital security layers are already fighting
- 3:47Speaker 2: a losing battle.
- 3:48Speaker 1: Yeah, that makes sense.
- 3:49Speaker 2: But beyond the physical size, consider the network behavior. When
- 3:53Speaker 2: you leave your house, your device drops your secure home
- 3:56Speaker 2: Wi Fi. As you walk down the street, it aggressively
- 3:59Speaker 2: handshakes with five G cell towers.
- 4:01Speaker 1: You step into an elevator, it drops to three G.
- 4:03Speaker 2: Right, you sit down in a cafe, and it silently
- 4:05Speaker 2: connects to a completely open, unencrypted public Wi Fi network.
- 4:09Speaker 1: It's just constantly screaming out into the void like who
- 4:12Speaker 1: was out there? Can I connect to you?
- 4:14Speaker 2: All day long? And that constant network handoff creates massive
- 4:18Speaker 2: windows of opportunity for an attacker to intercept data. And
- 4:21Speaker 2: that's layered on top of the incredibly complex operating system
- 4:24Speaker 2: vulnerabilities we really need to talk about.
- 4:27Speaker 1: Well, let's look at how these companies try to board
- 4:29Speaker 1: up those unlocked windows. We'll start with the famously restrictive
- 4:33Speaker 1: walled garden. Let's peel the Apple and look at the
- 4:36Speaker 1: iOS architecture.
- 4:38Speaker 2: Apple's philosophy is total control, and that is fundamentally a
- 4:41Speaker 2: security decision. They build iOS on a few core pillars
- 4:44Speaker 2: system security, data security, application security, and network security.
- 4:49Speaker 1: Now, for network security, they aren't reinventing the wheel, right.
- 4:52Speaker 1: They use industry standard technologies like SSL and TLS, So
- 4:56Speaker 1: if you're sending secured data, it's encrypted in transit, just
- 4:59Speaker 1: like it would be on your laptop exactly.
- 5:01Speaker 2: They rely on proving cryptography for the network side of things.
- 5:05Speaker 2: But where iOS really defines its unique security posture is
- 5:09Speaker 2: in the application layer, the topmost layer of the iOS architecture,
- 5:13Speaker 2: the environment where the apps actually live and run. That's
- 5:17Speaker 2: called Cocoa Touch.
- 5:18Speaker 1: Aside from being a great name, Coco Touch is famous
- 5:21Speaker 1: for how it isolates things. Yeah, every single app on
- 5:24Speaker 1: an iPhone runs in what Apple calls a sandbox, A.
- 5:28Speaker 2: Very restrictive sandbox.
- 5:29Speaker 1: Yeah. I've always heard it described as Toddler's in separate playpens.
- 5:33Speaker 1: Like they have their own toys. They can do what
- 5:34Speaker 1: they want in their space. That can't interact with each other.
- 5:37Speaker 2: It's a good visual, but it goes much deeper than
- 5:39Speaker 2: just separate playpens. It is an actively enforced perimeter. The
- 5:43Speaker 2: operating system acts like a hypervigilant guard.
- 5:46Speaker 1: Oh wow.
- 5:46Speaker 2: Yeah. If the toddler even reaches a hand outside the
- 5:49Speaker 2: playpen to grab a file, or change a system preference,
- 5:52Speaker 2: or access a network resource that doesn't explicitly belong to it,
- 5:55Speaker 2: the system physically blocks the action.
- 5:58Speaker 1: So an app cannot do anything out there sited sandbox
- 6:01Speaker 1: unless it explicitly requests permission.
- 6:03Speaker 2: Right. It has to ask the cooperating system, and the
- 6:06Speaker 2: OS has to grant.
- 6:07Speaker 1: It, Meaning a poorly coded app can't accidentally crash another app,
- 6:12Speaker 1: and a malicious app can't just quietly reach over and
- 6:15Speaker 1: steal the data from your.
- 6:16Speaker 2: Banking app exactly. And this stript control extends to how
- 6:19Speaker 2: an app is actually constructed too. The anatomy of an
- 6:22Speaker 2: iOS app is incredibly streamlined to reduce the attack surface.
- 6:27Speaker 2: To run, it only requires three specific components.
- 6:30Speaker 1: It's essentially just an info list right, which acts as
- 6:33Speaker 1: a configuration file telling the OS what the app is
- 6:35Speaker 1: supposed to be doing. Yep. Then you have the compiled executable,
- 6:38Speaker 1: which is the actual raw code of the application itself,
- 6:41Speaker 1: and finally the icon image. So you have a button
- 6:44Speaker 1: to tap on your screen. That's literally it, and.
- 6:46Speaker 2: That simplicity makes it so much easier for the system
- 6:49Speaker 2: to monitor.
- 6:50Speaker 1: But you know, inevitably, human nature dictates that if you
- 6:53Speaker 1: build a wall, someone wants to climb.
- 6:54Speaker 2: Over it always.
- 6:55Speaker 1: What if you don't want to play by Apple's strict rules.
- 6:58Speaker 1: What if you want to customize your interface or tweak
- 7:00Speaker 1: deep system settings, or install an app that Apple actively banned?
- 7:05Speaker 1: This brings us to jail breaking, right.
- 7:07Speaker 2: Jail Breaking is the process of deliberately removing the device
- 7:10Speaker 2: restrictions put in place by the manufacturer. You are intentionally
- 7:14Speaker 2: breaking the sandbox.
- 7:15Speaker 1: And there isn't just one universal jail break button. It
- 7:18Speaker 1: really depends on what kind of flaw you managed to
- 7:21Speaker 1: find in Apple's armor. Let's walk through the mechanics of these.
- 7:25Speaker 1: The earliest and most fundamental is the tether jail break.
- 7:29Speaker 2: Right. A tether jail break requires the user to plug
- 7:32Speaker 2: the device into a computer via a USB cable every
- 7:36Speaker 2: single time the device.
- 7:37Speaker 1: Reboots every single time.
- 7:38Speaker 2: Yeah, this is because tether jail breaks usually exploit a
- 7:42Speaker 2: vulnerability in the physical hardware of the device itself.
- 7:45Speaker 1: So because it's a hardware flaw, Apple can't just send
- 7:49Speaker 1: an over the air software update to.
- 7:50Speaker 2: Patch it, exactly, they can't patch hardware over Wi Fi.
- 7:53Speaker 1: But on the flip side, because the device's hardware is
- 7:56Speaker 1: hardwired to boot up securely, the moment the phone loses
- 7:59Speaker 1: power in reboots, it forgets the jail break. It reverts
- 8:03Speaker 1: to its secure state, and you're locked out of your
- 8:05Speaker 1: phone until you get home, plug it into your laptop
- 8:08Speaker 1: and reinject the code.
- 8:09Speaker 2: Which is incredibly inconvenient. I mean, if your battery dies
- 8:12Speaker 2: on a road trip, your phone is a paperweight until
- 8:15Speaker 2: you find a computer. So security researchers and hackers eventually
- 8:19Speaker 2: developed the untethered jail break.
- 8:21Speaker 1: I assume this means no cable.
- 8:23Speaker 2: Required, no computer needed for a reboot at all. Untethered
- 8:27Speaker 2: jail breaks don't attack the hardware. They attack flaws deep
- 8:31Speaker 2: within the iOS kernel, the absolute core software of the
- 8:34Speaker 2: operating system.
- 8:35Speaker 1: Wow.
- 8:36Speaker 2: Yeah. Once a user triggers the exploit, often just by
- 8:39Speaker 2: visiting a specific website or opening a compromise file, the
- 8:42Speaker 2: malicious code embeds itself into the boot sequence. So when
- 8:46Speaker 2: the phone restarts, the exploit runs itself automatically before Apple's
- 8:50Speaker 2: security checks can even stop it.
- 8:52Speaker 1: But Apple knows this is happening, so they build alarm
- 8:54Speaker 1: systems into the kernel, which leads us to a third
- 8:56Speaker 1: type capless.
- 8:58Speaker 2: Right capless stands for bypass kernel patch protection. Modern iOS
- 9:02Speaker 2: versions have a dedicated security mechanism whose only job is
- 9:05Speaker 2: to watch the kernel like a guard just for the
- 9:07Speaker 2: kernel exactly. If it detects that someone has modified the
- 9:10Speaker 2: kernel to run an untethered jail brick, it triggers a
- 9:13Speaker 2: system panic and shuts everything down immediately.
- 9:15Speaker 1: So how do you get around that?
- 9:17Speaker 2: Well, Capless jail bricks are incredibly sophisticated. They find ways
- 9:22Speaker 2: to inject their code into the system memory while completely
- 9:25Speaker 2: dodging those kernel patch protection alarms. The alarm system is armed,
- 9:29Speaker 2: but the exploit is practically invisible.
- 9:32Speaker 1: That's crazy. Add in semi tethered and semi untethered variations
- 9:36Speaker 1: where you can retrigger the jail break from an app
- 9:39Speaker 1: on the phone without a computer, and it is just
- 9:42Speaker 1: a relentless cat and mouse game.
- 9:44Speaker 2: It really is.
- 9:45Speaker 1: But iOS is just one side of the battlefield. It's
- 9:48Speaker 1: a walled garden designed by one company for hardware built
- 9:51Speaker 1: by that exact same company.
- 9:53Speaker 2: Which is a massive luxury in software engineering. When you
- 9:56Speaker 2: control the hardware, writing the software is significantly easier.
- 9:59Speaker 1: Right, So what happens when you need an operating system
- 10:01Speaker 1: that has to work on a thousand different devices high
- 10:04Speaker 1: end flagship phones, cheap budget tablets, devices with different screens,
- 10:09Speaker 1: different cameras, completely different processors.
- 10:11Speaker 2: Then you need an entirely different philosophy. You need Android.
- 10:15Speaker 1: And the origin story of Android is completely counterintuitive. Android,
- 10:20Speaker 1: which is built on an open source Linux kernel, was
- 10:23Speaker 1: not actually invented to compete with the iPhone. It was
- 10:27Speaker 1: designed in Palo Alto for digital cameras.
- 10:29Speaker 2: Yeah, the original team envisioned this smart ecosystem for digital
- 10:33Speaker 2: cameras to sink seamlessly with PCs.
- 10:36Speaker 1: But they looked at the digital camera market, realized it
- 10:38Speaker 1: wasn't growing fast enough to sustain their massive ambition, and
- 10:42Speaker 1: pivoted the exact same underlying technology toward mobile handsets. And
- 10:46Speaker 1: then Google saw what they were building and bought the
- 10:49Speaker 1: entire project for roughly fifty million dollars in two thousand
- 10:52Speaker 1: and five, which.
- 10:53Speaker 2: Knowing what we know now, that might be one of
- 10:55Speaker 2: the highest ROI acquisitions in the history of business.
- 10:58Speaker 1: Unbelievable deal.
- 10:59Speaker 2: It shifted the entire global technological landscape. By two thousand
- 11:03Speaker 2: and eight, Google launched Android version one point zero commercially
- 11:07Speaker 2: alongside what we now know is the Google Play Store.
- 11:09Speaker 2: But Google had a completely different strategy than Apple. Right.
- 11:11Speaker 1: They didn't want build all the hardware themselves.
- 11:13Speaker 2: No, they wanted Android to be the universal blood type
- 11:16Speaker 2: for everyone else's hardware, and.
- 11:17Speaker 1: To do that they formed the Open Handset Alliance. They
- 11:21Speaker 1: teamed up with eighty four different hardware manufacturers, software companies,
- 11:25Speaker 1: and telecom operators. This was a massive industry coalition agreeing
- 11:31Speaker 1: on a shared, open standard.
- 11:33Speaker 2: Yeah, and we have to mention the naming convention too,
- 11:35Speaker 2: because starting with version one point five, they started naming
- 11:38Speaker 2: major updates alphabetically after desserts, right.
- 11:41Speaker 1: Cupcake, doughnut, Eclaire, all the way up to version nine,
- 11:45Speaker 1: which was PI.
- 11:46Speaker 2: It just adds a bit of charm to an incredibly
- 11:49Speaker 2: complex engineering feat because when we look at how Android
- 11:53Speaker 2: actually functions, we kind of have to split our brain
- 11:56Speaker 2: in two. There are two distinct ways to analyze Android
- 11:59Speaker 2: system marketechure and platform architecture.
- 12:01Speaker 1: Okay, let's map those out. System architecture is like the
- 12:04Speaker 1: invisible highway system, right. It dictates how the different layers
- 12:07Speaker 1: communicate with each other. Platform architecture is the actual physical
- 12:10Speaker 1: pavement and the car is driving on it. The literal
- 12:13Speaker 1: software stack from the bottom.
- 12:14Speaker 2: Up exactly, So let's start with the communication highways the
- 12:18Speaker 2: system architecture. The bedrock of this system is the kernel.
- 12:21Speaker 2: As we mentioned, it's a modified Linux kernel.
- 12:23Speaker 1: And it handles the absolute lowest level functionality that keeps
- 12:27Speaker 1: the device alive, right, like memory management, process management, security protocols,
- 12:32Speaker 1: and crucially device drivers.
- 12:33Speaker 2: Yes, but here's the massive problem Android faces that iOS
- 12:38Speaker 2: just doesn't. Because of those eighty four companies in the
- 12:42Speaker 2: Open Handset Alliance, Android has to run on thousands of
- 12:45Speaker 2: different hardware configurations.
- 12:47Speaker 1: Right, So if I write a camera app, I can't
- 12:49Speaker 1: write code that speaks directly to a specific Sony camera
- 12:52Speaker 1: lens because the user might download my app on a
- 12:55Speaker 1: phone with a Samsung lens exactly.
- 12:57Speaker 2: So, sitting right above the kernel is the HL, the
- 12:59Speaker 2: hardware or abstraction layer.
- 13:01Speaker 1: THEHL is the HL essentially a universal translator. Like if
- 13:04Speaker 1: I open an app and take a photo, the app
- 13:07Speaker 1: doesn't speak Sony or Samsung. It just speaks basic Android yes,
- 13:10Speaker 1: and enhands that generic command to the HL and the
- 13:12Speaker 1: HL axss the translator figuring out exactly which hardware chip
- 13:15Speaker 1: is in the phone and translating the command into the
- 13:18Speaker 1: specific driver language needed down in the kernel.
- 13:20Speaker 2: That is exactly how it works. The HL provides standard,
- 13:25Speaker 2: uniform interfaces to the higher level software. It completely hides
- 13:29Speaker 2: the messy, fragmented reality of the hardware from the app developers.
- 13:33Speaker 1: That's brilliant.
- 13:34Speaker 2: If the HL didn't exist, a developer would have to
- 13:37Speaker 2: write hundreds of different versions of a single app just
- 13:40Speaker 2: to ensure the camera button worked on different phone models.
- 13:43Speaker 2: With the HL, they write it once, and the HL
- 13:46Speaker 2: figures out how to talk to the physical device.
- 13:48Speaker 1: Okay, So, sitting above the Universal Translator are the system services.
- 13:52Speaker 1: These are modular, specialized services that handle specific tasks. Right
- 13:57Speaker 1: like you have a media service whose only job is
- 13:59Speaker 1: to know how to play audio, or a window service
- 14:02Speaker 1: that handles a text message notification popping up over your game.
- 14:05Speaker 2: Right, And this leads to the most critical part of
- 14:07Speaker 2: the system architecture. How do these components actually talk to
- 14:10Speaker 2: each other securely? Enter the binder IPC.
- 14:13Speaker 1: IPC stands for Ender Process communications right, Because Android isolates
- 14:17Speaker 1: processes just like iOS sandboxing.
- 14:20Speaker 2: It does. Every application and even core system components run
- 14:24Speaker 2: in their own isolated memory space, which is great for security.
- 14:28Speaker 2: I mean, if an app crashes, it doesn't take down
- 14:30Speaker 2: the whole phone, but they have to communicate. If your
- 14:33Speaker 2: photo gallery app wants to share a picture to your
- 14:36Speaker 2: email app, they are basically in two different isolated rooms.
- 14:39Speaker 1: So they need a secure hallway.
- 14:41Speaker 2: The binder IPC is that secure hallway. It is a
- 14:45Speaker 2: highly optimized mechanism build deep in the kernel that allows
- 14:48Speaker 2: these separate, isolated processes to send messages, data and requests
- 14:53Speaker 2: across their boundaries securely.
- 14:54Speaker 1: Okay, So the binder IPC manages the permissions, ensures that
- 14:58Speaker 1: data isn't malicious, and delivers the message. It's the bridge
- 15:02Speaker 1: that allows a high level app to interact with an
- 15:04Speaker 1: underlying system service without breaking the security isolation exactly. Okay,
- 15:08Speaker 1: so we understand the highways in the bridges. Now let's
- 15:10Speaker 1: pivot to the platform stack. These are the actual software
- 15:13Speaker 1: building blocks.
- 15:14Speaker 2: Building from the bottom up. We have the Linux kernel,
- 15:16Speaker 2: which passes data up through the HL but to process
- 15:19Speaker 2: that data quickly, Android relies on a layer of c
- 15:22Speaker 2: and C plus plus libraries just.
- 15:26Speaker 1: Native code libraries handling the heavy lifting, right.
- 15:29Speaker 2: Yeah, graphics, rendering, secure Internet transmission protocols, database management. All
- 15:34Speaker 2: of that is written in C or C plus plus
- 15:37Speaker 2: for maximum speed and efficiency.
- 15:39Speaker 1: But the apps we download from the play Store aren't
- 15:40Speaker 1: written in C plus plus play They're usually written in
- 15:44Speaker 1: Java or Cotland, and those languages can't just run on
- 15:47Speaker 1: their own. They need an engine to process them, which.
- 15:50Speaker 2: Brings us to the runtime environment, specifically, the evolution from
- 15:54Speaker 2: DVM to RT.
- 15:55Speaker 1: Let's break that down.
- 15:56Speaker 2: Historically, early Android used the Dalvik Virtual Machine or DVM.
- 16:01Speaker 2: Every single Android app ran inside its own instance of
- 16:05Speaker 2: this virtual machine. The developer would compile their code into
- 16:09Speaker 2: what are called dx files.
- 16:11Speaker 1: Think of them as packaged optimized executable files for Android.
- 16:15Speaker 2: Right when you opened an app, the DVM would translate
- 16:18Speaker 2: those dex files into raw machine code on the fly
- 16:21Speaker 2: as you're using it.
- 16:23Speaker 1: Wait. If the DVM was translating the app's code into
- 16:25Speaker 1: machine language every single time you tapped a button or
- 16:28Speaker 1: scroll the page, that sounds incredibly inefficient. That must have
- 16:30Speaker 1: absolutely hammered the processor and drained the battery.
- 16:33Speaker 2: Oh, it was a massive bottleneck. The phone was working
- 16:36Speaker 2: incredibly hard just to understand the app it was trying
- 16:39Speaker 2: to run. So starting around Android version five point zero,
- 16:43Speaker 2: they began phasing out Delvik and replacing it with art
- 16:47Speaker 2: the Android run time.
- 16:48Speaker 1: So how does RT solve the translation problem.
- 16:51Speaker 2: By translating the book before it's published rather than translating
- 16:54Speaker 2: it aloud while you are trying to read it. RT
- 16:57Speaker 2: uses ahead of time compilation.
- 16:59Speaker 1: Ah.
- 17:00Speaker 2: Yeah, When you download and install the app from the store,
- 17:03Speaker 2: Artie translates the DX files into native machine language right
- 17:06Speaker 2: then and there.
- 17:07Speaker 1: So when you tap the app to open it later,
- 17:09Speaker 1: the phone doesn't have to translate anything. It just runs
- 17:11Speaker 1: the native code.
- 17:12Speaker 2: Instantly exactly, which means apps open faster, animations are smother
- 17:17Speaker 2: and battery life is saved.
- 17:18Speaker 1: And Archie also introduced vastly improved garbage collection.
- 17:22Speaker 2: Right, yes, garbage collection being memory management. If you've ever
- 17:26Speaker 2: had an older phone that suddenly gets incredibly sluggish when
- 17:29Speaker 2: you switch between three different apps, it's because those apps
- 17:32Speaker 2: are leaving junk data in the phone's short term memory.
- 17:35Speaker 1: So garbage collection is basically the janitor that sweeps out
- 17:38Speaker 1: the rams so the system can keep moving fast.
- 17:41Speaker 2: That's a great way to put it.
- 17:42Speaker 1: So Artie is the engine. Now how do developers actually
- 17:45Speaker 1: build the car? They use the next layer of the
- 17:49Speaker 1: Java API framework. This is the massive toolkit provided by Google,
- 17:54Speaker 1: so a developer doesn't have to code a textbox from scratch.
- 17:57Speaker 2: Right, you have the view system, which provides the actual
- 18:00Speaker 2: visual elements, the buttons that drop down menus, the grids.
- 18:03Speaker 1: You also have content providers, which I actually find fascinating
- 18:06Speaker 1: from a privacy standpoint. Content providers allow apps to securely
- 18:10Speaker 1: request data from each other. Right, so, if you download
- 18:13Speaker 1: a sketchy new social media app and it suddenly asks
- 18:16Speaker 1: can I access your contacts? It isn't just rummaging through
- 18:20Speaker 1: your phone's hard drive. It is forced to use a
- 18:23Speaker 1: content provider to formally ask the system's core contact app
- 18:26Speaker 1: for permission. If you hit deny, the content provider shuts
- 18:29Speaker 1: the door.
- 18:30Speaker 2: Exactly Along with those, you have various managers. The resource
- 18:34Speaker 2: manager lets an app dynamically pull localized text so it
- 18:37Speaker 2: knows to display Spanish instead of English based on your
- 18:40Speaker 2: system settings.
- 18:41Speaker 1: Very handy.
- 18:42Speaker 2: The notification manager gives apps the ability to put those
- 18:45Speaker 2: little custom alerts in your status bar, and the telephony
- 18:48Speaker 2: manager handles incoming calls.
- 18:50Speaker 1: Which brings us to the penthouse, the very top of
- 18:52Speaker 1: the stack, the application layer. This is the only part
- 18:55Speaker 1: of this entire metropolis that you, the user, actually interact with.
- 18:59Speaker 1: It holds your core system apps like the default SMS, messenger,
- 19:03Speaker 1: and the web browser, alongside every third party app you've
- 19:06Speaker 1: ever downloaded.
- 19:07Speaker 2: And here is a crucial philosophical difference from iOS. In
- 19:11Speaker 2: Android's application layer, the core system apps are not treated
- 19:14Speaker 2: as special or privileged by the architecture. Oh really, Yeah,
- 19:18Speaker 2: a third party developer can build a brand new SMS
- 19:21Speaker 2: app using the exact same Java API framework that Google
- 19:25Speaker 2: used to build the default one. At the API level,
- 19:28Speaker 2: the playing field is entirely level.
- 19:30Speaker 1: That's fascinating. So we have journeyed from the tightly controlled,
- 19:33Speaker 1: incredibly strict sandboxes of Apple's Cocoa Touch layer all the
- 19:36Speaker 1: way through the wild hardware agnostic universal translating HL and
- 19:40Speaker 1: Java APIs of Android.
- 19:42Speaker 2: Yeah, we've decoded how both of these tech behemoths approach
- 19:46Speaker 2: the nearly impossible task of securing a supercomputer that constantly
- 19:50Speaker 2: jumps between public networks while fitting in your pocket.
- 19:53Speaker 1: It's two radically different philosophies. One prioritize of absolute uniformity
- 19:58Speaker 1: and control to maintain security, while the other prioritizes open
- 20:02Speaker 1: adaptability to survive on thousands of different pieces of hardware.
- 20:06Speaker 2: But the engineering required to make both of them function
- 20:09Speaker 2: flawlessly in milliseconds is truly profound.
- 20:12Speaker 1: Well, as promised, we aren't going to let you just
- 20:14Speaker 1: passively absorb all this. To really solidify what we've covered,
- 20:18Speaker 1: here is a quick review exercise for you. Think back
- 20:20Speaker 1: to our breakdown of the Android system architecture the communication highways.
- 20:25Speaker 1: We talked about how every app is isolated in its
- 20:27Speaker 1: own process for security. What is this specific, highly optimized
- 20:31Speaker 1: mechanism built into the system that acts as a secure
- 20:34Speaker 1: hallway allowing those isolated apps to send messages and interact
- 20:38Speaker 1: with underlying system services. Take a second to think about it.
- 20:41Speaker 2: It's a tricky one, but it's central to how it
- 20:43Speaker 2: all works.
- 20:43Speaker 1: Did you get it? The answer is the binder IPC,
- 20:47Speaker 1: the inter process communication bridge, right.
- 20:50Speaker 2: And understanding the binder IPC means you grasp the fundamental
- 20:54Speaker 2: tension of modern operating systems. How to keep things perfectly
- 20:57Speaker 2: isolated for security will perfectly connected for usability.
- 21:02Speaker 1: So the next time you pull your phone out of
- 21:03Speaker 1: your pocket to check a notification or download a simple game.
- 21:06Speaker 1: Take one second to visualize the immense invisible architecture firing
- 21:10Speaker 1: off beneath the glass, From low level C plus plus
- 21:14Speaker 1: libraries to hardware abstraction layers translating hardware commands. It requires
- 21:18Speaker 1: a sprawling, perfectly choreographed digital city just to make your
- 21:22Speaker 1: screen light up, which leads me wondering, as we move
- 21:25Speaker 1: through the physical world, what other massive invisible systems are
- 21:28Speaker 1: we interacting with every single day, completely oblivious to the
- 21:31Speaker 1: chaos happening right beneath our fingertips.