Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Working with AOSP- Droidcon NY 2022

Effie Barak
September 02, 2022
170

Working with AOSP- Droidcon NY 2022

Effie Barak

September 02, 2022
Tweet

Transcript

  1. W rk ng it A SP
    E e ar k
    (@C di gC ic )

    View Slide

  2. View Slide

  3. T lk ak - a ay :
    4 A m e s , u t m e k -
    h a s u e g k g n t
    (i n A S !)
    4 A e e t l m c a l
    c e - o e , repo a p
    "b o o " t i r o

    View Slide

  4. T lk ak - a ay : c nt.
    4 I 's l T - t r r b b
    a , e s t o a D n
    a . A g a c !
    4 W m , S d S E l U
    a G !

    View Slide

  5. H w s nd oi O
    s ru tu ed

    View Slide

  6. View Slide

  7. ● s .i .
    ● b .i .
    ● v .i .
    ● o .i .

    View Slide

  8. W at an e ui d OS f r?

    View Slide

  9. E ul to i ag s

    View Slide

  10. View Slide

  11. View Slide

  12. D vi e ma es

    View Slide

  13. h ://d e .g .c /a /d

    View Slide

  14. View Slide

  15. h ://l o .o /

    View Slide

  16. h ://w .l o .o /d /

    View Slide

  17. S w at an e ha ge?

    View Slide

  18. S w at re om e am le o c an es?
    1. S p (i n a u o !)- d
    l r o e
    2. S I / f r - a r t A
    3. C S a / a B
    4. H h f r i r (e.g a o
    b a )

    View Slide

  19. A SP s od ... L ts nd ot o c de
    J n m C/ C++
    A e K p / l e !
    1 (g !) r o
    1 +G s c

    View Slide

  20. S w at oo s o n ed?

    View Slide

  21. 1. A in x ac in

    View Slide

  22. 2. A re ty tr ng ac in
    h ://w .a n.b /p /2 -a -b -
    m /

    View Slide

  23. View Slide

  24. 1. R D + T l

    View Slide

  25. 4. G tL b
    h ://d .g .c /e /u /p /i /
    m t.h

    View Slide

  26. A SP oo in

    View Slide

  27. R po

    View Slide



  28. fetch=".."
    review="https://android-review.googlesource.com/" />
    remote="aosp"
    sync-j="4" />







    name="platform/bootable/recovery"
    groups="pdk" />
    path="bootable/libbootloader"
    name="platform/bootable/libbootloader"
    groups="vts,pdk" />
    name="platform/compatibility/cdd"
    groups="pdk" />
    ...

    View Slide

  29. e vs tu .s
    source build/envsetup.sh

    View Slide

  30. lunch

    View Slide

  31. View Slide

  32. B il s st m
    A dr id ak (A dr id.m )
    S on (b ue ri t - A dr id.b )

    View Slide

  33. T ol r ca
    repo init
    repo sync
    source build/envsetup.sh
    lunch
    make -j

    View Slide

  34. A DE en om an

    View Slide

  35. View Slide

  36. N w... L t's al a ou
    d ve op en

    View Slide

  37. View Slide

  38. View Slide

  39. View Slide

  40. S h w o e o ha ?
    1. E u (g ) p h S b
    2. C e r i
    3. S o p t h p m e (a h
    c c G )
    4. D l , o A S u w
    m h S i
    5. P t!

    View Slide

  41. 1. E be o r (n rm l, g ad e ui t pp) a p n he OS b il

    View Slide

  42. H ld n m nu e, h w id e o hi ?
    1. C A .b o u A
    2. A a n a m t l u w r o
    (e.g G , G )
    3. B A !

    View Slide

  43. A dr id.b
    android_app_import {
    name: "LottieLauncher",
    apk: "app-aosp.apk",
    certificate: "platform",
    privileged: true,
    }

    View Slide


  44. name="lottie"
    fetch="ssh://[email protected]/some-org/some-repo.git"
    revision="main"/>


    View Slide

  45. View Slide

  46. make -j

    View Slide

  47. 1. E be o r (g ad e ui t pp) a p n he OS b il
    2. C ea e n mu at r ma e

    View Slide

  48. 1. C a i l t h e r i
    2. E h i l t h d l n u
    c r
    3. A p i m o A s a u
    l
    4. C V t u i o A S !

    View Slide

  49. 1. C ea e z p l w th he mu at r ma es
    T c mp le he dk it a l he up or in t ol
    make sdk sdk-repo

    View Slide

  50. F r om r as n, t is ne s he ne ha w rk ?
    make emu_image_zip
    R :
    s -r -l -s -i -e .n >.z

    View Slide

  51. 1. C ea e z p l w th he mu at r ma es
    2. E tr ct he ip l i to he dk oc ti n n ou
    c mp te

    View Slide

  52. 1. C ea e z p l w th he mu at r ma es
    2. E tr ct he ip l i to he dk oc ti n n ou
    c mp te
    3. A d ro er ie x l or nd oi s ud o o ea y ur l

    View Slide

  53. p ck ge.x l




    33
    true

    google_apis
    Google APIs


    lottie
    Lottie

    x86_64


    5

    Lottie System Image Upside-down Cake
    ...


    View Slide

  54. 1. C a i l t h e r i
    2. E h i l t h d l n u
    c r

    3. A p i m o A s a u
    l

    4. C V t u i o A S !

    View Slide

  55. View Slide

  56. 1. E be o r (g ad e ui t pp) a p n he OS b il
    2. C ea e n mu at r ma e

    View Slide

  57. 3. S gn ou pp it t e la fo m ey (a d he er i c te o
    G ad e)
    H i x .p k l t k k e
    h ://g .g .c /b l/
    a 4 5 0 e

    View Slide

  58. signingConfigs {
    aosp {
    keyPassword keystoreProperties['password']
    storeFile file(keystoreProperties['keystore'])
    storePassword keystoreProperties['password']
    keyAlias = 'lottie_aosp'
    }
    }

    View Slide

  59. 1. E be o r (g ad e ui t pp) a p n he OS b il
    2. C ea e n mu at r ma e
    3. S gn ou pp it t e la fo m ey (a d he er i c te o
    G ad e)
    4. D pl y oc ll , f om nd oi S ud o n ur wn ac in
    t t e OS i ag

    View Slide

  60. View Slide

  61. !

    View Slide

  62. A e e ro t ng?

    View Slide

  63. View Slide

  64. U er an le.j va
    /** @hide A user handle to indicate all users on the device */
    @SystemApi
    public static final @NonNull UserHandle ALL = new UserHandle(USER_ALL);

    View Slide

  65. View Slide

  66. T e DK e om il a ai st oe n't no w c n cc ss
    t es A Is

    View Slide

  67. C ea in a us om DK it ou t e nn ta io s o om il
    a ai st.
    1. U h c o h i d s
    (b a i p o s d t )
    2. S i m d e t h d i l
    g o m
    3. C e e c r
    4. C a l
    5. M !

    View Slide

  68. 1. U in t e la se f om he nt rm di te ta e
    m d s -r
    ~//o /t /c /o /J L E /
    f r i d /c -h .j

    View Slide

  69. 2. S me ip ag c o ep ac t em nt t e dk ip l w
    g t ro m ke
    cd out/host/linux-x86/sdk/sdk/
    ~//out/host/linux-x86/sdk/sdk/android-sdk_eng.effie_linux-x86/platforms/android-12$ mkdir tmp_sdk
    unzip android.jar -d tmp_sdk
    unzip ~//out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes-header.jar -d tmp_sdk
    cd tmp_sdk/
    jar cfMv ../android.jar .

    View Slide

  70. 3. C py ve t d v om ut r

    View Slide

  71. 4. C mp le ga ns l ca ly
    android {
    compileSdkPreview 'UpsideDownCake'
    ...

    View Slide

  72. 5. M GI !

    View Slide

  73. S ar hi g OS c de as

    View Slide

  74. h ://c .a .c /

    View Slide

  75. View Slide

  76. !
    @C di gC ic

    View Slide

  77. D I n l a S n o d
    p i t i ?

    View Slide