Skip to content

Instantly share code, notes, and snippets.

View chayanforyou's full-sized avatar
🤖
Learning...

Chayan Mistry chayanforyou

🤖
Learning...
View GitHub Profile
@chayanforyou
chayanforyou / Android MediaPlayer.md
Created December 25, 2021 04:32
Simplified example of Android MediaPlayer
package me.chayan.mediaplayerdemo;

import android.content.Context;
import android.content.res.AssetFileDescriptor;
import android.content.res.Resources;
import android.media.AudioFormat;
import android.media.AudioManager;
import android.media.AudioTrack;
import android.media.MediaPlayer;

It is a library that receives and returns the version of the application uploaded to the market. If it is different from the current version, you can write the code so that it can be updated after moving to the market.

We refine some methods on the Internet and distribute them in the form of a library. The original java source is also attached.

Be careful

How to parse and fetch the Google Market website It takes a lot of data

  • Download the BIOS update from Acer site ZQ0_125.exe
  • Run the downloaded file, you will get an error like No battery or Low battery, Don't close the error dialogue (!)
  • Navigate to your current users temp directory (e.g. Users//AppData/Local/Temp), there should be somewhere a temporary directory containing the extracted files from the EXE file (for me it was 7zS8C43.tmp)
  • Copy the temp directory somewhere (then you can then close the error dialogue, the temp files will be removed)
  • Open the file platform.ini with a text editor and search for the key AC_Adapter
  • Change parameter BatteryCheck from 1 to 0 or just leave it empty (this disables battery check during BIOS update preparation!), save the file
  • Run InsydeFlash.exe in the same directory

It solved my issue and work beautifully..

You can download this file from the browser or from the console. The latter is shown below (note: the specific Node.js version might be different for you):

wget http://nodejs.org/dist/v14.15.0/node-v14.15.0-linux-x64.tar.gz
sudo tar -C /usr/local --strip-components 1 -xzf node-v14.15.0-linux-x64.tar.gz

You may find list of node version on http://nodejs.org/dist/

@chayanforyou
chayanforyou / 00-android-bypass-certificate-pinning-and-mitm-attack-setup.md
Created November 25, 2021 04:28 — forked from approovm/00-android-bypass-certificate-pinning-and-mitm-attack-setup.md
Certificate Pinning Bypassing: Setup with Frida, mitmproxy and Android Emulator with a writable file system
@chayanforyou
chayanforyou / MITMProxy SSL handshake error.md
Last active September 4, 2024 07:01
Monitoring/Inspecting Network on Android or iOS Apps Using mitmproxy

SSL handshake error

192.168.0.14:56294: CONNECT android.googleapis.com:443
 << Cannot establish TLS with client (sni: android.googleapis.com): TlsException("SSL handshake error: Error([('SSL routines', 'ssl3_read_bytes', 'sslv3 alert certificate unknown')],)",)

sslv3_alert_certificate_unknown

Solution

import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
theme: new ThemeData(
@chayanforyou
chayanforyou / gist:a9b215b8f737f83f5ce15f25cc0d0980
Created January 21, 2020 12:50 — forked from sonvp/gist:7873060a99895f483ca48fdc030c71ad
DrawableLeft to top or DrawableRight to top in TextView multiline.
1. Create Custom TextView.
public class TextViewDrawable extends android.support.v7.widget.AppCompatTextView {
public TextViewDrawable(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
}
/**
@chayanforyou
chayanforyou / Arduino 230v Light bulb dimming
Created July 4, 2019 14:24 — forked from ryanamaral/Arduino 230v Light bulb dimming
Arduino 230v Light Bulb Dimming (Portugal 220V 50 Hz)
//source: http://electronics.stackexchange.com/q/59615
int AC_LOAD = 3; // Output to Opto Triac pin
int dimming = 128; // Dimming level (0-128) 0 = ON, 128 = OFF
void setup()
{
pinMode(AC_LOAD, OUTPUT); // Set the AC Load as output
attachInterrupt(0, zero_crosss_int, RISING); // Choose the zero cross interrupt # from the table above
}
@chayanforyou
chayanforyou / counting-millis.c
Created April 11, 2019 03:15 — forked from adnbr/counting-millis.c
Counting the passing of milliseconds using Timer1 on AVR.
/* Counting Milliseconds with Timer1
* ---------------------------------
* For more information see
* http://www.adnbr.co.uk/articles/counting-milliseconds
*
* 620 bytes - ATmega168 - 16MHz
*/
// 16MHz Clock
#define F_CPU 16000000UL