Browse Source

Reduce max accounts to 16

pull/397/head
世界 8 months ago
parent
commit
56c45fc5c1
No known key found for this signature in database GPG Key ID: CD109927C34A63C4
  1. 12
      .github/workflows/debug.yml
  2. 12
      .github/workflows/release.yml
  3. 50
      TMessagesProj/jni/tgnet/ConnectionsManager.cpp
  4. 2
      TMessagesProj/jni/tgnet/Defines.h
  5. 2
      TMessagesProj/src/main/java/org/telegram/messenger/UserConfig.java
  6. 2
      bin/libs/native.sh
  7. 9
      run

12
.github/workflows/debug.yml

@ -14,7 +14,7 @@ on:
jobs:
ffmpeg:
name: Native Build ( FFmpeg )
name: Native Build (FFmpeg)
runs-on: ubuntu-latest
steps:
- name: Checkout
@ -42,7 +42,7 @@ jobs:
run: |
./run init libs ffmpeg
boringssl:
name: Native Build ( BoringSSL )
name: Native Build (BoringSSL)
runs-on: ubuntu-latest
steps:
- name: Checkout
@ -71,7 +71,7 @@ jobs:
./run init action boringssl
./run init libs boringssl
native:
name: Native Build ( Telegram )
name: Native Build (Telegram)
runs-on: ubuntu-latest
needs:
- ffmpeg
@ -127,7 +127,7 @@ jobs:
run: |
./run libs native
v2ray:
name: Native Build ( V2ray )
name: Native Build (V2ray)
runs-on: ubuntu-latest
steps:
- name: Checkout
@ -157,7 +157,7 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
run: ./run libs v2ray
shadowsocks:
name: Native Build ( Shadowsocks )
name: Native Build (Shadowsocks)
runs-on: ubuntu-latest
steps:
- name: Checkout
@ -187,7 +187,7 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
run: ./run libs shadowsocks
shadowsocksr:
name: Native Build ( ShadowsocksR )
name: Native Build (ShadowsocksR)
runs-on: ubuntu-latest
steps:
- name: Checkout

12
.github/workflows/release.yml

@ -26,7 +26,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ffmpeg:
name: Native Build ( FFmpeg )
name: Native Build (FFmpeg)
runs-on: ubuntu-latest
needs: check
steps:
@ -55,7 +55,7 @@ jobs:
run: |
./run init libs ffmpeg
boringssl:
name: Native Build ( BoringSSL )
name: Native Build (BoringSSL)
runs-on: ubuntu-latest
needs: check
steps:
@ -85,7 +85,7 @@ jobs:
./run init action boringssl
./run init libs boringssl
native:
name: Native Build ( Telegram )
name: Native Build (Telegram)
runs-on: ubuntu-latest
needs:
- ffmpeg
@ -141,7 +141,7 @@ jobs:
run: |
./run libs native
v2ray:
name: Native Build ( V2ray )
name: Native Build (V2ray)
runs-on: ubuntu-latest
needs: check
steps:
@ -172,7 +172,7 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
run: ./run libs v2ray
shadowsocks:
name: Native Build ( Shadowsocks )
name: Native Build (Shadowsocks)
runs-on: ubuntu-latest
needs: check
steps:
@ -203,7 +203,7 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
run: ./run libs shadowsocks
shadowsocksr:
name: Native Build ( ShadowsocksR )
name: Native Build (ShadowsocksR)
runs-on: ubuntu-latest
needs: check
steps:

50
TMessagesProj/jni/tgnet/ConnectionsManager.cpp

@ -180,57 +180,9 @@ ConnectionsManager& ConnectionsManager::getInstance(int32_t instanceNum) {
static ConnectionsManager instance14(14);
return instance14;
case 15:
default:
static ConnectionsManager instance15(15);
return instance15;
case 16:
static ConnectionsManager instance16(16);
return instance16;
case 17:
static ConnectionsManager instance17(17);
return instance17;
case 18:
static ConnectionsManager instance18(18);
return instance18;
case 19:
static ConnectionsManager instance19(19);
return instance19;
case 20:
static ConnectionsManager instance20(20);
return instance20;
case 21:
static ConnectionsManager instance21(21);
return instance21;
case 22:
static ConnectionsManager instance22(22);
return instance22;
case 23:
static ConnectionsManager instance23(23);
return instance23;
case 24:
static ConnectionsManager instance24(24);
return instance24;
case 25:
static ConnectionsManager instance25(25);
return instance25;
case 26:
static ConnectionsManager instance26(26);
return instance26;
case 27:
static ConnectionsManager instance27(27);
return instance27;
case 28:
static ConnectionsManager instance28(28);
return instance28;
case 29:
static ConnectionsManager instance29(29);
return instance29;
case 30:
static ConnectionsManager instance30(30);
return instance30;
case 31:
default:
static ConnectionsManager instance31(31);
return instance31;
}
}

2
TMessagesProj/jni/tgnet/Defines.h

@ -28,7 +28,7 @@
#define DOWNLOAD_CONNECTIONS_COUNT 2
#define UPLOAD_CONNECTIONS_COUNT 4
#define CONNECTION_BACKGROUND_KEEP_TIME 10000
#define MAX_ACCOUNT_COUNT 32
#define MAX_ACCOUNT_COUNT 16
#define USE_DELEGATE_HOST_RESOLVE
#define USE_IPV4_ONLY 0

2
TMessagesProj/src/main/java/org/telegram/messenger/UserConfig.java

@ -23,7 +23,7 @@ import java.util.Arrays;
public class UserConfig extends BaseController {
public static int selectedAccount;
public final static int MAX_ACCOUNT_COUNT = 32;
public final static int MAX_ACCOUNT_COUNT = 16;
private final Object sync = new Object();
private boolean configLoaded;

2
bin/libs/native.sh

@ -4,7 +4,7 @@ source "bin/init/env.sh"
./gradlew TMessagesProj:stripFullFossDebugSymbols || exit 1
OUT=TMessagesProj/build/intermediates/stripped_native_libs/fullFossRelease/out/lib
OUT=TMessagesProj/build/intermediates/stripped_native_libs/fullFoss/out/lib
DIR=TMessagesProj/src/main/libs
rm -rf $DIR/armeabi-v7a
mkdir -p $DIR/armeabi-v7a

9
run

@ -1,11 +1,14 @@
#!/bin/bash
EXEC=""
TARGET="bin"
for e in $@; do
TARGET="$TARGET/$e"
shift
if [ -x "${TARGET}.sh" ]; then
echo ">> ${TARGET}.sh"
exec "${TARGET}.sh" $@
EXEC="${TARGET}.sh"
fi
done
done
echo ">> $EXEC"
exec "$EXEC" $@
Loading…
Cancel
Save