最新消息:20210917 已从crifan.com换到crifan.org

【已解决】安卓项目rcsjta中core的apk中入口activity或service是什么

Service crifan 394浏览 0评论
折腾:
【未解决】rcsjta中研究RCS的core的Service本身相关代码以希望找到为何没启动的原因
期间,去搞清楚此处的rcsjta的android项目中
core的apk中,对应的入口的activity或service是啥
从core的apk界面中app的title是:RCS Provisioning,所以去找找Provisioning相关的内容:
AndroidManifest.xml
<!-- Local provisioning (only for debug) -->


<activity
    android:name=".provisioning.local.Provisioning"
    android:icon="@drawable/rcs_icon"
    android:label="@string/provisioning_app_name"
    android:theme="@style/Theme.AppCompat">
    <intent-filter>
        <action android:name="android.intent.action.MAIN"/>
        <category android:name="android.intent.category.LAUNCHER"/>
    </intent-filter>
</activity>
src/com/gsma/rcs/provisioning/local/Provisioning.java
public class Provisioning extends AppCompatActivity {

    private Provisioning mActivity;

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mActivity = this;
        setContentView(R.layout.provisioning);
去调试core,以为能运行到断点
结果调试 红米Note8Pro 都没运行到断点,很是奇怪
另外想到一个思路:
或许是找到core的入口启动处的
activity或service 一点点看看 初始化了哪些东西?
所以问题变成找RCS的core的入口处,并加断点,确保运行到
从代码上看是
src/com/gsma/rcs/ri/RiApplication.java
/**
 * This subclass of Application allows to get a resource content from a static context
 * 
 * @author Philippe LEMORDANT
 */
public class RiApplication extends Application {

