Skip to content

Unknown calling package name xxx #465

Description

@totoR13

Dear all,
I created a new Android project importing DroidPlugin as module.

I'm trying DroidPlugin virtualization tool with different apps and for several of them (e.g., https://apkpure.com/it/puzzle/br.com.cjdinfo.puzzle or https://apkpure.com/it/italian-soccer-2020-2021/com.jappit.calcio) I received an error like this:

E/MyCrashHandler: uncaughtExceptionjava.lang.SecurityException: Unknown calling package name 'br.com.cjdinfo.puzzle'.
        at android.os.Parcel.readException(Parcel.java:1683)
        at android.os.Parcel.readException(Parcel.java:1636)
        at ks.a(:com.google.android.gms.policy_ads_fdr_dynamite@21460000@21460000.297791526.297791526:49)
        at kp.a(:com.google.android.gms.policy_ads_fdr_dynamite@21460000@21460000.297791526.297791526:2)
        at kr.a(:com.google.android.gms.policy_ads_fdr_dynamite@21460000@21460000.297791526.297791526:3)
        at ki.c(:com.google.android.gms.policy_ads_fdr_dynamite@21460000@21460000.297791526.297791526:6)
        at kl.handleMessage(:com.google.android.gms.policy_ads_fdr_dynamite@21460000@21460000.297791526.297791526:27)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at pg.a(:com.google.android.gms.policy_ads_fdr_dynamite@21460000@21460000.297791526.297791526:0)
        at pg.dispatchMessage(:com.google.android.gms.policy_ads_fdr_dynamite@21460000@21460000.297791526.297791526:0)
        at android.os.Looper.loop(Looper.java:154)
        at android.os.HandlerThread.run(HandlerThread.java:61)

It seems that the proxy object doesn't work as expected: the tool do not change the plugin package name with the container one for system calls (e.g. like startActivity() call).

Below I add some details about my configuration:

MainActivity

public class MainActivity extends AppCompatActivity {
    [...]

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        String apkPath = [...];
        doInstall(new File(apkPath));
    }

    private void doInstall(final File apkPath) {
        try {
            Activity activity = this;
            final PackageInfo info = getPackageManager().getPackageArchiveInfo(apkPath.getAbsolutePath(), PackageManager.GET_ACTIVITIES);
            if (info == null) {
                // handle error
                return;
            }
            final int re = PluginManager.getInstance().installPackage(apkPath.getAbsolutePath(), PackageManagerCompat.INSTALL_REPLACE_EXISTING);
            switch (re) {
                case PluginManager.INSTALL_FAILED_NO_REQUESTEDPERMISSION:
                    Toast.makeText(activity, "Installation failed. Plugin app has too permissions.\n", Toast.LENGTH_SHORT).show();
                    break;
                case INSTALL_FAILED_NOT_SUPPORT_ABI:
                    Toast.makeText(activity, "No supported ABI.\n", Toast.LENGTH_SHORT).show();
                    break;
                case INSTALL_SUCCEEDED:
                    Toast.makeText(activity, "Instalation ok", Toast.LENGTH_SHORT).show();
                    PackageManager pm = activity.getPackageManager();
                    Intent intent = pm.getLaunchIntentForPackage(info.packageName);
                    if (intent != null) {
                        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                        startActivity(intent);
                    } else {
                        Log.e(TAG, "pm " + pm.toString() + " no find intent " + info.packageName);
                    }
                    break;
            }
        } catch (RemoteException e) {
            e.printStackTrace();
        }
    }

}

AndroidManifest.xml

 <application android:name="com.morgoo.droidplugin.PluginApplication"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/MyTheme">
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name"
            android:theme="@style/MyTheme.NoActionBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

How can I solve this problem?

Thank you

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions