FoxiGram/TMessagesProj/jni/voip/webrtc/base/files/scoped_file_android.cc
instant992 8e79f2ee9c FoxiGram: Telegram client with built-in Xray VLESS proxy
Based on Nekogram. Key additions:
- Rebrand to FoxiGram (app name, APK name, applicationId com.foxigram.app)
- Embedded Xray (VLESS+Reality) proxy client via JNI libxray.so
- Bundled hidden one-tap proxies (LTE + WiFi), read-only in UI
- Auto-restore proxy on restart, rebind to active network (LTE/WiFi)
- Server credentials externalized to git-ignored XrayServers.java (+ template)
- libxray Go source included; compiled .so, keystore, google-services.json ignored
2026-06-08 16:41:07 +04:00

40 lines
1.1 KiB
C++

// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/files/scoped_file.h"
#include <stdint.h>
// Copied from <android/fdsan.h>.
// This can go away once this header is included in our copy of the NDK.
extern "C" {
void android_fdsan_exchange_owner_tag(int fd,
uint64_t expected_tag,
uint64_t new_tag)
__attribute__((__weak__));
}
namespace base {
namespace internal {
static uint64_t ScopedFDToTag(const ScopedFD& owner) {
return reinterpret_cast<uint64_t>(&owner);
}
// static
void ScopedFDCloseTraits::Acquire(const ScopedFD& owner, int fd) {
if (android_fdsan_exchange_owner_tag) {
android_fdsan_exchange_owner_tag(fd, 0, ScopedFDToTag(owner));
}
}
// static
void ScopedFDCloseTraits::Release(const ScopedFD& owner, int fd) {
if (android_fdsan_exchange_owner_tag) {
android_fdsan_exchange_owner_tag(fd, ScopedFDToTag(owner), 0);
}
}
} // namespace internal
} // namespace base