Status Update
Comments
il...@google.com <il...@google.com> #2
Branch: androidx-main
commit 57ca221882695bd6a52549f4d9ea3b812e6fe87c
Author: Simon Schiller <simonschiller@users.noreply.github.com>
Date: Mon Mar 22 16:09:30 2021
[GH] [FragmentStrictMode] Detect <fragment> tag usage
## Proposed Changes
- Detect `<fragment>` tag usage inside XML layouts
## Testing
Test: See `FragmentStrictModeTest#detectFragmentTagUsage`
## Issues Fixed
Fixes: 153738235
This is an imported pull request from
Resolves #141
Github-Pr-Head-Sha: 4ea052596e4341b9f11bcf335e2bc38045a91f19
GitOrigin-RevId: 62e7487aa4874eef6bb556490e193717cf937251
Change-Id: Iae48578e85e4e4897f806d7ade2e2a660adf9479
M fragment/fragment/api/public_plus_experimental_current.txt
M fragment/fragment/api/restricted_current.txt
M fragment/fragment/src/androidTest/java/androidx/fragment/app/strictmode/FragmentStrictModeTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentLayoutInflaterFactory.java
M fragment/fragment/src/main/java/androidx/fragment/app/strictmode/FragmentStrictMode.java
A fragment/fragment/src/main/java/androidx/fragment/app/strictmode/FragmentTagUsageViolation.java
il...@google.com <il...@google.com> #5
Thanks, I was able to reproduce the issue. As a workaround, you can add a @Keep
annotation to your Fragment.
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #6
Branch: androidx-master-dev
commit 80d12ddbb5e1d1b9d66b9a444370f78100b6cbda
Author: Ian Lake <ilake@google.com>
Date: Thu Jan 23 14:13:21 2020
Keep the Fragment default constructor if the class is kept
When using the add or replace methods that
take a Fragment Class, we should make sure that
the default constructor is kept.
Test: Ran sample app provided in the bug
BUG: 148181315
Change-Id: Iec72d20b5d7e4a9e703d10876a7ca1b50d83a6b8
M fragment/fragment/build.gradle
A fragment/fragment/proguard-rules.pro
il...@google.com <il...@google.com> #7
We've fixed this internally and it'll be available in a Fragment 1.2.1 release.
an...@google.com <an...@google.com> #8
[Deleted User] <[Deleted User]> #9
Just wanted to add that clicking on file
fragment/fragment/proguard-rules.pro
in the
You should remove those redirects when the tool post the patch details here. I would not expect that clicking (like I did) on a file-patch link as a chance to infect my PC with some malwares.
Thank you.
[Deleted User] <[Deleted User]> #10
This is a security problem. Every link on the page is not a direct link but a google search with redirect, in this particular case there is a registered scam domain with proguard-rules.pr0 (used 0 to prevent link instead of o)
an...@google.com <an...@google.com> #11
ap...@google.com <ap...@google.com> #12
Branch: androidx-master-dev
commit 41c9e54ce4ab51f95d19a55fa92a56b6bd018c62
Author: Ian Lake <ilake@google.com>
Date: Mon Mar 23 16:07:32 2020
Allow obfuscation of kept Fragments
Fragments that are kept solely by class
can safely be obfuscated.
By switching to keepclasseswithmembers,
only classes with a default constructor
will qualify to be kept. This also allows
shrinking of classes that are constructed
through a custom FragmentFactory.
Test: tested in sample app at
BUG: 151605338
Change-Id: I68ea8779bce80f33f27658cf87a94ccede5376b0
M fragment/fragment/proguard-rules.pro
Description
Version used: 1.2.0
Devices/Android versions reproduced on: N/A
Fragment constructor is removed once we use add/replace<MyFragment>(...).