Skip to content

Instantly share code, notes, and snippets.

View oasisfeng's full-sized avatar
🏠
Working from home

oasisfeng oasisfeng

🏠
Working from home
View GitHub Profile
@douglasselph
douglasselph / AndroidEasySetLangCountry
Created March 15, 2017 21:13
The following allows you to very easily flip between languages and country on Android.
The following allows you to very easily flip between languages and country on Android.
This will IMMEDIATELY cause the change without even needing to shut down the target testing app.
(That is, the currently displayed page will reloaded.)
You first need to install this APP on the phone:
https://play.google.com/store/apps/details?id=net.sanapeli.adbchangelanguage&hl=en
Then to flip copy and paste one of the lines below in a terminal.
@chrisbanes
chrisbanes / SystemUiHelper.java
Last active March 2, 2024 18:57
SystemUiHelper
/*
* Copyright (C) 2014 The Android Open Source Project
*
* 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
@rallat
rallat / dexmethodcount
Last active March 25, 2024 13:54
Android Dex Method Count more sophisticated scripts that gives you method cound by package @JakeWharton https://gist.github.com/JakeWharton/6002797 and @tsmith https://gist.github.com/tyvsmith/6056422
You can add this to your shell profile and then use it as dexcount file.
This file should have a classes.dex in order to work, that means it has to be a android lib project or android apk.
count(){
mkdir temp >/dev/null
cp $1 temp/$1+copy > /dev/null
unzip temp/$1+copy -d temp/ > /dev/null
cat temp/classes.dex | head -c 92 | tail -c 4 | hexdump -e '1/4 "%d\n"'
rm -R temp > /dev/null
}
@jamesdavidson
jamesdavidson / install.sh
Created July 6, 2012 04:01
Install NodeJS 0.8.1 on fresh Ubuntu 12 installation
#!/bin/bash
sudo apt-get update
sudo apt-get install build-essential curl git
git clone git://github.com/creationix/nvm ~/nvm
. ~/nvm/nvm.sh
nvm install v0.8.1
@granoeste
granoeste / GoogleServiceAuthExampleActivity.java
Created September 28, 2011 12:53
[Android] Google Service Authenticate
public class GoogleServiceAuthExampleActivity extends ListActivity {
private static final String TAG = GoogleServiceAuthExampleActivity.class.getName();
GoogleServiceAuthenticator authenticator;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
authenticator = new GoogleServiceAuthenticator(this);
Account[] accounts = authenticator.getGoogleAccounts();