Skip to content

Instantly share code, notes, and snippets.

Preface

Genymotion recently moved root access behind a paywall, making it a premium feature. However, if you're using Genymotion for Android development, testing, or educational purposes, having root access can be essential. Root access allows developers to access deeper functionality, test root-only features, and explore Android's internals without restrictions.

The good news is that with a bit of work, you can still enable root on a Genymotion emulator if you have access to its disk image and platform keys. This guide walks you through the process of adding a custom system app, RootToggle, which will allow you to switch root access on and off without needing Genymotion's paid root access feature.

This Gist details the steps to compile, sign, and install RootToggle as a system app in a Genymotion emulator by directly modifying the emulator's disk image IN LINUX (use a virtual machine on Windows to do that).


@4ft35t
4ft35t / simyo-esim.sh
Created August 19, 2024 08:41
get simyo esim code
#!/bin/bash
# get eSim LPA profile
# https://blog.ugoearn.com/simyo_5ber/
# https://shuzijumin.com/thread-479-1-1.html
phone_number="06..."
password="..."
simyo_curl() {
#!/usr/bin/env python3
# coding: utf-8
# @2024-07-25 22:54:41
# vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4:
'''
resolve sudoku
'''
from copy import deepcopy
@4ft35t
4ft35t / ForceEnablingXcodeLLM.md
Created June 17, 2024 07:52 — forked from unixzii/ForceEnablingXcodeLLM.md
A guide to force enabling Xcode LLM feature on China-SKU Macs.

Introduction

Apple restricted the access to Xcode LLM (Predictive code completion) feature on China models of Mac. This guide provides a way to bypass that restriction. It's verified on macOS 15.0 Beta (24A5264n), but there is no guarentee that it will always work on later macOS versions.

Prerequisites

  • Xcode is installed and run at least once.
  • SIP debugging restrictions are disabled (via csrutil enable --without debug command in recovery mode).

Disclaimer

@4ft35t
4ft35t / log
Created December 18, 2023 06:09
clash-jegotrip.log.txt
# Capture on 2023-12-18 13:49:46.768
13:49:46.774 Info: [APP] Logcat level: info
13:49:56.220 Info: [UDP] 172.19.0.1:16403 --> comm-main.ess.apple.com:3481 doesn't match any rule using DIRECT
13:49:57.500 Info: [TCP] 172.19.0.1:62898 --> cl4-cn.apple.com:443 match GeoIP(CN) using DIRECT
13:49:57.506 Info: [TCP] 172.19.0.1:62897 --> cl3.apple.com:443 match GeoIP(CN) using DIRECT
13:49:57.507 Info: [TCP] 172.19.0.1:62896 --> iphone-ld.apple.com:443 match GeoIP(CN) using DIRECT
13:49:57.507 Info: [TCP] 172.19.0.1:62895 --> iphone-ld.apple.com:443 match GeoIP(CN) using DIRECT
13:49:57.522 Info: [TCP] 172.19.0.1:62899 --> gs-loc-cn.apple.com:443 match GeoIP(CN) using DIRECT
13:49:57.874 Info: [TCP] 172.19.0.1:62900 --> gsp85-cn-ssl.ls.apple.com:443 match GeoIP(CN) using DIRECT
13:49:57.879 Info: [TCP] 172.19.0.1:62902 --> ocsp2.apple.com:443 match GeoIP(CN) using DIRECT
sum(a): 10656
sum(b): 10656
a = 1776 , len(b) = 83, sum(b) = 10656
588
504
280
224
180
a = 2667 , len(b) = 78, sum(b) = 8880
364
@4ft35t
4ft35t / AndroidManifest.xml
Last active April 14, 2022 02:49 — forked from burinov/1commands.sh
Example on how to use adb to start an Activity,BroadcastReceiver or Service from adb and include intent extras too.for Activity: adb shell am start -n "com.peirr.test/com.peirr.test.MyActivity" --es name "John" --ei age 30for BroadcastReceiver adb shell am broadcast -n "com.peirr.test/com.peirr.test.MyReceiver" --es name "John" --ei age 30for Se…
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.peirr.test">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
@4ft35t
4ft35t / google-photo-free-up-space.js
Last active March 25, 2022 13:36
Upload Synology photos to FTP. eg: FTP server on Pixel one(2016) to get unlimited Google Photos backup.
auto();
console.show()
var utils = require('utils.js');
pkgName='com.google.android.apps.photos'
// 直接启动
app.startActivity({
packageName: pkgName,
@4ft35t
4ft35t / result.md
Last active December 30, 2019 09:24
cat test.txt | sed  -n '/^start/,/^end/{/^start/,/i hate you/{/i hate you/p;};}'
i hate you 2
i hate you 4
i hate you 6
cat test.txt| awk '/start /{in_block=1; next} in_block && /i hate you/{t=$0; in_block=0; next} t && /end/{print t; t=""}'
i hate you 2
@4ft35t
4ft35t / android-captive.sh
Created June 20, 2019 06:27 — forked from tonyseek/android-captive.sh
Overrides the captive portal settings of Android in the People's Republic China Mainland
#!/usr/bin/env sh
adb shell settings put global captive_portal_fallback_url http://g.cn/generate_204
adb shell settings put global captive_portal_http_url http://www.google.cn/generate_204
adb shell settings put global captive_portal_https_url https://www.google.cn/generate_204
adb shell settings put global captive_portal_other_fallback_urls http://www.qualcomm.cn/generate_204