mirror of
https://github.com/emanuele-f/PCAPdroid.git
synced 2026-06-16 21:10:57 +08:00
Change telegram channel to group
This commit is contained in:
parent
e1a6436489
commit
ef09f36109
@ -67,7 +67,7 @@ public class MainActivity extends AppCompatActivity implements LoaderManager.Loa
|
||||
private static final int MENU_ITEM_APP_SELECTOR_IDX = 0;
|
||||
public static final int OPERATION_SEARCH_LOADER = 23;
|
||||
|
||||
public static final String TELEGRAM_CHANNEL_NAME = "PCAPdroid";
|
||||
public static final String TELEGRAM_GROUP_NAME = "PCAPdroid";
|
||||
public static final String GITHUB_PROJECT_URL = "https://github.com/emanuele-f/PCAPdroid";
|
||||
public static final String GITHUB_DOCS_URL = "https://emanuele-f.github.io/PCAPdroid";
|
||||
|
||||
@ -219,17 +219,17 @@ public class MainActivity extends AppCompatActivity implements LoaderManager.Loa
|
||||
return true;
|
||||
}
|
||||
|
||||
private void openTelegramChannel() {
|
||||
private void openTelegram() {
|
||||
Intent intent = null;
|
||||
|
||||
try {
|
||||
getPackageManager().getPackageInfo("org.telegram.messenger", 0);
|
||||
|
||||
// Open directly into the telegram app
|
||||
intent = new Intent(Intent.ACTION_VIEW, Uri.parse("tg://resolve?domain=" + TELEGRAM_CHANNEL_NAME));
|
||||
intent = new Intent(Intent.ACTION_VIEW, Uri.parse("tg://resolve?domain=" + TELEGRAM_GROUP_NAME));
|
||||
} catch (Exception e) {
|
||||
// Telegram not found, open in the browser
|
||||
intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://t.me/" + TELEGRAM_CHANNEL_NAME));
|
||||
intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://t.me/" + TELEGRAM_GROUP_NAME));
|
||||
}
|
||||
|
||||
if(intent != null)
|
||||
@ -261,7 +261,7 @@ public class MainActivity extends AppCompatActivity implements LoaderManager.Loa
|
||||
startActivity(browserIntent);
|
||||
return true;
|
||||
} else if (id == R.id.action_open_telegram) {
|
||||
openTelegramChannel();
|
||||
openTelegram();
|
||||
return true;
|
||||
} else if (id == R.id.action_open_user_guide) {
|
||||
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(GITHUB_DOCS_URL));
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
|
||||
<item
|
||||
android:id="@+id/action_open_telegram"
|
||||
android:title="@string/open_telegram"
|
||||
android:title="@string/open_telegram_group"
|
||||
android:orderInCategory="130"
|
||||
app:showAsAction="never"
|
||||
/>
|
||||
@ -45,4 +45,4 @@
|
||||
app:showAsAction="never"
|
||||
/>
|
||||
|
||||
</menu>
|
||||
</menu>
|
||||
|
||||
@ -62,7 +62,7 @@
|
||||
<string name="tls_decryption">TLS Decryption</string>
|
||||
<string name="user_guide">User Guide</string>
|
||||
<string name="rate_app">Rate App</string>
|
||||
<string name="open_telegram">Telegram Channel</string>
|
||||
<string name="open_telegram_group">Telegram Group</string>
|
||||
<string name="open_github">Github Project</string>
|
||||
<string name="yes">YES</string>
|
||||
<string name="no">NO</string>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user