mirror of https://github.com/NekoX-Dev/NekoX.git
[TF][KILL] Google Voice
(cherry picked from commit 217a39abcb86d609827eaa16c24f95fe94156d5c)
This commit is contained in:
parent
fd30c76096
commit
64c4e79795
|
@ -27,7 +27,6 @@ dependencies {
|
||||||
implementation 'com.googlecode.mp4parser:isoparser:1.0.6'
|
implementation 'com.googlecode.mp4parser:isoparser:1.0.6'
|
||||||
implementation 'com.stripe:stripe-android:2.0.2'
|
implementation 'com.stripe:stripe-android:2.0.2'
|
||||||
implementation 'com.google.code.gson:gson:2.8.6'
|
implementation 'com.google.code.gson:gson:2.8.6'
|
||||||
implementation files('libs/libgsaverification-client.aar')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//return an api key from a properties file.
|
//return an api key from a properties file.
|
||||||
|
|
Binary file not shown.
|
@ -196,15 +196,6 @@
|
||||||
android:resizeableActivity="false"
|
android:resizeableActivity="false"
|
||||||
android:windowSoftInputMode="adjustResize|stateHidden">
|
android:windowSoftInputMode="adjustResize|stateHidden">
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
|
||||||
android:name=".GoogleVoiceClientActivity"
|
|
||||||
android:exported="true">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="com.google.android.voicesearch.SEND_MESSAGE_TO_CONTACTS" />
|
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
|
||||||
<data android:mimeType="text/plain" />
|
|
||||||
</intent-filter>
|
|
||||||
</activity>
|
|
||||||
<activity
|
<activity
|
||||||
android:name="org.telegram.ui.VoIPActivity"
|
android:name="org.telegram.ui.VoIPActivity"
|
||||||
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
|
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
|
||||||
|
@ -288,7 +279,6 @@
|
||||||
<service android:name=".VideoEncodingService" android:enabled="true"/>
|
<service android:name=".VideoEncodingService" android:enabled="true"/>
|
||||||
<service android:name=".LocationSharingService" android:enabled="true"/>
|
<service android:name=".LocationSharingService" android:enabled="true"/>
|
||||||
<service android:name=".voip.VoIPService" android:enabled="true"/>
|
<service android:name=".voip.VoIPService" android:enabled="true"/>
|
||||||
<service android:name=".GoogleVoiceClientService"/>
|
|
||||||
<service android:name=".MusicPlayerService" android:exported="true" android:enabled="true"/>
|
<service android:name=".MusicPlayerService" android:exported="true" android:enabled="true"/>
|
||||||
<service android:name=".MusicBrowserService" android:exported="true">
|
<service android:name=".MusicBrowserService" android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
/*
|
|
||||||
* This is the source code of Telegram for Android v. 5.x.x
|
|
||||||
* It is licensed under GNU GPL v. 2 or later.
|
|
||||||
* You should have received a copy of the license in this archive (see LICENSE).
|
|
||||||
*
|
|
||||||
* Copyright Nikolai Kudashov, 2013-2018.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.telegram.messenger;
|
|
||||||
|
|
||||||
import com.google.android.search.verification.client.SearchActionVerificationClientActivity;
|
|
||||||
import com.google.android.search.verification.client.SearchActionVerificationClientService;
|
|
||||||
|
|
||||||
public class GoogleVoiceClientActivity extends SearchActionVerificationClientActivity {
|
|
||||||
|
|
||||||
public Class<? extends SearchActionVerificationClientService> getServiceClass() {
|
|
||||||
return GoogleVoiceClientService.class;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,55 +0,0 @@
|
||||||
/*
|
|
||||||
* This is the source code of Telegram for Android v. 5.x.x
|
|
||||||
* It is licensed under GNU GPL v. 2 or later.
|
|
||||||
* You should have received a copy of the license in this archive (see LICENSE).
|
|
||||||
*
|
|
||||||
* Copyright Nikolai Kudashov, 2013-2018.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.telegram.messenger;
|
|
||||||
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.text.TextUtils;
|
|
||||||
|
|
||||||
import com.google.android.search.verification.client.SearchActionVerificationClientService;
|
|
||||||
|
|
||||||
import org.telegram.tgnet.TLRPC;
|
|
||||||
|
|
||||||
public class GoogleVoiceClientService extends SearchActionVerificationClientService {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void performAction(Intent intent, boolean isVerified, Bundle options) {
|
|
||||||
if (!isVerified) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
AndroidUtilities.runOnUIThread(() -> {
|
|
||||||
try {
|
|
||||||
int currentAccount = UserConfig.selectedAccount;
|
|
||||||
ApplicationLoader.postInitApplication();
|
|
||||||
if (AndroidUtilities.needShowPasscode() || SharedConfig.isWaitingForPasscodeEnter) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
String text = intent.getStringExtra("android.intent.extra.TEXT");
|
|
||||||
if (!TextUtils.isEmpty(text)) {
|
|
||||||
String contactUri = intent.getStringExtra("com.google.android.voicesearch.extra.RECIPIENT_CONTACT_URI");
|
|
||||||
String id = intent.getStringExtra("com.google.android.voicesearch.extra.RECIPIENT_CONTACT_CHAT_ID");
|
|
||||||
int uid = Integer.parseInt(id);
|
|
||||||
TLRPC.User user = MessagesController.getInstance(currentAccount).getUser(uid);
|
|
||||||
if (user == null) {
|
|
||||||
user = MessagesStorage.getInstance(currentAccount).getUserSync(uid);
|
|
||||||
if (user != null) {
|
|
||||||
MessagesController.getInstance(currentAccount).putUser(user, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (user != null) {
|
|
||||||
ContactsController.getInstance(currentAccount).markAsContacted(contactUri);
|
|
||||||
SendMessagesHelper.getInstance(currentAccount).sendMessage(text, user.id, null, null, true, null, null, null, true, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
FileLog.e(e);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue