Skip to content

Instantly share code, notes, and snippets.

@sarbyn
sarbyn / test.kt
Created December 19, 2018 13:46
OkHTTP3 and HTTP2 post timeouts
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.RequestBody
import java.io.File
import java.security.cert.X509Certificate
import java.util.concurrent.TimeUnit
import javax.net.ssl.SSLContext
import javax.net.ssl.TrustManager
import javax.net.ssl.X509TrustManager
@sarbyn
sarbyn / setup_vm.sh
Last active November 22, 2016 10:14
Fine tuning of android build machine
#!/bin/bash
# setup ubuntu 16.04
# http://forum.xda-developers.com/chef-central/android/guide-how-to-setup-ubuntu-16-04-lts-t3363669
# or download a working virtual machine from
# https://nathanpfry.com/builduntu-virtual-machine-android-rom-compiling/
echo "Ready to update system - press ENTER"
read x
sudo apt-get update
sudo apt-get dist-upgrade
@sarbyn
sarbyn / gist:0d165dc48f90f60c2edb007038c98e38
Last active November 18, 2016 08:56
Relocation error - Camera error on JFVELTE - CM 14.0
11-16 16:28:30.242 23138 23138 E linker : /system/lib/libmmjpeg.so: has text relocations
11-16 16:28:30.242 23138 23138 F libc : CANNOT LINK EXECUTABLE "/system/bin/mm-qcamera-daemon": /system/lib/libmmjpeg.so: has text relocations
11-16 16:28:30.242 23138 23138 F libc : Fatal signal 6 (SIGABRT), code -6 in tid 23138 (mm-qcamera-daem)
11-16 16:28:30.250 23138 23138 F libc : failed to resend signal during crash: Operation not permitted
11-16 16:28:30.251 23139 23139 E DEBUG : unexpected waitpid response: n=23138, status=00000000
In order to use libmmjpeg.so with text relocation the mediaserver.te sepolicy file needs to be fixed with:
+ # For text relocations in /system/vendor/lib/libmmjpeg.so
+ allow mediaserver system_file:file execmod;