    public void onCreate() {
        super.onCreate();
        mContext = getApplicationContext();
看错了,这个是RI的
不过也是可以后续考虑的,去调试看看RI入口处,及后续流程如何。
通过core的app的title
RCS Provisioning
找到
res/values/rcs_provisioning_strings.xml
<string name="provisioning_app_name">RCS Provisioning</string>
<string name="label_reboot_service">The RCS service should be restarted before to take into account the modifications</string>
除了要的provisioning_app_name
刚好也看到了前面提示的
The RCS service should be restarted before to take into account the modifications
对应的label_reboot_service
/RCS/rcsjta/core/AndroidManifest.xml
<activity
    android:name=".provisioning.local.Provisioning"
    android:icon="@drawable/rcs_icon"
    android:label="@string/provisioning_app_name"
    android:theme="@style/Theme.AppCompat">
    <intent-filter>
        <action android:name="android.intent.action.MAIN"/>
        <category android:name="android.intent.category.LAUNCHER"/>
    </intent-filter>
</activity>
去看看.provisioning.local.Provisioning
src/com/gsma/rcs/provisioning/local/Provisioning.java
public class Provisioning extends AppCompatActivity {

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mActivity = this;
    setContentView(R.layout.provisioning);
看起来:的确就是这个文件表示core的apk的启动主页的
尤其是
R.layout.provisioning
对应的
res/layout/provisioning.xml
但是之前调试core,竟然是没有运行到,很是诡异,要去找到原因 
才注意到,好像也不对:
此处的
<activity
    android:name=”.provisioning.local.Provisioning”
是属于manifest的后面
不是第一个activity
此处core的manifest的第一个是application:
<application
    android:icon="@drawable/rcs_icon"
    android:label="@string/rcs_core_application_title">


    <!-- RCS service -->


    <service
        android:name="com.gsma.rcs.service.RcsCoreService"
        android:permission="com.gsma.services.permission.RCS">
        <intent-filter>
            <action android:name="com.gsma.rcs.SERVICE"/>
            <action android:name="com.gsma.services.rcs.contact.IContactService"/>
            <action android:name="com.gsma.services.rcs.capability.ICapabilityService"/>
            <action android:name="com.gsma.services.rcs.chat.IChatService"/>
            <action android:name="com.gsma.services.rcs.filetransfer.IFileTransferService"/>
            <action android:name="com.gsma.services.rcs.sharing.video.IVideoSharingService"/>
            <action android:name="com.gsma.services.rcs.sharing.image.IImageSharingService"/>
            <action android:name="com.gsma.services.rcs.sharing.geoloc.IGeolocSharingService"/>
            <action android:name="com.gsma.services.rcs.history.IHistoryService"/>
            <action android:name="com.gsma.services.rcs.extension.IMultimediaSessionService"/>
            <action android:name="com.gsma.services.rcs.upload.IFileUploadService"/>
        </intent-filter>
    </service>


    <!-- RCS settings application -->
其中的
android的label是RCS services
android中如何找到入口的activity或service
android 入口 activity service
android entry activity service
android 笔记 【一个应用程序的入口 ——Application】_zcmain的专栏-CSDN博客_eyes_application
  • Android程序
    • 一个Application实例
      • 多个
        • Activity
        • Service
        • ContentProvider
        • Broadcast Receiver
应用基础知识  |  Android 开发者  |  Android Developers
共有四种不同的应用组件类型:
另外顺带看到了
/rcsjta/RI/AndroidManifest.xml
<!-- Main -->
<activity
    android:name="com.gsma.rcs.ri.RI"
    android:label="@string/app_name"/>
<activity
    android:name="com.gsma.rcs.ri.AboutRI"
    android:label="@string/menu_about"/>
即:RI的入口activity是:com.gsma.rcs.ri.RI
此处看了资料后,大概明白了点:
/rcsjta/core/AndroidManifest.xml
core中的:
<application
    android:icon="@drawable/rcs_icon"
    android:label="@string/rcs_core_application_title">


    <!-- RCS service -->


    <service
        android:name="com.gsma.rcs.service.RcsCoreService"
        android:permission="com.gsma.services.permission.RCS">
        <intent-filter>
            <action android:name="com.gsma.rcs.SERVICE"/>
            <action android:name="com.gsma.services.rcs.contact.IContactService"/>
            <action android:name="com.gsma.services.rcs.capability.ICapabilityService"/>
            <action android:name="com.gsma.services.rcs.chat.IChatService"/>
            <action android:name="com.gsma.services.rcs.filetransfer.IFileTransferService"/>
            <action android:name="com.gsma.services.rcs.sharing.video.IVideoSharingService"/>
            <action android:name="com.gsma.services.rcs.sharing.image.IImageSharingService"/>
            <action android:name="com.gsma.services.rcs.sharing.geoloc.IGeolocSharingService"/>
            <action android:name="com.gsma.services.rcs.history.IHistoryService"/>
            <action android:name="com.gsma.services.rcs.extension.IMultimediaSessionService"/>
            <action android:name="com.gsma.services.rcs.upload.IFileUploadService"/>
        </intent-filter>
    </service>
表示
com.gsma.rcs.service.RcsCoreService
会被intent-filter下面的其他多个service调用 启动
另外:
<!-- Device events receiver -->


<receiver android:name="com.gsma.rcs.service.DeviceBoot">
    <intent-filter>
        <action android:name="android.intent.action.BOOT_COMPLETED"/>
    </intent-filter>
</receiver>
<receiver android:name="com.gsma.rcs.service.DeviceShutdown">
    <intent-filter>
        <action android:name="android.intent.action.ACTION_SHUTDOWN"/>
    </intent-filter>
</receiver>
-》设备启动后,应该会调用到com.gsma.rcs.service.DeviceBoot?
去分别看看
com.gsma.rcs.SERVICE
但是没有,最接近的只有
src/com/gsma/rcs/service/RcsCoreService.java
package com.gsma.rcs.service;

    public class RcsCoreService extends Service implements CoreListener {
有个com.gsma.rcs.service的package
另外,此处core的项目所依赖的其他子项目
可以通过
build.gradle
dependencies {
    implementation project(':bouncycastle')
    implementation project(':nist_sip')
    implementation project(':api')
    implementation 'dnsjava:dnsjava:2.1.7'
    implementation 'com.android.support:support-v4:25.0.1'
    implementation 'com.android.support:appcompat-v7:25.0.1'
}
看出来有:
  • bouncycastle
  • nist_sip
  • api
  • dnsjava
  • support
  • appcompat
感觉还是先回去解决之前的2个Exception异常吧
后记:
【未解决】rcsjta的core出错:FATAL EXCEPTION main android.os.FileUriExposedException file exposed beyond app through Intent.getData()
期间,换安卓手机为 小米9
结果调试后,发现可以运行到,我们希望的:
rcsjta/core/src/com/gsma/rcs/provisioning/local/Provisioning.java
public class Provisioning extends AppCompatActivity {

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mActivity = this;
    setContentView(R.layout.provisioning);
再重新试试,多试试几次,确保的确是我们要的core的入口
确定没问题。
【总结】
此处的core的启动,是我们原先理解的
rcsjta/core/src/com/gsma/rcs/provisioning/local/Provisioning.java
的Provisioning的onCreate
但是之前调试为何断点没运行到:原因未知。很是诡异
总之最后换小米9,是可以调试运行到onCreate的断点了。可以继续调试找逻辑了。

转载请注明:在路上 » 【已解决】安卓项目rcsjta中core的apk中入口activity或service是什么

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
90 queries in 0.190 seconds, using 23.31MB memory