Update to 3.2.6
|
@ -5,7 +5,7 @@ repositories {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile 'com.android.support:support-v4:23.0.+'
|
compile 'com.android.support:support-v4:23.1.+'
|
||||||
compile 'com.google.android.gms:play-services:3.2.+'
|
compile 'com.google.android.gms:play-services:3.2.+'
|
||||||
compile 'net.hockeyapp.android:HockeySDK:3.5.+'
|
compile 'net.hockeyapp.android:HockeySDK:3.5.+'
|
||||||
compile 'com.googlecode.mp4parser:isoparser:1.0.+'
|
compile 'com.googlecode.mp4parser:isoparser:1.0.+'
|
||||||
|
@ -13,9 +13,11 @@ dependencies {
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 22
|
compileSdkVersion 23
|
||||||
buildToolsVersion '23.0.1'
|
buildToolsVersion '23.0.1'
|
||||||
|
|
||||||
|
useLibrary 'org.apache.http.legacy'
|
||||||
|
|
||||||
packagingOptions {
|
packagingOptions {
|
||||||
exclude 'META-INF/NOTICE.txt'
|
exclude 'META-INF/NOTICE.txt'
|
||||||
exclude 'META-INF/LICENSE.txt'
|
exclude 'META-INF/LICENSE.txt'
|
||||||
|
@ -78,8 +80,8 @@ android {
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 8
|
minSdkVersion 8
|
||||||
targetSdkVersion 22
|
targetSdkVersion 23
|
||||||
versionCode 627
|
versionCode 654
|
||||||
versionName "3.2.2"
|
versionName "3.2.6"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -187,7 +187,7 @@ include $(CLEAR_VARS)
|
||||||
LOCAL_PRELINK_MODULE := false
|
LOCAL_PRELINK_MODULE := false
|
||||||
LOCAL_STATIC_LIBRARIES := webp sqlite tgnet breakpad
|
LOCAL_STATIC_LIBRARIES := webp sqlite tgnet breakpad
|
||||||
|
|
||||||
LOCAL_MODULE := tmessages.12
|
LOCAL_MODULE := tmessages.14
|
||||||
LOCAL_CFLAGS := -w -std=c11 -Os -DNULL=0 -DSOCKLEN_T=socklen_t -DLOCALE_NOT_USED -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64
|
LOCAL_CFLAGS := -w -std=c11 -Os -DNULL=0 -DSOCKLEN_T=socklen_t -DLOCALE_NOT_USED -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64
|
||||||
LOCAL_CFLAGS += -Drestrict='' -D__EMX__ -DOPUS_BUILD -DFIXED_POINT -DUSE_ALLOCA -DHAVE_LRINT -DHAVE_LRINTF -fno-math-errno
|
LOCAL_CFLAGS += -Drestrict='' -D__EMX__ -DOPUS_BUILD -DFIXED_POINT -DUSE_ALLOCA -DHAVE_LRINT -DHAVE_LRINTF -fno-math-errno
|
||||||
LOCAL_CFLAGS += -DANDROID_NDK -DDISABLE_IMPORTGL -fno-strict-aliasing -fprefetch-loop-arrays -DAVOID_TABLES -DANDROID_TILE_BASED_DECODE -DANDROID_ARMV6_IDCT -ffast-math
|
LOCAL_CFLAGS += -DANDROID_NDK -DDISABLE_IMPORTGL -fno-strict-aliasing -fprefetch-loop-arrays -DAVOID_TABLES -DANDROID_TILE_BASED_DECODE -DANDROID_ARMV6_IDCT -ffast-math
|
||||||
|
|
|
@ -12,6 +12,7 @@ bool callback(const google_breakpad::MinidumpDescriptor &descriptor, void *conte
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
void Java_org_telegram_messenger_NativeLoader_init(JNIEnv* env, jobject obj, jstring filepath, bool enable) {
|
void Java_org_telegram_messenger_NativeLoader_init(JNIEnv* env, jobject obj, jstring filepath, bool enable) {
|
||||||
|
return;
|
||||||
if (enable) {
|
if (enable) {
|
||||||
const char *path = env->GetStringUTFChars(filepath, 0);
|
const char *path = env->GetStringUTFChars(filepath, 0);
|
||||||
google_breakpad::MinidumpDescriptor descriptor(path);
|
google_breakpad::MinidumpDescriptor descriptor(path);
|
||||||
|
|
|
@ -194,17 +194,15 @@ class Delegate : public ConnectiosManagerDelegate {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void init(JNIEnv *env, jclass c, jint version, jint layer, jint apiId, jstring deviceModel, jstring systemVersion, jstring appVersion, jstring langCode, jstring configPath, jint userId) {
|
void init(JNIEnv *env, jclass c, jint version, jint layer, jint apiId, jstring deviceModel, jstring systemVersion, jstring appVersion, jstring langCode, jstring configPath, jstring logPath, jint userId) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const char *deviceModelStr = env->GetStringUTFChars(deviceModel, 0);
|
const char *deviceModelStr = env->GetStringUTFChars(deviceModel, 0);
|
||||||
const char *systemVersionStr = env->GetStringUTFChars(systemVersion, 0);
|
const char *systemVersionStr = env->GetStringUTFChars(systemVersion, 0);
|
||||||
const char *appVersionStr = env->GetStringUTFChars(appVersion, 0);
|
const char *appVersionStr = env->GetStringUTFChars(appVersion, 0);
|
||||||
const char *langCodeStr = env->GetStringUTFChars(langCode, 0);
|
const char *langCodeStr = env->GetStringUTFChars(langCode, 0);
|
||||||
const char *configPathStr = env->GetStringUTFChars(configPath, 0);
|
const char *configPathStr = env->GetStringUTFChars(configPath, 0);
|
||||||
|
const char *logPathStr = env->GetStringUTFChars(logPath, 0);
|
||||||
|
|
||||||
ConnectionsManager::getInstance().init(version, layer, apiId, std::string(deviceModelStr), std::string(systemVersionStr), std::string(appVersionStr), std::string(langCodeStr), std::string(configPathStr), userId, true);
|
ConnectionsManager::getInstance().init(version, layer, apiId, std::string(deviceModelStr), std::string(systemVersionStr), std::string(appVersionStr), std::string(langCodeStr), std::string(configPathStr), std::string(logPathStr), userId, true);
|
||||||
|
|
||||||
if (deviceModelStr != 0) {
|
if (deviceModelStr != 0) {
|
||||||
env->ReleaseStringUTFChars(deviceModel, deviceModelStr);
|
env->ReleaseStringUTFChars(deviceModel, deviceModelStr);
|
||||||
|
@ -221,6 +219,9 @@ void init(JNIEnv *env, jclass c, jint version, jint layer, jint apiId, jstring d
|
||||||
if (configPathStr != 0) {
|
if (configPathStr != 0) {
|
||||||
env->ReleaseStringUTFChars(configPath, configPathStr);
|
env->ReleaseStringUTFChars(configPath, configPathStr);
|
||||||
}
|
}
|
||||||
|
if (logPathStr != 0) {
|
||||||
|
env->ReleaseStringUTFChars(logPath, logPathStr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void setJava(JNIEnv *env, jclass c, jboolean useJavaByteBuffers) {
|
void setJava(JNIEnv *env, jclass c, jboolean useJavaByteBuffers) {
|
||||||
|
@ -241,7 +242,7 @@ static JNINativeMethod ConnectionsManagerMethods[] = {
|
||||||
{"native_applyDatacenterAddress", "(ILjava/lang/String;I)V", (void *) applyDatacenterAddress},
|
{"native_applyDatacenterAddress", "(ILjava/lang/String;I)V", (void *) applyDatacenterAddress},
|
||||||
{"native_getConnectionState", "()I", (void *) getConnectionState},
|
{"native_getConnectionState", "()I", (void *) getConnectionState},
|
||||||
{"native_setUserId", "(I)V", (void *) setUserId},
|
{"native_setUserId", "(I)V", (void *) setUserId},
|
||||||
{"native_init", "(IIILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)V", (void *) init},
|
{"native_init", "(IIILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)V", (void *) init},
|
||||||
{"native_switchBackend", "()V", (void *) switchBackend},
|
{"native_switchBackend", "()V", (void *) switchBackend},
|
||||||
{"native_pauseNetwork", "()V", (void *) pauseNetwork},
|
{"native_pauseNetwork", "()V", (void *) pauseNetwork},
|
||||||
{"native_resumeNetwork", "(Z)V", (void *) resumeNetwork},
|
{"native_resumeNetwork", "(Z)V", (void *) resumeNetwork},
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
*.txt~
|
|
@ -0,0 +1,50 @@
|
||||||
|
Copyright (c) 2006, Google Inc.
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are
|
||||||
|
met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
* Redistributions in binary form must reproduce the above
|
||||||
|
copyright notice, this list of conditions and the following disclaimer
|
||||||
|
in the documentation and/or other materials provided with the
|
||||||
|
distribution.
|
||||||
|
* Neither the name of Google Inc. nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived from
|
||||||
|
this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
--------------------------------------------------------------------
|
||||||
|
|
||||||
|
Copyright 2001-2004 Unicode, Inc.
|
||||||
|
|
||||||
|
Disclaimer
|
||||||
|
|
||||||
|
This source code is provided as is by Unicode, Inc. No claims are
|
||||||
|
made as to fitness for any particular purpose. No warranties of any
|
||||||
|
kind are expressed or implied. The recipient agrees to determine
|
||||||
|
applicability of information provided. If this file has been
|
||||||
|
purchased on magnetic or optical media from Unicode, Inc., the
|
||||||
|
sole remedy for any claim will be exchange of defective media
|
||||||
|
within 90 days of receipt.
|
||||||
|
|
||||||
|
Limitations on Rights to Redistribute This Code
|
||||||
|
|
||||||
|
Unicode, Inc. hereby grants the right to freely use the information
|
||||||
|
supplied in this file in the creation of products supporting the
|
||||||
|
Unicode Standard, and to make copies of this file in any form
|
||||||
|
for internal or external distribution as long as this notice
|
||||||
|
remains attached.
|
|
@ -0,0 +1,19 @@
|
||||||
|
The GIFLIB distribution is Copyright (c) 1997 Eric S. Raymond
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
|
@ -16,11 +16,6 @@ jfieldID jclass_Options_inJustDecodeBounds;
|
||||||
jfieldID jclass_Options_outHeight;
|
jfieldID jclass_Options_outHeight;
|
||||||
jfieldID jclass_Options_outWidth;
|
jfieldID jclass_Options_outWidth;
|
||||||
|
|
||||||
jclass jclass_Bitmap;
|
|
||||||
jmethodID jclass_Bitmap_createBitmap;
|
|
||||||
jclass jclass_Config;
|
|
||||||
jfieldID jclass_Config_ARGB_8888;
|
|
||||||
|
|
||||||
const uint32_t PGPhotoEnhanceHistogramBins = 256;
|
const uint32_t PGPhotoEnhanceHistogramBins = 256;
|
||||||
const uint32_t PGPhotoEnhanceSegments = 4;
|
const uint32_t PGPhotoEnhanceSegments = 4;
|
||||||
|
|
||||||
|
@ -58,24 +53,6 @@ jint imageOnJNILoad(JavaVM *vm, void *reserved, JNIEnv *env) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
jclass_Bitmap = createGlobarRef(env, (*env)->FindClass(env, "android/graphics/Bitmap"));
|
|
||||||
if (jclass_Bitmap == 0) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
jclass_Bitmap_createBitmap = (*env)->GetStaticMethodID(env, jclass_Bitmap, "createBitmap", "(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;");
|
|
||||||
if (jclass_Bitmap_createBitmap == 0) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
jclass_Config = createGlobarRef(env, (*env)->FindClass(env, "android/graphics/Bitmap$Config"));
|
|
||||||
if (jclass_Config == 0) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
jclass_Config_ARGB_8888 = (*env)->GetStaticFieldID(env, jclass_Config, "ARGB_8888", "Landroid/graphics/Bitmap$Config;");
|
|
||||||
if (jclass_Config_ARGB_8888 == 0) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return JNI_VERSION_1_6;
|
return JNI_VERSION_1_6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -511,7 +488,7 @@ JNIEXPORT void Java_org_telegram_messenger_Utilities_loadBitmap(JNIEnv *env, jcl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jobject Java_org_telegram_messenger_Utilities_loadWebpImage(JNIEnv *env, jclass class, jobject buffer, int len, jobject options) {
|
JNIEXPORT jboolean Java_org_telegram_messenger_Utilities_loadWebpImage(JNIEnv *env, jclass class, jobject outputBitmap, jobject buffer, jint len, jobject options, jboolean unpin) {
|
||||||
if (!buffer) {
|
if (!buffer) {
|
||||||
(*env)->ThrowNew(env, jclass_NullPointerException, "Input buffer can not be null");
|
(*env)->ThrowNew(env, jclass_NullPointerException, "Input buffer can not be null");
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -529,43 +506,36 @@ JNIEXPORT jobject Java_org_telegram_messenger_Utilities_loadWebpImage(JNIEnv *en
|
||||||
if (options && (*env)->GetBooleanField(env, options, jclass_Options_inJustDecodeBounds) == JNI_TRUE) {
|
if (options && (*env)->GetBooleanField(env, options, jclass_Options_inJustDecodeBounds) == JNI_TRUE) {
|
||||||
(*env)->SetIntField(env, options, jclass_Options_outWidth, bitmapWidth);
|
(*env)->SetIntField(env, options, jclass_Options_outWidth, bitmapWidth);
|
||||||
(*env)->SetIntField(env, options, jclass_Options_outHeight, bitmapHeight);
|
(*env)->SetIntField(env, options, jclass_Options_outHeight, bitmapHeight);
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
jobject value__ARGB_8888 = (*env)->GetStaticObjectField(env, jclass_Config, jclass_Config_ARGB_8888);
|
|
||||||
jobject outputBitmap = (*env)->CallStaticObjectMethod(env, jclass_Bitmap, jclass_Bitmap_createBitmap, (jint)bitmapWidth, (jint)bitmapHeight, value__ARGB_8888);
|
|
||||||
if (!outputBitmap) {
|
if (!outputBitmap) {
|
||||||
(*env)->ThrowNew(env, jclass_RuntimeException, "Failed to allocate Bitmap");
|
(*env)->ThrowNew(env, jclass_NullPointerException, "output bitmap can not be null");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
outputBitmap = (*env)->NewLocalRef(env, outputBitmap);
|
|
||||||
|
|
||||||
AndroidBitmapInfo bitmapInfo;
|
AndroidBitmapInfo bitmapInfo;
|
||||||
if (AndroidBitmap_getInfo(env, outputBitmap, &bitmapInfo) != ANDROID_BITMAP_RESUT_SUCCESS) {
|
if (AndroidBitmap_getInfo(env, outputBitmap, &bitmapInfo) != ANDROID_BITMAP_RESUT_SUCCESS) {
|
||||||
(*env)->DeleteLocalRef(env, outputBitmap);
|
|
||||||
(*env)->ThrowNew(env, jclass_RuntimeException, "Failed to get Bitmap information");
|
(*env)->ThrowNew(env, jclass_RuntimeException, "Failed to get Bitmap information");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *bitmapPixels = 0;
|
void *bitmapPixels = 0;
|
||||||
if (AndroidBitmap_lockPixels(env, outputBitmap, &bitmapPixels) != ANDROID_BITMAP_RESUT_SUCCESS) {
|
if (AndroidBitmap_lockPixels(env, outputBitmap, &bitmapPixels) != ANDROID_BITMAP_RESUT_SUCCESS) {
|
||||||
(*env)->DeleteLocalRef(env, outputBitmap);
|
|
||||||
(*env)->ThrowNew(env, jclass_RuntimeException, "Failed to lock Bitmap pixels");
|
(*env)->ThrowNew(env, jclass_RuntimeException, "Failed to lock Bitmap pixels");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!WebPDecodeRGBAInto((uint8_t*)inputBuffer, len, (uint8_t*)bitmapPixels, bitmapInfo.height * bitmapInfo.stride, bitmapInfo.stride)) {
|
if (!WebPDecodeRGBAInto((uint8_t*)inputBuffer, len, (uint8_t*)bitmapPixels, bitmapInfo.height * bitmapInfo.stride, bitmapInfo.stride)) {
|
||||||
AndroidBitmap_unlockPixels(env, outputBitmap);
|
AndroidBitmap_unlockPixels(env, outputBitmap);
|
||||||
(*env)->DeleteLocalRef(env, outputBitmap);
|
|
||||||
(*env)->ThrowNew(env, jclass_RuntimeException, "Failed to decode webp image");
|
(*env)->ThrowNew(env, jclass_RuntimeException, "Failed to decode webp image");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AndroidBitmap_unlockPixels(env, outputBitmap) != ANDROID_BITMAP_RESUT_SUCCESS) {
|
if (unpin && AndroidBitmap_unlockPixels(env, outputBitmap) != ANDROID_BITMAP_RESUT_SUCCESS) {
|
||||||
(*env)->DeleteLocalRef(env, outputBitmap);
|
|
||||||
(*env)->ThrowNew(env, jclass_RuntimeException, "Failed to unlock Bitmap pixels");
|
(*env)->ThrowNew(env, jclass_RuntimeException, "Failed to unlock Bitmap pixels");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return outputBitmap;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,94 @@
|
||||||
|
This software is based in part on the work of the Independent JPEG Group.
|
||||||
|
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
The authors make NO WARRANTY or representation, either express or implied,
|
||||||
|
with respect to this software, its quality, accuracy, merchantability, or
|
||||||
|
fitness for a particular purpose. This software is provided "AS IS", and you,
|
||||||
|
its user, assume the entire risk as to its quality and accuracy.
|
||||||
|
|
||||||
|
This software is copyright (C) 1991-1998, Thomas G. Lane.
|
||||||
|
All Rights Reserved except as specified below.
|
||||||
|
|
||||||
|
Permission is hereby granted to use, copy, modify, and distribute this
|
||||||
|
software (or portions thereof) for any purpose, without fee, subject to these
|
||||||
|
conditions:
|
||||||
|
(1) If any part of the source code for this software is distributed, then this
|
||||||
|
README file must be included, with this copyright and no-warranty notice
|
||||||
|
unaltered; and any additions, deletions, or changes to the original files
|
||||||
|
must be clearly indicated in accompanying documentation.
|
||||||
|
(2) If only executable code is distributed, then the accompanying
|
||||||
|
documentation must state that "this software is based in part on the work of
|
||||||
|
the Independent JPEG Group".
|
||||||
|
(3) Permission for use of this software is granted only if the user accepts
|
||||||
|
full responsibility for any undesirable consequences; the authors accept
|
||||||
|
NO LIABILITY for damages of any kind.
|
||||||
|
|
||||||
|
These conditions apply to any software derived from or based on the IJG code,
|
||||||
|
not just to the unmodified library. If you use our work, you ought to
|
||||||
|
acknowledge us.
|
||||||
|
|
||||||
|
Permission is NOT granted for the use of any IJG author's name or company name
|
||||||
|
in advertising or publicity relating to this software or products derived from
|
||||||
|
it. This software may be referred to only as "the Independent JPEG Group's
|
||||||
|
software".
|
||||||
|
|
||||||
|
We specifically permit and encourage the use of this software as the basis of
|
||||||
|
commercial products, provided that all warranty or liability claims are
|
||||||
|
assumed by the product vendor.
|
||||||
|
|
||||||
|
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
|
||||||
|
ARM NEON optimizations for libjpeg-turbo
|
||||||
|
|
||||||
|
Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
|
All rights reserved.
|
||||||
|
Contact: Alexander Bokovoy <alexander.bokovoy@nokia.com>
|
||||||
|
|
||||||
|
This software is provided 'as-is', without any express or implied
|
||||||
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
arising from the use of this software.
|
||||||
|
|
||||||
|
Permission is granted to anyone to use this software for any purpose,
|
||||||
|
including commercial applications, and to alter it and redistribute it
|
||||||
|
freely, subject to the following restrictions:
|
||||||
|
|
||||||
|
1. The origin of this software must not be misrepresented; you must not
|
||||||
|
claim that you wrote the original software. If you use this software
|
||||||
|
in a product, an acknowledgment in the product documentation would be
|
||||||
|
appreciated but is not required.
|
||||||
|
2. Altered source versions must be plainly marked as such, and must not be
|
||||||
|
misrepresented as being the original software.
|
||||||
|
3. This notice may not be removed or altered from any source distribution.
|
||||||
|
|
||||||
|
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
|
||||||
|
Copyright (c) 2011, NVIDIA CORPORATION. All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions
|
||||||
|
are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
|
documentation and/or other materials provided with the distribution.
|
||||||
|
* Neither the name of the NVIDIA CORPORATION nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived
|
||||||
|
from this software without specific prior written permission.
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||||
|
THE POSSIBILITY OF SUCH DAMAGE.
|
|
@ -0,0 +1,24 @@
|
||||||
|
Contributors:
|
||||||
|
- Charles Munger (clm at google dot com)
|
||||||
|
- Christian Duvivier (cduvivier at google dot com)
|
||||||
|
- Djordje Pesut (djordje dot pesut at imgtec dot com)
|
||||||
|
- James Zern (jzern at google dot com)
|
||||||
|
- Jan Engelhardt (jengelh at medozas dot de)
|
||||||
|
- Johann (johann dot koenig at duck dot com)
|
||||||
|
- Jovan Zelincevic (jovan dot zelincevic at imgtec dot com)
|
||||||
|
- Jyrki Alakuijala (jyrki at google dot com)
|
||||||
|
- levytamar82 (tamar dot levy at intel dot com)
|
||||||
|
- Lou Quillio (louquillio at google dot com)
|
||||||
|
- Mans Rullgard (mans at mansr dot com)
|
||||||
|
- Martin Olsson (mnemo at minimum dot se)
|
||||||
|
- Mikołaj Zalewski (mikolajz at google dot com)
|
||||||
|
- Noel Chromium (noel at chromium dot org)
|
||||||
|
- Pascal Massimino (pascal dot massimino at gmail dot com)
|
||||||
|
- Paweł Hajdan, Jr (phajdan dot jr at chromium dot org)
|
||||||
|
- Pierre Joye (pierre dot php at gmail dot com)
|
||||||
|
- Scott LaVarnway (slavarnway at google dot com)
|
||||||
|
- Scott Talbot (s at chikachow dot org)
|
||||||
|
- Slobodan Prijic (slobodan dot prijic at imgtec dot com)
|
||||||
|
- Somnath Banerjee (somnath dot banerjee at gmail dot com)
|
||||||
|
- Urvang Joshi (urvang at google dot com)
|
||||||
|
- Vikas Arora (vikasa at google dot com)
|
|
@ -0,0 +1,30 @@
|
||||||
|
Copyright (c) 2010, Google Inc. All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are
|
||||||
|
met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in
|
||||||
|
the documentation and/or other materials provided with the
|
||||||
|
distribution.
|
||||||
|
|
||||||
|
* Neither the name of Google nor the names of its contributors may
|
||||||
|
be used to endorse or promote products derived from this software
|
||||||
|
without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
Additional IP Rights Grant (Patents)
|
||||||
|
------------------------------------
|
||||||
|
|
||||||
|
"These implementations" means the copyrightable works that implement the WebM
|
||||||
|
codecs distributed by Google as part of the WebM Project.
|
||||||
|
|
||||||
|
Google hereby grants to you a perpetual, worldwide, non-exclusive, no-charge,
|
||||||
|
royalty-free, irrevocable (except as stated in this section) patent license to
|
||||||
|
make, have made, use, offer to sell, sell, import, transfer, and otherwise
|
||||||
|
run, modify and propagate the contents of these implementations of WebM, where
|
||||||
|
such license applies only to those patent claims, both currently owned by
|
||||||
|
Google and acquired in the future, licensable by Google that are necessarily
|
||||||
|
infringed by these implementations of WebM. This grant does not include claims
|
||||||
|
that would be infringed only as a consequence of further modification of these
|
||||||
|
implementations. If you or your agent or exclusive licensee institute or order
|
||||||
|
or agree to the institution of patent litigation or any other patent
|
||||||
|
enforcement activity against any entity (including a cross-claim or
|
||||||
|
counterclaim in a lawsuit) alleging that any of these implementations of WebM
|
||||||
|
or any code incorporated within any of these implementations of WebM
|
||||||
|
constitute direct or contributory patent infringement, or inducement of
|
||||||
|
patent infringement, then any patent rights granted to you under this License
|
||||||
|
for these implementations of WebM shall terminate as of the date such
|
||||||
|
litigation is filed.
|
|
@ -0,0 +1,4 @@
|
||||||
|
# Names should be added to this file like so:
|
||||||
|
# Name or Organization <email address>
|
||||||
|
|
||||||
|
Google Inc.
|
|
@ -0,0 +1,29 @@
|
||||||
|
Copyright 2011 The LibYuv Project Authors. All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are
|
||||||
|
met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in
|
||||||
|
the documentation and/or other materials provided with the
|
||||||
|
distribution.
|
||||||
|
|
||||||
|
* Neither the name of Google nor the names of its contributors may
|
||||||
|
be used to endorse or promote products derived from this software
|
||||||
|
without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@ -0,0 +1,8 @@
|
||||||
|
This source tree contains third party source code which is governed by third
|
||||||
|
party licenses. This file contains references to files which are under other
|
||||||
|
licenses than the one provided in the LICENSE file in the root of the source
|
||||||
|
tree.
|
||||||
|
|
||||||
|
Files governed by third party licenses:
|
||||||
|
source/x86inc.asm
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
Additional IP Rights Grant (Patents)
|
||||||
|
|
||||||
|
"This implementation" means the copyrightable works distributed by
|
||||||
|
Google as part of the LibYuv code package.
|
||||||
|
|
||||||
|
Google hereby grants to you a perpetual, worldwide, non-exclusive,
|
||||||
|
no-charge, irrevocable (except as stated in this section) patent
|
||||||
|
license to make, have made, use, offer to sell, sell, import,
|
||||||
|
transfer, and otherwise run, modify and propagate the contents of this
|
||||||
|
implementation of the LibYuv code package, where such license applies
|
||||||
|
only to those patent claims, both currently owned by Google and
|
||||||
|
acquired in the future, licensable by Google that are necessarily
|
||||||
|
infringed by this implementation of the LibYuv code package. This
|
||||||
|
grant does not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of this implementation. If you or
|
||||||
|
your agent or exclusive licensee institute or order or agree to the
|
||||||
|
institution of patent litigation against any entity (including a
|
||||||
|
cross-claim or counterclaim in a lawsuit) alleging that this
|
||||||
|
implementation of the LibYuv code package or any code incorporated
|
||||||
|
within this implementation of the LibYuv code package constitutes
|
||||||
|
direct or contributory patent infringement, or inducement of patent
|
||||||
|
infringement, then any patent rights granted to you under this License
|
||||||
|
for this implementation of the LibYuv code package shall terminate as
|
||||||
|
of the date such litigation is filed.
|
|
@ -0,0 +1,6 @@
|
||||||
|
Jean-Marc Valin (jmvalin@jmvalin.ca)
|
||||||
|
Koen Vos (koenvos74@gmail.com)
|
||||||
|
Timothy Terriberry (tterribe@xiph.org)
|
||||||
|
Karsten Vandborg Sorensen (karsten.vandborg.sorensen@skype.net)
|
||||||
|
Soren Skak Jensen (ssjensen@gn.com)
|
||||||
|
Gregory Maxwell (greg@xiph.org)
|
|
@ -0,0 +1,44 @@
|
||||||
|
Copyright 2001-2011 Xiph.Org, Skype Limited, Octasic,
|
||||||
|
Jean-Marc Valin, Timothy B. Terriberry,
|
||||||
|
CSIRO, Gregory Maxwell, Mark Borgerding,
|
||||||
|
Erik de Castro Lopo
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions
|
||||||
|
are met:
|
||||||
|
|
||||||
|
- Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
- Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
|
documentation and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
- Neither the name of Internet Society, IETF or IETF Trust, nor the
|
||||||
|
names of specific contributors, may be used to endorse or promote
|
||||||
|
products derived from this software without specific prior written
|
||||||
|
permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
|
||||||
|
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||||
|
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
|
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||||
|
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
Opus is subject to the royalty-free patent licenses which are
|
||||||
|
specified at:
|
||||||
|
|
||||||
|
Xiph.Org Foundation:
|
||||||
|
https://datatracker.ietf.org/ipr/1524/
|
||||||
|
|
||||||
|
Microsoft Corporation:
|
||||||
|
https://datatracker.ietf.org/ipr/1914/
|
||||||
|
|
||||||
|
Broadcom Corporation:
|
||||||
|
https://datatracker.ietf.org/ipr/1526/
|
|
@ -266,7 +266,11 @@ void Connection::connect() {
|
||||||
if (isTryingNextPort) {
|
if (isTryingNextPort) {
|
||||||
setTimeout(8);
|
setTimeout(8);
|
||||||
} else {
|
} else {
|
||||||
setTimeout(15);
|
if (connectionType == ConnectionTypeUpload) {
|
||||||
|
setTimeout(25);
|
||||||
|
} else {
|
||||||
|
setTimeout(15);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -220,7 +220,7 @@ void ConnectionsManager::select() {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
lastPauseTime = now;
|
lastPauseTime = now;
|
||||||
DEBUG_D("don't sleep 30 seconds because of salt, upload or download request");
|
DEBUG_D("don't sleep 10 seconds because of salt, upload or download request");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (networkPaused) {
|
if (networkPaused) {
|
||||||
|
@ -595,7 +595,7 @@ void ConnectionsManager::onConnectionConnected(Connection *connection) {
|
||||||
} else {
|
} else {
|
||||||
if (networkPaused && lastPauseTime != 0) {
|
if (networkPaused && lastPauseTime != 0) {
|
||||||
lastPauseTime = getCurrentTimeMillis();
|
lastPauseTime = getCurrentTimeMillis();
|
||||||
nextSleepTimeout = 30000;
|
nextSleepTimeout = 10000;
|
||||||
}
|
}
|
||||||
processRequestQueue(connection->getConnectionType(), datacenter->getDatacenterId());
|
processRequestQueue(connection->getConnectionType(), datacenter->getDatacenterId());
|
||||||
}
|
}
|
||||||
|
@ -819,7 +819,8 @@ void ConnectionsManager::processServerResponse(TLObject *message, int64_t messag
|
||||||
|
|
||||||
for (requestsIter iter = runningRequests.begin(); iter != runningRequests.end(); iter++) {
|
for (requestsIter iter = runningRequests.begin(); iter != runningRequests.end(); iter++) {
|
||||||
Request *request = iter->get();
|
Request *request = iter->get();
|
||||||
if (request->messageId < response->first_msg_id && request->connectionType & connection->getConnectionType() && request->datacenterId == datacenter->getDatacenterId()) {
|
Datacenter *requestDatacenter = getDatacenterWithId(request->datacenterId);
|
||||||
|
if (request->messageId < response->first_msg_id && request->connectionType & connection->getConnectionType() && requestDatacenter != nullptr && requestDatacenter->getDatacenterId() == datacenter->getDatacenterId()) {
|
||||||
request->clear(true);
|
request->clear(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -908,8 +909,9 @@ void ConnectionsManager::processServerResponse(TLObject *message, int64_t messag
|
||||||
RpcError *error = hasResult ? dynamic_cast<RpcError *>(response->result.get()) : nullptr;
|
RpcError *error = hasResult ? dynamic_cast<RpcError *>(response->result.get()) : nullptr;
|
||||||
if (error != nullptr) {
|
if (error != nullptr) {
|
||||||
DEBUG_E("connection(%p, dc%u, type %d) rpc error %d: %s", connection, datacenter->getDatacenterId(), connection->getConnectionType(), error->error_code, error->error_message.c_str());
|
DEBUG_E("connection(%p, dc%u, type %d) rpc error %d: %s", connection, datacenter->getDatacenterId(), connection->getConnectionType(), error->error_code, error->error_message.c_str());
|
||||||
uint32_t migrateToDatacenterId = DEFAULT_DATACENTER_ID;
|
|
||||||
if (error->error_code == 303) {
|
if (error->error_code == 303) {
|
||||||
|
uint32_t migrateToDatacenterId = DEFAULT_DATACENTER_ID;
|
||||||
|
|
||||||
static std::vector<std::string> migrateErrors;
|
static std::vector<std::string> migrateErrors;
|
||||||
if (migrateErrors.empty()) {
|
if (migrateErrors.empty()) {
|
||||||
migrateErrors.push_back("NETWORK_MIGRATE_");
|
migrateErrors.push_back("NETWORK_MIGRATE_");
|
||||||
|
@ -926,11 +928,11 @@ void ConnectionsManager::processServerResponse(TLObject *message, int64_t messag
|
||||||
migrateToDatacenterId = val;
|
migrateToDatacenterId = val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
if (migrateToDatacenterId != DEFAULT_DATACENTER_ID) {
|
||||||
if (migrateToDatacenterId != DEFAULT_DATACENTER_ID) {
|
ignoreResult = true;
|
||||||
ignoreResult = true;
|
moveToDatacenter(migrateToDatacenterId);
|
||||||
moveToDatacenter(migrateToDatacenterId);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -950,7 +952,7 @@ void ConnectionsManager::processServerResponse(TLObject *message, int64_t messag
|
||||||
NativeByteBuffer *unpacked_data = nullptr;
|
NativeByteBuffer *unpacked_data = nullptr;
|
||||||
TLObject *result = response->result.get();
|
TLObject *result = response->result.get();
|
||||||
if (typeid(*result) == typeid(TL_gzip_packed)) {
|
if (typeid(*result) == typeid(TL_gzip_packed)) {
|
||||||
TL_gzip_packed *innerResponse = (TL_gzip_packed *) response->result.get();
|
TL_gzip_packed *innerResponse = (TL_gzip_packed *) result;
|
||||||
unpacked_data = decompressGZip(innerResponse->packed_data.get());
|
unpacked_data = decompressGZip(innerResponse->packed_data.get());
|
||||||
TLObject *object = TLdeserialize(request->rawRequest, unpacked_data->limit(), unpacked_data);
|
TLObject *object = TLdeserialize(request->rawRequest, unpacked_data->limit(), unpacked_data);
|
||||||
if (object != nullptr) {
|
if (object != nullptr) {
|
||||||
|
@ -963,16 +965,14 @@ void ConnectionsManager::processServerResponse(TLObject *message, int64_t messag
|
||||||
TL_error *error2 = hasResult ? dynamic_cast<TL_error *>(response->result.get()) : nullptr;
|
TL_error *error2 = hasResult ? dynamic_cast<TL_error *>(response->result.get()) : nullptr;
|
||||||
if (error != nullptr) {
|
if (error != nullptr) {
|
||||||
allowInitConnection = false;
|
allowInitConnection = false;
|
||||||
DEBUG_E("rpc error %d: %s", error->error_code, error->error_message.c_str());
|
DEBUG_E("request %p rpc error %d: %s", request, error->error_code, error->error_message.c_str());
|
||||||
|
|
||||||
if (error->error_code == 500 || error->error_code < 0) {
|
if ((request->requestFlags & RequestFlagFailOnServerErrors) == 0) {
|
||||||
if (!(request->requestFlags & RequestFlagFailOnServerErrors)) {
|
if (error->error_code == 500 || error->error_code < 0) {
|
||||||
request->serverFailureCount++;
|
|
||||||
discardResponse = true;
|
discardResponse = true;
|
||||||
request->minStartTime = request->startTime + request->serverFailureCount > 10 ? 10 : request->serverFailureCount;
|
request->minStartTime = request->startTime + (request->serverFailureCount > 10 ? 10 : request->serverFailureCount);
|
||||||
}
|
request->serverFailureCount++;
|
||||||
} else if (error->error_code == 420) {
|
} else if (error->error_code == 420) {
|
||||||
if (!(request->requestFlags & RequestFlagFailOnServerErrors)) {
|
|
||||||
int32_t waitTime = 2;
|
int32_t waitTime = 2;
|
||||||
static std::string floodWait = "FLOOD_WAIT_";
|
static std::string floodWait = "FLOOD_WAIT_";
|
||||||
if (error->error_message.find(floodWait) != std::string::npos) {
|
if (error->error_message.find(floodWait) != std::string::npos) {
|
||||||
|
@ -988,10 +988,11 @@ void ConnectionsManager::processServerResponse(TLObject *message, int64_t messag
|
||||||
request->minStartTime = (int32_t) (getCurrentTimeMillis() / 1000 + waitTime);
|
request->minStartTime = (int32_t) (getCurrentTimeMillis() / 1000 + waitTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!discardResponse) {
|
||||||
implicitError = new TL_error();
|
implicitError = new TL_error();
|
||||||
implicitError->code = error->error_code;
|
implicitError->code = error->error_code;
|
||||||
implicitError->text = error->error_message;
|
implicitError->text = error->error_message;
|
||||||
|
}
|
||||||
} else if (error2 == nullptr) {
|
} else if (error2 == nullptr) {
|
||||||
if (request->rawRequest == nullptr || response->result == nullptr) {
|
if (request->rawRequest == nullptr || response->result == nullptr) {
|
||||||
allowInitConnection = false;
|
allowInitConnection = false;
|
||||||
|
@ -1114,7 +1115,7 @@ void ConnectionsManager::processServerResponse(TLObject *message, int64_t messag
|
||||||
int64_t time = (int64_t) (messageId / 4294967296.0 * 1000);
|
int64_t time = (int64_t) (messageId / 4294967296.0 * 1000);
|
||||||
int64_t currentTime = getCurrentTimeMillis();
|
int64_t currentTime = getCurrentTimeMillis();
|
||||||
timeDifference = (int32_t) ((time - currentTime) / 1000 - currentPingTime / 2);
|
timeDifference = (int32_t) ((time - currentTime) / 1000 - currentPingTime / 2);
|
||||||
lastOutgoingMessageId = messageId > lastOutgoingMessageId ? messageId : lastOutgoingMessageId;
|
lastOutgoingMessageId = messageId > (lastOutgoingMessageId ? messageId : lastOutgoingMessageId);
|
||||||
}
|
}
|
||||||
int64_t resultMid = response->bad_msg_id;
|
int64_t resultMid = response->bad_msg_id;
|
||||||
if (resultMid != 0) {
|
if (resultMid != 0) {
|
||||||
|
@ -1207,7 +1208,7 @@ void ConnectionsManager::processServerResponse(TLObject *message, int64_t messag
|
||||||
} else if (connection->connectionType == ConnectionTypePush && typeInfo == typeid(TL_updatesTooLong)) {
|
} else if (connection->connectionType == ConnectionTypePush && typeInfo == typeid(TL_updatesTooLong)) {
|
||||||
if (networkPaused) {
|
if (networkPaused) {
|
||||||
lastPauseTime = getCurrentTimeMillis();
|
lastPauseTime = getCurrentTimeMillis();
|
||||||
nextSleepTimeout = 30000;
|
nextSleepTimeout = 10000;
|
||||||
DEBUG_D("received internal push: wakeup network in background");
|
DEBUG_D("received internal push: wakeup network in background");
|
||||||
} else if (lastPauseTime != 0) {
|
} else if (lastPauseTime != 0) {
|
||||||
lastPauseTime = getCurrentTimeMillis();
|
lastPauseTime = getCurrentTimeMillis();
|
||||||
|
@ -1389,11 +1390,13 @@ void ConnectionsManager::sendRequest(TLObject *object, onCompleteFunc onComplete
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
scheduleTask([&, requestToken, object, onComplete, onQuickAck, flags, datacenterId, connetionType, immediate, ptr1, ptr2] {
|
scheduleTask([&, requestToken, object, onComplete, onQuickAck, flags, datacenterId, connetionType, immediate, ptr1, ptr2] {
|
||||||
|
DEBUG_D("send request %p - %s", object, typeid(*object).name());
|
||||||
Request *request = new Request(requestToken, connetionType, flags, datacenterId, onComplete, onQuickAck);
|
Request *request = new Request(requestToken, connetionType, flags, datacenterId, onComplete, onQuickAck);
|
||||||
request->rawRequest = object;
|
request->rawRequest = object;
|
||||||
request->ptr1 = ptr1;
|
request->ptr1 = ptr1;
|
||||||
request->ptr2 = ptr2;
|
request->ptr2 = ptr2;
|
||||||
request->rpcRequest = wrapInLayer(object, getDatacenterWithId(datacenterId), request);
|
request->rpcRequest = wrapInLayer(object, getDatacenterWithId(datacenterId), request);
|
||||||
|
DEBUG_D("send request wrapped %p - %s", request->rpcRequest.get(), typeid(*request->rpcRequest.get()).name());
|
||||||
requestsQueue.push_back(std::unique_ptr<Request>(request));
|
requestsQueue.push_back(std::unique_ptr<Request>(request));
|
||||||
if (immediate) {
|
if (immediate) {
|
||||||
processRequestQueue(0, 0);
|
processRequestQueue(0, 0);
|
||||||
|
@ -1780,7 +1783,9 @@ void ConnectionsManager::processRequestQueue(uint32_t connectionTypes, uint32_t
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool forceThisRequest = request->connectionType & connectionTypes && request->datacenterId == dc;
|
uint32_t requestConnectionType = request->connectionType & 0x0000ffff;
|
||||||
|
|
||||||
|
bool forceThisRequest = (connectionTypes & requestConnectionType) && requestDatacenter->getDatacenterId() == dc;
|
||||||
|
|
||||||
if (typeInfo == typeid(TL_get_future_salts) || typeInfo == typeid(TL_destroy_session)) {
|
if (typeInfo == typeid(TL_get_future_salts) || typeInfo == typeid(TL_destroy_session)) {
|
||||||
if (request->messageId != 0) {
|
if (request->messageId != 0) {
|
||||||
|
@ -1790,7 +1795,7 @@ void ConnectionsManager::processRequestQueue(uint32_t connectionTypes, uint32_t
|
||||||
forceThisRequest = false;
|
forceThisRequest = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((abs(currentTime - request->startTime) > maxTimeout) && (currentTime > request->minStartTime || abs(currentTime - request->minStartTime) > 60)) || forceThisRequest) {
|
if (forceThisRequest || (abs(currentTime - request->startTime) > maxTimeout && (currentTime > request->minStartTime || abs(currentTime - request->minStartTime) > 60))) {
|
||||||
if (!forceThisRequest && request->connectionToken > 0) {
|
if (!forceThisRequest && request->connectionToken > 0) {
|
||||||
if (request->connectionType & ConnectionTypeGeneric && request->connectionToken == connection->getConnectionToken()) {
|
if (request->connectionType & ConnectionTypeGeneric && request->connectionToken == connection->getConnectionToken()) {
|
||||||
DEBUG_D("request token is valid, not retrying %s", typeInfo.name());
|
DEBUG_D("request token is valid, not retrying %s", typeInfo.name());
|
||||||
|
@ -1849,7 +1854,7 @@ void ConnectionsManager::processRequestQueue(uint32_t connectionTypes, uint32_t
|
||||||
networkMessage->needQuickAck = (request->requestFlags & RequestFlagNeedQuickAck) != 0;
|
networkMessage->needQuickAck = (request->requestFlags & RequestFlagNeedQuickAck) != 0;
|
||||||
|
|
||||||
request->connectionToken = connection->getConnectionToken();
|
request->connectionToken = connection->getConnectionToken();
|
||||||
switch (request->connectionType & 0x0000ffff) {
|
switch (requestConnectionType) {
|
||||||
case ConnectionTypeGeneric:
|
case ConnectionTypeGeneric:
|
||||||
addMessageToDatacenter(requestDatacenter->getDatacenterId(), networkMessage, genericMessagesToDatacenters);
|
addMessageToDatacenter(requestDatacenter->getDatacenterId(), networkMessage, genericMessagesToDatacenters);
|
||||||
break;
|
break;
|
||||||
|
@ -2369,7 +2374,7 @@ void ConnectionsManager::setDelegate(ConnectiosManagerDelegate *connectiosManage
|
||||||
delegate = connectiosManagerDelegate;
|
delegate = connectiosManagerDelegate;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConnectionsManager::init(uint32_t version, int32_t layer, int32_t apiId, std::string deviceModel, std::string systemVersion, std::string appVersion, std::string langCode, std::string configPath, int32_t userId, bool isPaused) {
|
void ConnectionsManager::init(uint32_t version, int32_t layer, int32_t apiId, std::string deviceModel, std::string systemVersion, std::string appVersion, std::string langCode, std::string configPath, std::string logPath, int32_t userId, bool isPaused) {
|
||||||
currentVersion = version;
|
currentVersion = version;
|
||||||
currentLayer = layer;
|
currentLayer = layer;
|
||||||
currentApiId = apiId;
|
currentApiId = apiId;
|
||||||
|
@ -2379,6 +2384,7 @@ void ConnectionsManager::init(uint32_t version, int32_t layer, int32_t apiId, st
|
||||||
currentAppVersion = appVersion;
|
currentAppVersion = appVersion;
|
||||||
currentLangCode = langCode;
|
currentLangCode = langCode;
|
||||||
currentUserId = userId;
|
currentUserId = userId;
|
||||||
|
currentLogPath = logPath;
|
||||||
if (isPaused) {
|
if (isPaused) {
|
||||||
lastPauseTime = getCurrentTimeMillis();
|
lastPauseTime = getCurrentTimeMillis();
|
||||||
}
|
}
|
||||||
|
@ -2386,6 +2392,10 @@ void ConnectionsManager::init(uint32_t version, int32_t layer, int32_t apiId, st
|
||||||
if (!currentConfigPath.empty() && currentConfigPath.find_last_of('/') != currentConfigPath.size() - 1) {
|
if (!currentConfigPath.empty() && currentConfigPath.find_last_of('/') != currentConfigPath.size() - 1) {
|
||||||
currentConfigPath += "/";
|
currentConfigPath += "/";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!logPath.empty()) {
|
||||||
|
FileLog::init(logPath);
|
||||||
|
}
|
||||||
|
|
||||||
loadConfig();
|
loadConfig();
|
||||||
|
|
||||||
|
@ -2397,7 +2407,7 @@ void ConnectionsManager::resumeNetwork(bool partial) {
|
||||||
if (partial) {
|
if (partial) {
|
||||||
if (networkPaused) {
|
if (networkPaused) {
|
||||||
lastPauseTime = getCurrentTimeMillis();
|
lastPauseTime = getCurrentTimeMillis();
|
||||||
nextSleepTimeout = 30000;
|
nextSleepTimeout = 10000;
|
||||||
networkPaused = false;
|
networkPaused = false;
|
||||||
DEBUG_D("wakeup network in background");
|
DEBUG_D("wakeup network in background");
|
||||||
} else if (lastPauseTime != 0) {
|
} else if (lastPauseTime != 0) {
|
||||||
|
|
|
@ -59,7 +59,7 @@ public:
|
||||||
void pauseNetwork();
|
void pauseNetwork();
|
||||||
void setNetworkAvailable(bool value);
|
void setNetworkAvailable(bool value);
|
||||||
void setUseIpv6(bool value);
|
void setUseIpv6(bool value);
|
||||||
void init(uint32_t version, int32_t layer, int32_t apiId, std::string deviceModel, std::string systemVersion, std::string appVersion, std::string langCode, std::string configPath, int32_t userId, bool isPaused);
|
void init(uint32_t version, int32_t layer, int32_t apiId, std::string deviceModel, std::string systemVersion, std::string appVersion, std::string langCode, std::string configPath, std::string logPath, int32_t userId, bool isPaused);
|
||||||
void updateDcSettings(uint32_t datacenterId);
|
void updateDcSettings(uint32_t datacenterId);
|
||||||
|
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
|
@ -169,6 +169,7 @@ private:
|
||||||
std::string currentAppVersion;
|
std::string currentAppVersion;
|
||||||
std::string currentLangCode;
|
std::string currentLangCode;
|
||||||
std::string currentConfigPath;
|
std::string currentConfigPath;
|
||||||
|
std::string currentLogPath;
|
||||||
int32_t currentUserId = 0;
|
int32_t currentUserId = 0;
|
||||||
bool registeredForInternalPush = false;
|
bool registeredForInternalPush = false;
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ Datacenter::Datacenter(uint32_t id) {
|
||||||
|
|
||||||
Datacenter::Datacenter(NativeByteBuffer *data) {
|
Datacenter::Datacenter(NativeByteBuffer *data) {
|
||||||
for (uint32_t a = 0; a < DOWNLOAD_CONNECTIONS_COUNT; a++) {
|
for (uint32_t a = 0; a < DOWNLOAD_CONNECTIONS_COUNT; a++) {
|
||||||
downloadConnections[a] = nullptr;
|
downloadConnections[a] = nullptr;
|
||||||
}
|
}
|
||||||
uint32_t currentVersion = data->readUint32(nullptr);
|
uint32_t currentVersion = data->readUint32(nullptr);
|
||||||
if (currentVersion >= 2 && currentVersion <= 5) {
|
if (currentVersion >= 2 && currentVersion <= 5) {
|
||||||
|
@ -1377,7 +1377,7 @@ NativeByteBuffer *Datacenter::createRequestsData(std::vector<std::unique_ptr<Net
|
||||||
} else {
|
} else {
|
||||||
messageBody = networkMessage->message->body.get();
|
messageBody = networkMessage->message->body.get();
|
||||||
}
|
}
|
||||||
DEBUG_D("connection(%p, dc%u, type %d) send message (session: 0x%llx, seqno: %d, messageid: 0x%llx): %s", connection, datacenterId, connection->getConnectionType(), (uint64_t) connection->getSissionId(), networkMessage->message->seqno, (uint64_t) networkMessage->message->msg_id, typeid(*messageBody).name());
|
DEBUG_D("connection(%p, dc%u, type %d) send message (session: 0x%llx, seqno: %d, messageid: 0x%llx): %s(%p)", connection, datacenterId, connection->getConnectionType(), (uint64_t) connection->getSissionId(), networkMessage->message->seqno, (uint64_t) networkMessage->message->msg_id, typeid(*messageBody).name(), messageBody);
|
||||||
|
|
||||||
int64_t messageTime = (int64_t) (networkMessage->message->msg_id / 4294967296.0 * 1000);
|
int64_t messageTime = (int64_t) (networkMessage->message->msg_id / 4294967296.0 * 1000);
|
||||||
int64_t currentTime = ConnectionsManager::getInstance().getCurrentTimeMillis() + (int64_t) timeDifference * 1000;
|
int64_t currentTime = ConnectionsManager::getInstance().getCurrentTimeMillis() + (int64_t) timeDifference * 1000;
|
||||||
|
@ -1404,7 +1404,7 @@ NativeByteBuffer *Datacenter::createRequestsData(std::vector<std::unique_ptr<Net
|
||||||
} else {
|
} else {
|
||||||
messageBody = networkMessage->message->body.get();
|
messageBody = networkMessage->message->body.get();
|
||||||
}
|
}
|
||||||
DEBUG_D("connection(%p, dc%u, type %d) send message (session: 0x%llx, seqno: %d, messageid: 0x%llx): %s", connection, datacenterId, connection->getConnectionType(), (uint64_t) connection->getSissionId(), networkMessage->message->seqno, (uint64_t) networkMessage->message->msg_id, typeid(*messageBody).name());
|
DEBUG_D("connection(%p, dc%u, type %d) send message (session: 0x%llx, seqno: %d, messageid: 0x%llx): %s(%p)", connection, datacenterId, connection->getConnectionType(), (uint64_t) connection->getSissionId(), networkMessage->message->seqno, (uint64_t) networkMessage->message->msg_id, typeid(*messageBody).name(), messageBody);
|
||||||
messageContainer->messages.push_back(std::unique_ptr<TL_message>(std::move(networkMessage->message)));
|
messageContainer->messages.push_back(std::unique_ptr<TL_message>(std::move(networkMessage->message)));
|
||||||
}
|
}
|
||||||
messageId = ConnectionsManager::getInstance().generateMessageId();
|
messageId = ConnectionsManager::getInstance().generateMessageId();
|
||||||
|
|
|
@ -8,50 +8,84 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include <time.h>
|
||||||
#include "FileLog.h"
|
#include "FileLog.h"
|
||||||
|
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
#include <android/log.h>
|
#include <android/log.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
FILE *logFile = nullptr;
|
||||||
|
|
||||||
|
void FileLog::init(std::string path) {
|
||||||
|
logFile = fopen(path.c_str(), "w");
|
||||||
|
}
|
||||||
|
|
||||||
void FileLog::e(const char *message, ...) {
|
void FileLog::e(const char *message, ...) {
|
||||||
va_list argptr;
|
va_list argptr;
|
||||||
va_start(argptr, message);
|
va_start(argptr, message);
|
||||||
|
time_t t = time(0);
|
||||||
|
struct tm *now = localtime(&t);
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
__android_log_vprint(ANDROID_LOG_ERROR, "tgnet", message, argptr);
|
__android_log_vprint(ANDROID_LOG_ERROR, "tgnet", message, argptr);
|
||||||
#else
|
#else
|
||||||
printf("error: ");
|
printf("%d-%d %02d:%02d:%02d error: ", now->tm_mon + 1, now->tm_mday, now->tm_hour, now->tm_min, now->tm_sec);
|
||||||
vprintf(message, argptr);
|
vprintf(message, argptr);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
#endif
|
#endif
|
||||||
|
if (logFile) {
|
||||||
|
fprintf(logFile, "%d-%d %02d:%02d:%02d error: ", now->tm_mon + 1, now->tm_mday, now->tm_hour, now->tm_min, now->tm_sec);
|
||||||
|
vfprintf(logFile, message, argptr);
|
||||||
|
fprintf(logFile, "\n");
|
||||||
|
fflush(logFile);
|
||||||
|
}
|
||||||
|
|
||||||
va_end(argptr);
|
va_end(argptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileLog::w(const char *message, ...) {
|
void FileLog::w(const char *message, ...) {
|
||||||
va_list argptr;
|
va_list argptr;
|
||||||
va_start(argptr, message);
|
va_start(argptr, message);
|
||||||
|
time_t t = time(0);
|
||||||
|
struct tm *now = localtime(&t);
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
__android_log_vprint(ANDROID_LOG_WARN, "tgnet", message, argptr);
|
__android_log_vprint(ANDROID_LOG_WARN, "tgnet", message, argptr);
|
||||||
#else
|
#else
|
||||||
printf("warning: ");
|
printf("%d-%d %02d:%02d:%02d warning: ", now->tm_mon + 1, now->tm_mday, now->tm_hour, now->tm_min, now->tm_sec);
|
||||||
vprintf(message, argptr);
|
vprintf(message, argptr);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
#endif
|
#endif
|
||||||
|
if (logFile) {
|
||||||
|
fprintf(logFile, "%d-%d %02d:%02d:%02d warning: ", now->tm_mon + 1, now->tm_mday, now->tm_hour, now->tm_min, now->tm_sec);
|
||||||
|
vfprintf(logFile, message, argptr);
|
||||||
|
fprintf(logFile, "\n");
|
||||||
|
fflush(logFile);
|
||||||
|
}
|
||||||
|
|
||||||
va_end(argptr);
|
va_end(argptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileLog::d(const char *message, ...) {
|
void FileLog::d(const char *message, ...) {
|
||||||
va_list argptr;
|
va_list argptr;
|
||||||
va_start(argptr, message);
|
va_start(argptr, message);
|
||||||
|
time_t t = time(0);
|
||||||
|
struct tm *now = localtime(&t);
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
__android_log_vprint(ANDROID_LOG_DEBUG, "tgnet", message, argptr);
|
__android_log_vprint(ANDROID_LOG_DEBUG, "tgnet", message, argptr);
|
||||||
#else
|
#else
|
||||||
printf("debug: ");
|
printf("%d-%d %02d:%02d:%02d debug: ", now->tm_mon + 1, now->tm_mday, now->tm_hour, now->tm_min, now->tm_sec);
|
||||||
vprintf(message, argptr);
|
vprintf(message, argptr);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
#endif
|
#endif
|
||||||
|
if (logFile) {
|
||||||
|
fprintf(logFile, "%d-%d %02d:%02d:%02d debug: ", now->tm_mon + 1, now->tm_mday, now->tm_hour, now->tm_min, now->tm_sec);
|
||||||
|
vfprintf(logFile, message, argptr);
|
||||||
|
fprintf(logFile, "\n");
|
||||||
|
fflush(logFile);
|
||||||
|
}
|
||||||
|
|
||||||
va_end(argptr);
|
va_end(argptr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
class FileLog {
|
class FileLog {
|
||||||
public:
|
public:
|
||||||
|
static void init(std::string path);
|
||||||
static void e(const char *message, ...) __attribute__((format (printf, 1, 2)));
|
static void e(const char *message, ...) __attribute__((format (printf, 1, 2)));
|
||||||
static void w(const char *message, ...) __attribute__((format (printf, 1, 2)));
|
static void w(const char *message, ...) __attribute__((format (printf, 1, 2)));
|
||||||
static void d(const char *message, ...) __attribute__((format (printf, 1, 2)));
|
static void d(const char *message, ...) __attribute__((format (printf, 1, 2)));
|
||||||
|
|
|
@ -12,8 +12,6 @@
|
||||||
|
|
||||||
<uses-feature android:glEsVersion="0x00020000" android:required="false"/>
|
<uses-feature android:glEsVersion="0x00020000" android:required="false"/>
|
||||||
<uses-feature android:name="android.hardware.telephony" android:required="false" />
|
<uses-feature android:name="android.hardware.telephony" android:required="false" />
|
||||||
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
|
|
||||||
<uses-feature android:name="android.hardware.camera" android:required="false" />
|
|
||||||
<uses-feature android:name="android.hardware.wifi" android:required="false" />
|
<uses-feature android:name="android.hardware.wifi" android:required="false" />
|
||||||
<uses-feature android:name="android.hardware.screen.PORTRAIT" android:required="false" />
|
<uses-feature android:name="android.hardware.screen.PORTRAIT" android:required="false" />
|
||||||
<uses-feature android:name="android.hardware.microphone" android:required="false" />
|
<uses-feature android:name="android.hardware.microphone" android:required="false" />
|
||||||
|
@ -26,7 +24,6 @@
|
||||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
||||||
<uses-permission android:name="android.permission.CAMERA" />
|
|
||||||
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
|
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
|
||||||
<uses-permission android:name="android.permission.READ_CONTACTS" />
|
<uses-permission android:name="android.permission.READ_CONTACTS" />
|
||||||
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
|
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
|
||||||
|
@ -39,6 +36,7 @@
|
||||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
|
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
|
||||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||||
|
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:name=".ApplicationLoader"
|
android:name=".ApplicationLoader"
|
||||||
|
@ -108,6 +106,7 @@
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
<data android:scheme="tg" />
|
<data android:scheme="tg" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
<meta-data android:name="android.service.chooser.chooser_target_service" android:value=".TgChooserTargetService" />
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name="org.telegram.ui.IntroActivity"
|
android:name="org.telegram.ui.IntroActivity"
|
||||||
|
@ -159,6 +158,15 @@
|
||||||
android:resource="@xml/contacts" />
|
android:resource="@xml/contacts" />
|
||||||
</service>
|
</service>
|
||||||
|
|
||||||
|
<service
|
||||||
|
android:name=".TgChooserTargetService"
|
||||||
|
android:label="@string/AppName"
|
||||||
|
android:permission="android.permission.BIND_CHOOSER_TARGET_SERVICE">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.service.chooser.ChooserTargetService" />
|
||||||
|
</intent-filter>
|
||||||
|
</service>
|
||||||
|
|
||||||
<service android:name=".NotificationsService" android:enabled="true"/>
|
<service android:name=".NotificationsService" android:enabled="true"/>
|
||||||
<service android:name=".NotificationRepeat" android:exported="false"/>
|
<service android:name=".NotificationRepeat" android:exported="false"/>
|
||||||
<service android:name=".VideoEncodingService" android:enabled="true"/>
|
<service android:name=".VideoEncodingService" android:enabled="true"/>
|
||||||
|
|
Before Width: | Height: | Size: 152 KiB |
Before Width: | Height: | Size: 83 KiB |
Before Width: | Height: | Size: 167 KiB |
Before Width: | Height: | Size: 86 KiB |
Before Width: | Height: | Size: 154 KiB |
Before Width: | Height: | Size: 112 KiB |
Before Width: | Height: | Size: 76 KiB |
Before Width: | Height: | Size: 136 KiB |
Before Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 103 KiB |
Before Width: | Height: | Size: 260 KiB |
Before Width: | Height: | Size: 146 KiB |
Before Width: | Height: | Size: 297 KiB |
Before Width: | Height: | Size: 160 KiB |
Before Width: | Height: | Size: 280 KiB |
Before Width: | Height: | Size: 180 KiB |
Before Width: | Height: | Size: 126 KiB |
Before Width: | Height: | Size: 222 KiB |
Before Width: | Height: | Size: 85 KiB |
Before Width: | Height: | Size: 182 KiB |
After Width: | Height: | Size: 110 KiB |
After Width: | Height: | Size: 66 KiB |
After Width: | Height: | Size: 100 KiB |
After Width: | Height: | Size: 100 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 27 KiB |
After Width: | Height: | Size: 27 KiB |
After Width: | Height: | Size: 61 KiB |
After Width: | Height: | Size: 68 KiB |
After Width: | Height: | Size: 57 KiB |
After Width: | Height: | Size: 60 KiB |
After Width: | Height: | Size: 79 KiB |
After Width: | Height: | Size: 69 KiB |
After Width: | Height: | Size: 59 KiB |
After Width: | Height: | Size: 60 KiB |
After Width: | Height: | Size: 63 KiB |
After Width: | Height: | Size: 55 KiB |
After Width: | Height: | Size: 40 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 81 KiB |
After Width: | Height: | Size: 73 KiB |
After Width: | Height: | Size: 78 KiB |
After Width: | Height: | Size: 74 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 32 KiB |
After Width: | Height: | Size: 30 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 55 KiB |
After Width: | Height: | Size: 64 KiB |
After Width: | Height: | Size: 55 KiB |
After Width: | Height: | Size: 52 KiB |
After Width: | Height: | Size: 51 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 38 KiB |
After Width: | Height: | Size: 39 KiB |
After Width: | Height: | Size: 38 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 185 KiB |
After Width: | Height: | Size: 112 KiB |
After Width: | Height: | Size: 170 KiB |
After Width: | Height: | Size: 174 KiB |
After Width: | Height: | Size: 47 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 106 KiB |
After Width: | Height: | Size: 120 KiB |
After Width: | Height: | Size: 99 KiB |
After Width: | Height: | Size: 108 KiB |