Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the issue of inability to start on Android 14 #293

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

Comanx
Copy link
Contributor

@Comanx Comanx commented Jan 19, 2024

Fix the issue where setting android:exported="true" is required to start an Activity on Android 14

Fix the issue where setting android:exported="true" is required to start an Activity on Android 14
@floooh
Copy link
Owner

floooh commented Jan 19, 2024

Thanks! But hmm, reading the documentation here: https://developer.android.com/privacy-and-security/risks/android-exported

...shouldn't it rather be android:exported="false"?

I'm still on Android 13 on my phone. Will check if there's an update to Android 14 available and tinker around with that fix before merging. Might be a few days.

@floooh floooh self-assigned this Jan 19, 2024
@Comanx
Copy link
Contributor Author

Comanx commented Jan 20, 2024

https://developer.android.com/about/versions/12/behavior-changes-12#exported
"If the app component includes the LAUNCHER category, set android:exported to true. In most other cases, set android:exported to false."

@floooh
Copy link
Owner

floooh commented Jan 22, 2024

Giving this a quick test now (on an Android 13 phone though, so just checking if it also works on 13).

@floooh
Copy link
Owner

floooh commented Jan 22, 2024

Blargh, somehow my Android phone is no longer detected when I connect it to my Mac. Probably a latest-macOs-thing. I try to investigate.

@Comanx
Copy link
Contributor Author

Comanx commented Jan 22, 2024

You can change ANDROID_PLATFORM: android-28 to android-31, it should not start on Android 13

@floooh
Copy link
Owner

floooh commented Jan 22, 2024

Hmm ok, what is the behaviour on Android 14 when using ANDROID_PLATFORM: android-28 without the export manifest item?

E.g. is export actually needed for platform-31 apps, regardless of the Android OS version?

(because in that case we should consider switching all defaults to platform-31 together with the export fix)

@Comanx
Copy link
Contributor Author

Comanx commented Jan 22, 2024

because "If your app targets Android 12 or higher and contains activities, services, or broadcast receivers that use intent filters, you must explicitly declare the android:exported attribute for these app components."
https://developer.android.com/about/versions/12/behavior-changes-12#exported

@floooh
Copy link
Owner

floooh commented Jan 22, 2024

Ah right I see, because the manifest that's generated by fips has an intent-filter field.

I'm currently still not able to test on my phone, but I will just merge the PR.

Does the change require to update the platform in the build configs to platform-31 though?

(for instance here:

ANDROID_PLATFORM: android-28
)

If yes we should probably do this too in this PR?

@floooh
Copy link
Owner

floooh commented Jan 22, 2024

...I'm actually able to test now... had to update the Android platform-tools and reboot my Mac (not just 'adb kill-server')

@floooh floooh merged commit 3064811 into floooh:master Jan 22, 2024
1 check passed
@floooh
Copy link
Owner

floooh commented Jan 22, 2024

Ok merged. Many thanks!

I tested with only the fix (e.g. keeping platform-28), and that seems to work on my Android 13 device.

@Comanx
Copy link
Contributor Author

Comanx commented Jan 22, 2024

Ah right I see, because the manifest that's generated by fips has an intent-filter field.

I'm currently still not able to test on my phone, but I will just merge the PR.

Does the change require to update the platform in the build configs to platform-31 though?

(for instance here:

ANDROID_PLATFORM: android-28

)
If yes we should probably do this too in this PR?

yes, that sounds good. considering that Google Play requires a minimum target API level of 33.
https://support.google.com/googleplay/android-developer/answer/11926878?hl=en

@floooh
Copy link
Owner

floooh commented Jan 22, 2024

Ok, fips should eventually update its default platform in the build configs, but since that can also be configured by the user it's not so high priority IMHO.

Thanks for all the info btw :)

@floooh
Copy link
Owner

floooh commented Jan 22, 2024

PS: as you can see I have merged the your PR without updating the default platform, but if you feel like it, feel free to provide a PR for fips to update to platform-33.

Note that this doesn't only require updating the build config files, but also the installed platform package here:

install_package(fips_dir, '"platforms;android-28"')

I currently don't have all that much time to look into Android specific things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants