OpenLauncherTeam / openlauncher

Customizable and Open Source Launcher for Android
Apache License 2.0
1.41k stars 413 forks source link

Error when adding widget #692

Open niccokunzmann opened 1 year ago

niccokunzmann commented 1 year ago

General Information

Description

When I choose a widget myhackerspace (installed from android studio), it crashes.

Log

This is only needed for crashes or other issues you notice in your system logs from OpenLauncher.

Build version: 0.7.4 
Build date: 1980-01-01 00:00:00 
Current date: 2022-08-08 22:33:03 
Device: Motorola MotoG3 

Stack trace:  
java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=9848, result=-1, data=Intent { (has extras) }} to activity {com.benny.openlauncher/com.benny.openlauncher.activity.HomeActivity}: java.lang.SecurityException: Permission Denial: starting Intent { act=android.appwidget.action.APPWIDGET_CONFIGURE cmp=io.spaceapi.community.myhackerspace/.Widget_config (has extras) } from ProcessRecord{788346d 25564:com.benny.openlauncher/u0a268} (pid=25564, uid=10268) not exported from uid 10108
    at android.app.ActivityThread.deliverResults(ActivityThread.java:3720)
    at android.app.ActivityThread.handleSendResult(ActivityThread.java:3763)
    at android.app.ActivityThread.-wrap16(ActivityThread.java)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1403)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:148)
    at android.app.ActivityThread.main(ActivityThread.java:5443)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
Caused by: java.lang.SecurityException: Permission Denial: starting Intent { act=android.appwidget.action.APPWIDGET_CONFIGURE cmp=io.spaceapi.community.myhackerspace/.Widget_config (has extras) } from ProcessRecord{788346d 25564:com.benny.openlauncher/u0a268} (pid=25564, uid=10268) not exported from uid 10108
    at android.os.Parcel.readException(Parcel.java:1620)
    at android.os.Parcel.readException(Parcel.java:1573)
    at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:2679)
    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1574)
    at android.app.Activity.startActivityForResult(Activity.java:3934)
    at android.app.Activity.startActivityForResult(Activity.java:3894)
    at com.benny.openlauncher.activity.homeparts.HpDesktopOption.configureWidget(HpDesktopOption.java:79)
    at com.benny.openlauncher.activity.HomeActivity.onActivityResult(HomeActivity.java:487)
    at android.app.Activity.dispatchActivityResult(Activity.java:6470)
    at android.app.ActivityThread.deliverResults(ActivityThread.java:3716)
    ... 9 more
gsantner commented 1 year ago

OpenLauncher is not active developed. If you need something, you need to do it on your own or find somebody to do it for you. Merge requests welcome.

Ptitg commented 1 year ago

I think that it is not a bug in OpenLauncher but in myhackerspace. Widget configuration activity must declare android:exported="true" in its AndroidManifest.xml.

niccokunzmann commented 1 year ago

Uhhh...... Thanks!

duongpt582 commented 1 year ago

// display dialog to confirm accept if (!appWidgetManager.bindAppWidgetIdIfAllowed(appWidgetId, appWidgetInfo.provider, extras)) { Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_BIND); intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId); intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_PROVIDER, appWidgetInfo.provider); _homeActivity.startActivityForResult(intent, REQUEST_BIND_APPWIDGET); }

    if (appWidgetInfo.configure != null && appWidgetManager.bindAppWidgetIdIfAllowed(appWidgetId, appWidgetInfo.provider, extras)) {
        Intent intent2 = new Intent("android.appwidget.action.APPWIDGET_CONFIGURE");
        intent2.setComponent(appWidgetInfo.configure);
        intent2.putExtra("appWidgetId", appWidgetId);
        _homeActivity.startActivityForResult(intent2, REQUEST_CREATE_APPWIDGET);
    } else {
        createWidget(data);
    }