Skip to content

Instantly share code, notes, and snippets.

@Kr328
Kr328 / bililive-mask-remover.user.js
Created June 4, 2024 06:36
Bilibili Live Mask Remover
// ==UserScript==
// @name Bilibili Mask Remover
// @namespace http://github.com/Kr328/bililive-mask-remover
// @version 1.0
// @author Kr328
// @description Remove mask of bilibli live.
// @license GPLv3
// @icon https://www.bilibili.com/favicon.ico
// @match *://live.bilibili.com/*
// @grant GM_addStyle
@Kr328
Kr328 / Dockerfile
Last active May 8, 2024 18:47
A dockerfile to create a flutter build enviroment on windows-x64 with scoop & rust.
# NOTE: This Dockerfile requires Windows containers support.
# See also: https://learn.microsoft.com/en-us/virtualization/windowscontainers/quick-start/set-up-environment
#
# NOTE: Windows Containers run by default with 2 CPUs and 2GB of memory. If you need more resources, try specifying the following parameters:
# 1. --cpu-count
# 2. --memory
# Example: docker run --cpu-count 16 --memory 8gb <your-tag> -Command flutter build
FROM mcr.microsoft.com/windows/servercore:ltsc2022
@Kr328
Kr328 / CLASH_FOR_ANDROID_PRIVACY_POLICY.md
Created November 12, 2023 05:06
Privacy Policy for Clash for Android.

Privacy Policy

The Clash for Android is built as an Open Source software. This app is provided by personal at no cost and is intended for use as is.

This page is used to inform visitors regarding our policies with the collection, use, and disclosure of Personal Information if anyone decided to use our app.

Information Collection and Use

We will not upload any of your personally information and that will be stored in the internal storage or memory.

@Kr328
Kr328 / bugreport-decrypt.main.kts
Created June 30, 2023 20:44
BugReport decrypt tools for clash-multiplatform.
#!/usr/bin/env kotlin
/*
BugReport decrypt tools for clash-multiplatform.
Usage:
kotlin bugreport-decrypt.main.kts <path/to/signing.properties> <path/to/bugreport-archive>
Output:
<password of archive>
@Kr328
Kr328 / bpf-store-inode-pid-mapping.c
Last active June 10, 2023 10:37
bpf program to store inode to pid mapping.
#include "bpf.h"
#include "external.h"
#include "helpers.h"
#include "ptrace.h"
#include "types.h"
enum module_config_index {
NAMESPACE_DEV,
NAMESPACE_INODE,
};
token = new Binder();
try {
Context _context = android.app.ActivityThread.systemMain().getSystemContext();
final Context context = new ContextWrapper(_context) {
@Override
public Object getSystemService(String name) {
if (Context.WINDOW_SERVICE.equals(name)) {
WindowManager wm = (WindowManager) super.getSystemService(name);
if (wm != null) {
((android.view.WindowManagerImpl) wm).setDefaultToken(token);
@Kr328
Kr328 / receive-broadcast-in-root.java
Last active May 27, 2023 10:30
Receive broadcast in root process.
package com.github.kr328.clash.shizukutest;
import android.content.Intent;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import java.io.BufferedReader;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
@Kr328
Kr328 / jni.zig
Last active February 27, 2023 08:31
A jni stubs in ziglang.
const std = @import("std");
// TODO: replace with std.builtin.VaList
pub const va_list = [*c]extern struct {
gp_offset: c_uint,
fp_offset: c_uint,
overflow_arg_area: ?*anyopaque,
reg_save_area: ?*anyopaque,
};
@Kr328
Kr328 / sync-systemd-boot-next-boot-with-current.ps1
Created June 28, 2022 14:43
Sync systemd boot next boot with current entry (Windows).
Import-Module UEFIv2
$NAMESPACE = "{4a67b082-0a4c-41cf-b6c7-440b29bb8c4f}"
$lastBootEntry = Get-UEFIVariable -VariableName "LoaderEntrySelected" -Namespace $NAMESPACE -AsByteArray
Set-UEFIVariable -VariableName "LoaderEntryOneShot" -Namespace $NAMESPACE -ByteArray $lastBootEntry
@Kr328
Kr328 / sync-systemd-boot-next-boot-with-current.go
Last active June 28, 2022 12:08
Sync systemd boot next boot with current entry.
package main
import (
"fmt"
"io"
"os"
"runtime"
"syscall"
"unsafe"
)