如何查明 Android 上的 Skype 通话当前是否处于活动状态

发布于 2024-12-26 23:23:58 字数 1231 浏览 2 评论 0原文

好的,我反编译了 Skype 的清单,以查明通话期间是否有任何服务或广播正在运行。 只有少数来电内部广播。而且仅存在一个接收器和一项服务。

我使用我的应用程序监视所有正在运行的服务,但 SkypeMainService 始终在运行,即使不在通话中也是如此。

另外 AudioMode 不会被 Skype 更改(但根据开发人员想要的 logcat-logs,但他们只是不这样做),所以我不能简单地检查它是否是 MODE_IN_CALL< /代码>。

您对如何查明 Skype 当前是否正在运行并且正在进行通话有什么建议吗?

谢谢!

/编辑:活动等的简要概述:

<activity android:name="com.skype.raider.Main">
<activity-alias android:name="com.skype.raider.ui.SplashScreenActivity" android:targetActivity="com.skype.raider.Main">
<receiver android:name="com.skype.MainReceiver" android:enabled="true" android:exported="false">
   <action android:name="android.intent.action.BOOT_COMPLETED" />
   <action android:name="android.intent.action.MEDIA_MOUNTED" />
   <action android:name="android.intent.action.SEARCH" />
   <action android:name="android.intent.action.CALL_PRIVILEGED" />
   <action android:name="com.skype.raider.INCOMING_GSM_CALL" />
   <action android:name="com.skype.raider.ON_GSM_CALL" />
   <action android:name="com.skype.raider.intent.action.request_sync" />
</receiver>
<service android:name="com.skype.MainService">

Okay, I decompiled Skype's manifest to find out if there are any Services or Broadcasts running during a call.
There are only a few internal broadcasts for incoming calls. Also only one receiver and one service exist.

I monitored all running services with my app, but the SkypeMainService is always running, even if not in a call.

Also AudioMode is not changed by skype (but according to the logcat-logs the dev wanted to, but they just don't do it), so I cannot simply check if it is MODE_IN_CALL.

Do you have any suggestions how to find out, if Skype is currently running and having an active call?

Thanks!

/edit: A brief overview of the Activities etc:

<activity android:name="com.skype.raider.Main">
<activity-alias android:name="com.skype.raider.ui.SplashScreenActivity" android:targetActivity="com.skype.raider.Main">
<receiver android:name="com.skype.MainReceiver" android:enabled="true" android:exported="false">
   <action android:name="android.intent.action.BOOT_COMPLETED" />
   <action android:name="android.intent.action.MEDIA_MOUNTED" />
   <action android:name="android.intent.action.SEARCH" />
   <action android:name="android.intent.action.CALL_PRIVILEGED" />
   <action android:name="com.skype.raider.INCOMING_GSM_CALL" />
   <action android:name="com.skype.raider.ON_GSM_CALL" />
   <action android:name="com.skype.raider.intent.action.request_sync" />
</receiver>
<service android:name="com.skype.MainService">

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

冷清清 2025-01-02 23:23:59

您可以采取以下措施来增加猜测的机会:

1) 检查应用程序是否正在运行:

ActivityManager activityManager = (ActivityManager) this.getSystemService( ACTIVITY_SERVICE );
    List<RunningAppProcessInfo> procInfos = actvityManager.getRunningAppProcesses();
    for(int i = 0; i < procInfos.size(); i++){
        if(procInfos.get(i).processName.equals("com.android.browser")) {
            Toast.makeText(getApplicationContext(), "Browser is running", Toast.LENGTH_LONG).show();
        }
    }

2) 使用 PhoneManager

3) 最后检查 Skype 任何已知 api 的开发者页面

There is a few things that you can do to increase your chance of guessing it:

1) Check if the application is running:

ActivityManager activityManager = (ActivityManager) this.getSystemService( ACTIVITY_SERVICE );
    List<RunningAppProcessInfo> procInfos = actvityManager.getRunningAppProcesses();
    for(int i = 0; i < procInfos.size(); i++){
        if(procInfos.get(i).processName.equals("com.android.browser")) {
            Toast.makeText(getApplicationContext(), "Browser is running", Toast.LENGTH_LONG).show();
        }
    }

2) Check the phone state for data exchanging using the PhoneManager

3) and finally check Skype developers page for any known api

春夜浅 2025-01-02 23:23:58

好吧,我真的希望有人能提供有用的答案。但是,我在评论中采纳了 Reuben 的建议并制定了这个方法:

/**
 * Gets the current activity
 * 
 * @param context
 *            A context to use
 * @return The Activity name
 */
public static String getCurrentTopActivity(Context context) {
    ActivityManager mActivityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
    List<ActivityManager.RunningTaskInfo> RunningTask = mActivityManager.getRunningTasks(1);
    ActivityManager.RunningTaskInfo ar = RunningTask.get(0);
    return ar.topActivity.getClassName().toString();
}

然后我检查结果是否等于 com.skype.raider.Main。如果没有正在进行的 Skype 通话,但主应用程序已打开,该值也会返回 true。

感谢您的所有帮助,尤其是鲁本!

编辑:您的清单中需要以下权限

<uses-permission android:name="android.permission.GET_TASKS"/>

Okay, I really hoped someone would provide a useful answer. However, I picked up Reuben's advice in the comment and made this method:

/**
 * Gets the current activity
 * 
 * @param context
 *            A context to use
 * @return The Activity name
 */
public static String getCurrentTopActivity(Context context) {
    ActivityManager mActivityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
    List<ActivityManager.RunningTaskInfo> RunningTask = mActivityManager.getRunningTasks(1);
    ActivityManager.RunningTaskInfo ar = RunningTask.get(0);
    return ar.topActivity.getClassName().toString();
}

Then I check if the result equals com.skype.raider.Main. This will also return true if there is no active Skype call, but the main app is open.

Thanks for all the help, especially Reuben!

Edit: Your will need the following permission in your manifest

<uses-permission android:name="android.permission.GET_TASKS"/>
我不会写诗 2025-01-02 23:23:58

当 Skype 更改其中任何内容时(可能是在 2 天后的更新中 - 在您完成编码之前),您的代码可能会崩溃。所以我认为不值得尝试此类事情。

抱歉,这可能不是一个“答案”,但我认为为此投入时间不值得。

The day Skype changes any of this (might be in that update that's coming in 2 days from now - before you finish coding) your code might break. So I don't think its worth attempting anything of this sort.

I am sorry, this might not be an "answer", but I don't think time invested into this is worth it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文