Skip to content

Instantly share code, notes, and snippets.

View dmpatel151282's full-sized avatar

Dharmesh Patel dmpatel151282

View GitHub Profile
@dmpatel151282
dmpatel151282 / File_based_OTA_update_along_with_Block-based_OTA.md
Last active November 16, 2023 11:06
File based OTA update along with Block-based OTA

OTA is the mechanism by which OEMs remotely update the system partition of a device:

  • Android 5.0 and later versions use block OTA updates to ensure that each device uses the exact same partition. Instead of comparing individual files and computing binary patches, block OTA handles the entire partition as one file and computes a single binary patch, ensuring the resultant partition contains exactly the intended bits. This allows the device system image to achieve the same state via fastboot or OTA.
  • Android 4.4 and earlier versions used file OTA updates, which ensured devices contained similar file contents, permissions, and modes, but allowed metadata such as timestamps and the layout of the underlying storage to vary between devices based on the update method.

File based OTA update in not available beyond AOSP Android 5.0. Sometimes it is require to provide few configuration files along with OTA.

We have solution that provide file based OTA supports along with block-based OTA file. This solut

@dmpatel151282
dmpatel151282 / Android_Ethernet_802.1x_support.md
Last active November 23, 2023 02:06
Android Ethernet 802.1x support

"As of now Android doesn’t support 802.1x Authentication over Ethernet natively."

Below components need to be changed/modified

  • Ethernet Supplicant
  • Ethernet Supplicant interface
  • EthernetManager and EthernetService
  • IPConfiguration

Proposed solution supports EAP-TLS, EAP-PEAP, EAP-TTLS, EAP-MD5 and EAP-PWD authentication methods.

@dmpatel151282
dmpatel151282 / wpa_supplicant error codes
Last active July 30, 2021 08:41
wpa_supplicant error codes
reason=1 "Unspecified reason"
reason=2 "Previous authentication no longer valid"
reason=3 "Deauthenticated because sending STA is leaving (or has left) IBSS or ESS"
reason=4 "Disassociated due to inactivity"
reason=5 "Disassociated because AP is unable to handle all currently associated STAs"
reason=6 "Class 2 frame received from nonauthenticated STA"
reason=7 "Class 3 frame received from nonassociated STA"
reason=8 "Disassociated because sending STA is leaving (or has left) BSS"
reason=9 "STA requesting (re)association is not authenticated with responding STA"
reason=10 "Disassociated because the information in the Power Capability element is unacceptable"
@dmpatel151282
dmpatel151282 / ssh_server_android_aosp.md
Last active November 23, 2023 02:07
SSH server support in Android AOSP

SSH server support in AOSP Android

Download the OpenSSH source code and replace it with existing source code inside external folder.

Add below code in device make file (e.g. device.mk).

PRODUCT_PACKAGES +=
scp
sftp
ssh \

To remove Dex support from APK
Add LOCAL_DEX_PREOPT := false in Android.mk
/**
*
* @param bmp input bitmap
* @param contrast 0..10 1 is default
* @param brightness -255..255 0 is default
* @return new bitmap
*/
public static Bitmap changeBitmapContrastBrightness(Bitmap bmp, float contrast, float brightness)
{
ColorMatrix cm = new ColorMatrix(new float[]
@dmpatel151282
dmpatel151282 / Did you got this error while building with Jack?
Created November 13, 2018 11:54
Did you got this error while building with Jack?
Code :-
[ X% Y/Z] Building with Jack: /home/minealex2244/los/out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/with-local/classes.dex
FAILED: /bin/bash /home/minealex2244/los/out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/with-local/classes.dex.rsp
Communication error with Jack server (52). Try 'jack-diagnose'
ninja: build stopped: subcommand failed.
It looks like the installation of Jack server is broken. So how do we fix it?
1. Open a terminal window
@dmpatel151282
dmpatel151282 / Adding Any Application in Android Source
Created October 27, 2018 09:02
Adding Any Application in Android Source
===============================================================================
For Adding Any Appllication in Android Source
===============================================================================
For : TestApp
Create TestApp directory into below path
vendor/<vendor>/proprietary/prebuilt/target/product/<device>/system/app/
cd vendor/<vendor>/proprietary/prebuilt/target/product/<device>/system/app/
AES-128-CBC
AES-128-CFB
AES-128-CFB1
AES-128-CFB8
AES-128-CTR
AES-128-ECB
AES-128-OFB
AES-128-XTS
AES-192-CBC
AES-192-CFB