Skip to content

Instantly share code, notes, and snippets.

View duangsuse's full-sized avatar
👨‍💻
Leaning at school

duangsuse duangsuse

👨‍💻
Leaning at school
View GitHub Profile
import javax.swing.*;
import java.awt.*;
import java.awt.geom.Path2D;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.Arrays;
import java.util.stream.Collectors;
/**
@Trumeet
Trumeet / JPlayer.java
Created January 16, 2021 03:03
Linux Terminal has the capability of displaying 8-bit colour, so why not play something on it?
import org.jcodec.api.FrameGrab;
import org.jcodec.common.io.NIOUtils;
import org.jcodec.common.model.Picture;
import org.jcodec.scale.AWTUtil;
import java.awt.image.BufferedImage;
import java.io.*;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
@Trumeet
Trumeet / main.c
Created October 11, 2020 21:37
EvictPowerSrv Linux version rewritten in C.
/*
* Shutdown the system properly when Azure evicts your Spot instance.
*
* Compile:
* Requires libcurl 4 and json-c 5 headers.
* cc -Wall -Werror -lcurl -ljson-c main.c
*
* Running:
* Requires `shutdown` command and the rights to execute it.
* Requires libcurl.so.4, libjson-c.so.5, and glibc.
@duangsuse
duangsuse / Ruby_Book_For_Noobs.md
Last active June 23, 2018 12:49
小白的 Ruby 红宝书

小白的 Ruby 红宝书

@duangsuse
duangsuse / geekapk_backend.md
Last active May 31, 2018 15:21
GeekApk 后端设计第一版

Complete Documentation of Project GeekApk :: Backend

这是 GeekApk Project 后端的完整文档,包含:

额外定义:

  • 通知/Timeline定义
  • WebSocket API
  • WebHooks 支持
  • 身份验证 模式

一、 简述

AXML 即 Android Binary XML, 是 Android 应用程序 APK 包中保存 xml 文件数据的一种方式, 可以减小 xml 文件的大小.

本文章与我的另一篇文章手把手教你解析 resources.arsc 是相关联的, resources.arsc 文件是 apk 的资源索引文件, 而 xml 文件是 apk 的资源文件, resources.arsc 保存了 xml 中需要用到的资源的索引, 它们之间有非常强的依赖关系, apk在执行的时候缺一不可.

另外大家在用 AXMLPrinter 去解码 AXML 文件时会看见输出中有很多属性的值都是一串数字, 很难明白是什么意思, 实际上这串数字就是资源的索引 id 值, 需要用这个 id 去 resources.arsc 中查找才能得到具体的字符串, 知道这个属性的值是 @string/XXXX 或者 @drawable/XXXX 等等.

在上面的文章中我介绍了 resources.arsc 文件的解析方式, 本文我来介绍怎样来解析 AXML 文件.

@xvitaly
xvitaly / remove_crw.cmd
Last active March 16, 2024 16:12
Remove telemetry updates for Windows 7 and 8.1
@echo off
echo Uninstalling KB3075249 (telemetry for Win7/8.1)
start /w wusa.exe /uninstall /kb:3075249 /quiet /norestart
echo Uninstalling KB3080149 (telemetry for Win7/8.1)
start /w wusa.exe /uninstall /kb:3080149 /quiet /norestart
echo Uninstalling KB3021917 (telemetry for Win7)
start /w wusa.exe /uninstall /kb:3021917 /quiet /norestart
echo Uninstalling KB3022345 (telemetry)
start /w wusa.exe /uninstall /kb:3022345 /quiet /norestart
echo Uninstalling KB3068708 (telemetry)