Skip to content

Instantly share code, notes, and snippets.

View dmpatel151282's full-sized avatar

Dharmesh Patel dmpatel151282

View GitHub Profile
@dmpatel151282
dmpatel151282 / Implementation_of_802.1X_over_Ethernet.md
Last active September 18, 2024 02:11
Implementation of 802.1X over Ethernet

IEEE 802.1X is a standard for port-based network access control, typically used to provide secure authentication on both wired (Ethernet) and wireless networks. Here's a breakdown of the key components and implementation steps for 802.1X over Ethernet:

Key Components

  1. Supplicant (Client)
    • The device (e.g., a computer or network printer) that requests access to the network.
    • It must support 802.1X and be configured with credentials (such as a username/password or certificate) to authenticate to the network.
  2. Authenticator (Switch or Access Point)
    • The network device that acts as an intermediary between the supplicant and the authentication server.
  • In the case of Ethernet, this is typically an Ethernet switch. The switch only allows network access if the supplicant is successfully authenticated.
@dmpatel151282
dmpatel151282 / Configuring_Ethernet_802.1x_on_Android.md
Last active September 18, 2024 02:12
Configuring Ethernet 802.1x on Android

What is 802.1x?

802.1x is a network access control protocol that provides authentication for devices trying to connect to a LAN or WLAN. It’s commonly used in enterprise environments to secure Ethernet and Wi-Fi networks. The authentication is usually performed using RADIUS servers.

Steps to Configure Ethernet 802.1x on Android

  • Check Device Compatibility:
    • Not all Android devices natively support Ethernet connections, and support for 802.1x over Ethernet can be even rarer. First, ensure your device supports Ethernet connections either through a USB-to-Ethernet adapter or a built-in Ethernet port.
  • Connect the Ethernet Adapter:
  • If your device doesn’t have a built-in Ethernet port, you’ll need a USB-to-Ethernet adapter. Once connected, your device should recognize the Ethernet connection automatically.
@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 September 18, 2024 01:42
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