Skip to content

Instantly share code, notes, and snippets.

@spieglt
spieglt / UnhiddenSoftApConfigurationBuilder.kt
Created January 22, 2024 02:33 — forked from mikedawson/UnhiddenSoftApConfigurationBuilder.kt
Android 13+ LocalOnlyHotspot custom config
/**
* Reflection workaround to access hidden SoftApConfiguration.Builder so it can be used to set
* LocalOnlyHotspot on Android 13+
*
* LocalOnlyHotspotConfig is generated here by Android:
* https://cs.android.com/android/platform/superproject/+/refs/heads/master:packages/modules/Wifi/service/java/com/android/server/wifi/WifiApConfigStore.java;drc=7bb4243a97d53af6cbd4de21bcc61556a758898b;l=423
*/
@RequiresApi(30)
class UnhiddenSoftApConfigurationBuilder {
@mikedawson
mikedawson / UnhiddenSoftApConfigurationBuilder.kt
Created July 6, 2023 13:41
Android 13+ LocalOnlyHotspot custom config
/**
* Reflection workaround to access hidden SoftApConfiguration.Builder so it can be used to set
* LocalOnlyHotspot on Android 13+
*
* LocalOnlyHotspotConfig is generated here by Android:
* https://cs.android.com/android/platform/superproject/+/refs/heads/master:packages/modules/Wifi/service/java/com/android/server/wifi/WifiApConfigStore.java;drc=7bb4243a97d53af6cbd4de21bcc61556a758898b;l=423
*/
@RequiresApi(30)
class UnhiddenSoftApConfigurationBuilder {
public class GussianBlur {
private static final GussianBlur INSTANCE = new GussianBlur();
private int sigma = 15; //通过调节该参数设置高斯模糊的模糊程度,越大越模糊
private int radius = 3 * sigma;
private double[] kernel = new double[radius + 1]; //kernel[i]表示离中心点距离为i的权重
private GussianBlur() {}
/**
* 初始化卷积核