Skip to content

Instantly share code, notes, and snippets.

View baidala's full-sized avatar

Maksim Baidala baidala

View GitHub Profile
// ----- MainActivity.kt
val LocalBleViewModel =
compositionLocalOf<BleViewModel> { error("No BLE view model found!") }
@AndroidEntryPoint
class MainActivity : ComponentActivity() {
private val bleViewModel: BleViewModel by viewModels()
override fun onCreate(savedInstanceState: Bundle?) {
this.enableEdgeToEdge()
A little help in Smali
(To be supplemented)
#
general information
#
Smali
Types
Dalvik bytecode has two main type classes, primitive types and reference types. Reference types are objects and arrays, everything else is primitive.
@baidala
baidala / BluetoothConstants.ts
Created April 19, 2023 14:36 — forked from ariccio/BluetoothConstants.ts
GATT services and characteristics
//Extracted 1/10/2022 from my COVID-CO2-tracker project, in case they're useful to anybody. I'm gonna file an issue/suggesting a few places, and it seems polite to dump it here rather than a long preformatted bit in an issue.
export const GENERIC_GATT_SERVICE_SHORT_ID_DESCRIPTIONS = new Map([
//these are hex strings, without the 0x. Chrome zero extends the devices... so 0x1800 becomes 0x00001800.
// This is a hack to make things easy.
['1800', "generic_access"],
['1801', "generic_attribute"],
['1802', "immediate_alert"],
['1803', "link_loss"],
@baidala
baidala / android-bluetooth-low-energy-resources.md
Created March 22, 2021 10:51 — forked from stkent/android-bluetooth-low-energy-resources.md
Android Bluetooth Low Energy (BLE) Resources
@baidala
baidala / oracle_blocker_blocked_sess_history.sql
Created March 21, 2018 09:59 — forked from davidhooey/oracle_blocker_blocked_sess_history.sql
Oracle blocker and blocked session information from history.
select
-- Time
blocker.sample_time as sample_time,
-- Session causing the block
blocker.session_id as blocker_sid,
blocker.session_serial# as blocker_serial#,
blocker.user_id as blocker_username,
blocker.machine as blocker_machine,
blocker.program as blocker_program,
/*
* Copyright (C) 2014 skyfish.jy@gmail.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software