Learning android with AOSP

17
Learning Android with AOSP Jorge Juan Barroso Carmona [email protected] @ipper83 +JorgeJBarroso Android expert

Transcript of Learning android with AOSP

Page 1: Learning android with AOSP

Learning Android with AOSPJorge Juan Barroso Carmona

[email protected] @flipper83 +JorgeJBarroso

Android expert

Page 2: Learning android with AOSP

We embark on every project with a commitment to create something elegant, enduring and effective. That is our heartbeat.

Our approach is uniquely simple and honest, we are a small dedicated software studio, delivering outstanding work.

Karumi is the Rock Solid code software development studio.

Page 3: Learning android with AOSP

Android Open Source Project

Page 4: Learning android with AOSP

+450 projects40Gb free space

16 Gb RAMA lot of patience

Page 5: Learning android with AOSP

Linux Kernel Warelocks / Lowmem / Binder / Logger / Ram Console / …

Libraries Bionic / OpenGL / WebKit …

Native Daemons HAL Init / toolbox

Dalvik / Android Runtime / Zygote

System Services Power Manager / Package Manager / Windows Manager /…

android.*

Stock Android App Launcher3 / Camera2 / Calculator…

java.* Apache

Harmony

Your Apps / Market Apps

App API

Binder

JNI

Page 6: Learning android with AOSP

platform/packages/apps

Samples: Calculator Camera2 Dialer Launcher3

Page 7: Learning android with AOSP

Review Manifests<application android:icon="@mipmap/ic_launcher_calculator" android:label="@string/app_name" android:theme="@style/CalculatorTheme"> <activity android:name=".Calculator" android:label="@string/app_name" android:windowSoftInputMode="stateAlwaysHidden"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> <category android:name=“android.intent.category.APP_CALCULATOR"/> </intent-filter> </activity> </application>

Page 8: Learning android with AOSP

Review Manifests

Contacts/manifest:

android:supportsRtl=“true” android:taskAffinity=“android.task.contacts"

<activity-alias/> <data android:mimeType=“…” />

<original-package/> !!

Page 9: Learning android with AOSP

Review Manifests

Permissions:normal

dangerous signature

signatureOrSystem

android.permission.DELETE_PACKAGES: Allows an application to delete packages. Not for use by third-party applications.

Page 10: Learning android with AOSP

Review ManifestsPermissions:

android:sharedUserId=“android.uid.system" android:sharedUserId="android.uid.shared"

Apps in the /system folder. System is not mount for write by default. cat /proc/mounts mount -o rw,remount -t ext4 <block-name> /system

Signed with the same Certificate

Page 11: Learning android with AOSP

Review Manifests

Fun:

android.intent.category.TEST android.intent.category.MONKEY

!android.intent.action.DEVICE_INITIALIZATION_WIZARD

intent priority !!!

Page 12: Learning android with AOSP

Review CodeSample Calculator Reveal:

Page 13: Learning android with AOSP

Review CodeSample Calculator Reveal:

private void reveal(View sourceView, int colorRes, AnimatorListener listener) {

… final Animator revealAnimator = ViewAnimationUtils.createCircularReveal (revealView,revealCenterX, revealCenterY, 0.0f, revealRadius);

… !}

!!

Page 14: Learning android with AOSP

Review CodeUsing the framework:

new ChooseLockSettingsHelper(getActivity(), this) .launchConfirmationActivity(KEYGUARD_REQUEST,"","");

if (resultCode == Activity.RESULT_OK && data != null) { String password = data.getStringExtra (ChooseLockSettingsHelper.EXTRA_KEY_PASSWORD); }

Page 15: Learning android with AOSP

Review Code/*hide*/ :

smClass = Class.forName(“android.os.ServiceManager"); Method getService = smClass.getMethod("getService", String.class); IBinder binder = (IBinder) getService.invoke(null, “power"); IPowerManager powerStub = IPowerManager.Stub. asInterface(binder); powerStub.shutdown(false, true);

provided files('providedLibs/layoutlib.jar')

Page 16: Learning android with AOSP

!

Find meI am very social!

[email protected] @flipper83 +JorgeJBarroso

Questions?

Page 17: Learning android with AOSP

!