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
36 lines
1.1 KiB
Kotlin
36 lines
1.1 KiB
Kotlin
package org.telegram.tlrpc
|
|
|
|
import org.telegram.tlrpc.models.*
|
|
import org.telegram.tlrpc.schema.TlSchemaJson
|
|
import org.telegram.tlrpc.schema.TlSchemaJsonParser
|
|
import org.telegram.tlrpc.schema.TlSchemaObject
|
|
|
|
object SchemeJsonParser {
|
|
fun parse(version: TlSchemeVersion, json: String): TlScheme {
|
|
val scheme = TlSchemaJsonParser.parse(json)
|
|
|
|
val constructors = scheme.constructors.map(::parseConstructor)
|
|
val methods = scheme.methods.map(::parseConstructor)
|
|
|
|
return TlScheme(
|
|
version = version,
|
|
json = scheme,
|
|
constructors2 = constructors,
|
|
methods2 = methods
|
|
)
|
|
}
|
|
|
|
private fun parseConstructor(constructor: TlSchemaJson.JsonTlObject): TlObject {
|
|
val result = TlSchemaObject.from(constructor)
|
|
|
|
return TlObject(
|
|
key = TlTypeKey(
|
|
name = TlTypeName(type = result.type, predicate = result.name),
|
|
constructorId = result.magic
|
|
),
|
|
params = TlParams(result.params.map {
|
|
TlParam(it.name, it.type)
|
|
})
|
|
)
|
|
}
|
|
}
|