Skip to content

Instantly share code, notes, and snippets.

@aclegg2011
aclegg2011 / caching-https-creds.markdown
Created March 7, 2020 21:42 — forked from ahoward/caching-https-creds.markdown
Fix Username/Password prompting for github repos cloned via https scheme

github recently switched to an https scheme as the default for cloning repos. as a side effect you may suddenly be prompted for a 'Username' and 'Password' when you push where, previously, you were able to do so without typing in credentials. the solution is to cause git to cache https credentials which is easy, since git uses curl under the covers

in your home directory create a file called '.netrc', for example

/Users/ahoward/.netrc

in it put these contents

@aclegg2011
aclegg2011 / android-adb-pull-apk.md
Last active May 22, 2019 20:15 — forked from ctrl-freak/android-adb-pull-apk.md
Retrieve APK from Non-Rooted Android Device through ADB

https://stackoverflow.com/a/18003462/348146

None of these suggestions worked for me, because Android was appending a sequence number to the package name to produce the final APK file name (this may vary with the version of Android OS). The following sequence of commands is what worked for me on a non-rooted device:

  1. Determine the package name of the app, e.g. com.example.someapp. Skip this step if you already know the package name.

    adb shell pm list packages

    Look through the list of package names and try to find a match between the app in question and the package name. This is usually easy, but note that the package name can be completely unrelated to the app name. If you can't recognize the app from the list of package names, try finding the app in Google Play using a browser. The URL for an app in Google Play contains the package name.

@aclegg2011
aclegg2011 / gist:bbac3281968308444c2be917c6b7211c
Created May 10, 2019 17:43 — forked from msfjarvis/sepolicy.md
How to write sepolicy to fix a denial

Denial in question

avc: denied { read write } for pid=29059 comm="i.tetherservice" name="ipa" dev="tmpfs" ino=11991 scontext=u:r:system_app:s0 tcontext=u:object_r:ipa_dev:s0 tclass=chr_file permissive=0

sepolicy fix

allow system_app ipa_dev:chr_file {read write};
@aclegg2011
aclegg2011 / cmsetup.sh
Created December 31, 2018 01:55 — forked from rodero95/cmsetup.sh
Script to set up an Android build server running Red Hat Enterprise Linux
#!/bin/bash
mkdir ~/sources
# Update yum
sudo yum update
# Packages to build AOSP 4.0.3 or CM9
sudo yum install make curl gnupg git bison unzip zip flex gperf
sudo yum install gcc-c++ libstdc++-devel
@aclegg2011
aclegg2011 / audit2allow-sepolicy-android
Created December 1, 2018 16:54 — forked from Nihhaar/audit2allow-sepolicy-android
Addressing selinux denials using audit2allow for android using logcat
# Goto android source code root and then execute following commands
# Keep the logcat.log in the root
export ANDROID_BUILD_TOP=$(pwd)
./external/selinux/prebuilts/bin/audit2allow -p out/target/product/{devicename}/root/sepolicy < logcat.log
# Copy the generated rules in respective files in the device tree