Skip to content

Instantly share code, notes, and snippets.

View xingrz's full-sized avatar

XiNGRZ xingrz

View GitHub Profile
@ZenGround0
ZenGround0 / client.go
Created January 3, 2018 20:26
Golang HTTP multipart streaming
package main
import (
"io"
"mime/multipart"
"net/http"
"net/url"
"os"
"fmt"
)
@nickbutcher
nickbutcher / 1 search_bar.xml
Last active March 26, 2022 10:03
Demonstrating morphing a search icon into a search field. To do this we use an AnimatedVectorDrawable (https://developer.android.com/reference/android/graphics/drawable/AnimatedVectorDrawable.html) made up of two paths. The first is the search icon (as a single line) the second is the horizontal bar. We then animate the 'trimPathStart' property …
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015 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
@mmuszkow
mmuszkow / SignedJar.java
Last active May 24, 2022 06:35 — forked from mmm444/SimpleSignedJar.java
Signed JAR
package ch.cern.test.mdm.utils;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.security.PrivateKey;
import java.security.Security;
@mmm444
mmm444 / SimpleSignedJar.java
Created October 21, 2013 16:42
dependencies: org.bouncycastle:bcpkix-jdk15on:1.49, com.google.guava:guava:15.0
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.security.KeyStore;
import java.security.PrivateKey;
import java.security.Security;
import java.security.cert.Certificate;
import java.security.cert.X509Certificate;
import java.util.Arrays;
import java.util.List;
@aras-p
aras-p / preprocessor_fun.h
Last active April 28, 2024 15:25
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@zhuowei
zhuowei / Added.java
Created July 2, 2013 21:11
New and removed labs in Google Glass XE7
GPS_ENABLE_LOCAL("GPS_ENABLE_LOCAL", 26, false),
GPS_ENABLE_REMOTE("GPS_ENABLE_REMOTE", 27, true),
HO_B("HO_B", 4, false),
HO_HO_HO("HO_HO_HO", 8, false),
LOG_NEG_HOTWORD_REC("LOG_NEG_HOTWORD_REC", 11, false),
LOG_POS_HOTWORD_REC("LOG_POS_HOTWORD_REC", 10, true),
NV_TRST("NV_TRST", 28, false),
OKG_INC_CALL("OKG_INC_CALL", 52, true),
SC_RM("SC_RM", 53, false),
USE_SAX_PARSER("USE_SAX_PARSER", 42, false),
@zhuowei
zhuowei / notle.md
Last active December 17, 2015 18:39
Random Glass notes

One of the UUIDs used by Glass:

public static final UUID IDENTITY_UUID = UUID.fromString("f96647cf-7f25-4277-843d-f407b4192f8b");

All Glass applications (excluding GlassSystemUI) are built with a bog-standard Android SDK, hence the use of reflection to access hidden APIs and no odexing.

Glass applications use a few Library Projects, as evidenced by the multiple R.java files:

./com/google/glass/home/R.java ./com/google/glass/logging/R.java

@zhuowei
zhuowei / glasslabs.md
Last active December 17, 2015 14:29
Glass Labs experiments: what they do

Glass Lab Experiments

Updated: July 2nd (XE7)

Ron Amadeo of Android Police did a review of these experiments: http://www.androidpolice.com/2013/05/24/google-glasss-hidden-labs-features-ok-glass-everywhere-web-browsing-video-stabilization-and-more-video/

Google Glass has a series of Labs experiments that can be enabled on engineering or userdebug builds. Using APKTool, I've removed that restriction and now they can be enabled with root access.

To start, for example, the SOUND_SEARCH lab, type in a root shell

@zhuowei
zhuowei / gist:5616343
Last active December 17, 2015 13:19
Xenologer
grep -r getDeviceTapTimeout .
./com/google/glass/input/GestureDetector.smali: invoke-static {v0}, Lcom/google/glass/hidden/HiddenViewConfiguration;->getDeviceTapTimeout(Landroid/view/ViewConfiguration;)J
./com/google/glass/hidden/HiddenViewConfiguration.smali:.method public static getDeviceTapTimeout(Landroid/view/ViewConfiguration;)J
./com/google/glass/hidden/HiddenViewConfiguration.smali: const-string v1, "getDeviceTapTimeout"
grep -r loadLibrary smali
smali/com/google/glass/camera/CameraUtils.smali: invoke-static {v0}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V
smali/com/google/glass/voice/ResampleInputStream.smali: invoke-static {v0}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V
smali/com/google/glass/voice/Sensory.smali: invoke-static {v0}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V