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

Plugman code-reading

Plugman code-reading

Study of Plugman, which is installer/uninstaller for Apache Cordova Plugins.

Motokazu Nishimura

April 28, 2014
Tweet

More Decks by Motokazu Nishimura

Other Decks in Technology

Transcript

  1. NBJOKT w Ұ൪࢝Ίʹݺ͹ΕΔ w DMJͷΦϓγϣϯͷݕূ w QMVHNBOͷDPOTPMFFWFOUͷઃఆ w Φϓγϣϯʹج͍ͮͨQMVHNBOͷؔ਺ͷ࣮ߦ !

    w DPNNBOET͸QMVHNBOKT಺Ͱఆٛ͞ΕΔ w ͜͜Ͱ͍͏<DNE>͸DPOpH JOTUBMMͳͲͷίϚϯυͷ͜ͱ -WBSSFTVMUQMVHNBODPNNBOET<DNE> DMJ@PQUT 
  2. JOTUBMMKT TSDJOTUBMMKT w JOTUBMMDPNNBOEͷத਎ w *OTUBMMqPX w JOTUBMM1MVHJOQPTTJCMZ'FUDISVO*OTUBMMIBOEMF*OTUBMM w JOTUBMM1MVHJO

    QMBUGPSN QSPKFDU@EJS JE QMVHJOT@EJS PQUJPOT  w QMBUGPSNͷνΣοΫ w QPTTJCMZ'FUDI BDUJPOT QMBUGPSN QSPKFDU@EJS JE  QMVHJOT@EJS PQUJPOT  w QMVHJOͷGFUDIΛߦ͍SVO*OTUBMMʹਐΉ
  3. JOTUBMMKTSVO*OTUBMM w 1MVHJO಺ʹ͋ΔQMVHJOYNMΛύʔεɺQMVHJO໊ *%Λऔಘ w QMVHJO͕Πϯετʔϧ͞Ε͍ͯΔ͔Λ֬ೝ w ֬ೝର৅ͷϑΝΠϧ͸QMBUGPSNຖʹҧ͏ͷͰɺQMBUGPSNT KTΛࢀর͢Δ w

    QMVHJO͕Πϯετʔϧ͞Ε͍ͯͳ͚Ε͹ଓ͘ w HFU&OHJOFTͰQMVHJOYNMʹهࡌ͞Ε͍ͯΔॲཧΤϯδϯΛऔಘʢهࡌແ͠ͷ ৔߹͸EFGBVMUFOHJOFΛར༻ʣ w VUJM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