Skip to content

Commit d54584a

Browse files
committed
fix allowedAcsChannels5g check
1 parent 93bf5ec commit d54584a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

app/src/main/java/com/xhy/xp/softaphelper/MainHook.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ public class MainHook implements IXposedHookLoadPackage {
6464
public static final int CHANNEL_WIDTH_320MHZ = 11;
6565
// channel: 149,153,157,161,165
6666
// freq: 5745,5765,5785,5805,5825
67-
private static HashSet<Integer> AvailableChannelSet = new HashSet<>(Arrays.asList(149, 153, 157, 161, 165));
68-
private static HashSet<Integer> AvailableChannelFreqSet = new HashSet<>(Arrays.asList(5745, 5765, 5785, 5805, 5825));
67+
private static HashSet<Integer> AvailableChannelSet_LOW = new HashSet<>(Arrays.asList(36, 40, 44));
68+
private static HashSet<Integer> AvailableChannelSet_HIGH = new HashSet<>(Arrays.asList(149, 153, 157, 161, 165));
69+
// private static HashSet<Integer> AvailableChannelFreqSet = new HashSet<>(Arrays.asList(5745, 5765, 5785, 5805, 5825));
6970

7071
static {
7172
AddressMap.put(TETHERING_WIFI, WIFI_HOST_IFACE_ADDRESS);
@@ -187,14 +188,14 @@ protected void beforeHookedMethod(XC_MethodHook.MethodHookParam param) throws Th
187188
// Log.e(TAG, "orig allowedAcsChannels5g " + allowedAcsChannels5g);
188189
// Log.e(TAG, "orig maxChannelBandwidth " + maxChannelBandwidth);
189190

190-
// config set 5G channel
191+
// config has set 5G channel
191192
if (channel5gIndex >= 0) {
192193
int channel = channels.get(BAND_5GHZ);
193194

194195
// 5GHz + allowedAcsChannels5g.size == 0
195196
if (channel == 0 && allowedAcsChannels5g.size() == 0) {
196197
// 5G ACS channels
197-
param.args[21] = AvailableChannelSet;
198+
param.args[21] = AvailableChannelSet_HIGH;
198199
// max bandwidth
199200
param.args[23] = CHANNEL_WIDTH_320MHZ;
200201
}

0 commit comments

Comments
 (0)