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

chore: remove manage all file permission #745

Merged
merged 6 commits into from
Jun 18, 2024

Conversation

anhappdev
Copy link
Collaborator

@anhappdev anhappdev commented Jul 4, 2023

@github-actions
Copy link

github-actions bot commented Jul 4, 2023

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

@anhappdev anhappdev marked this pull request as ready for review July 4, 2023 07:52
@anhappdev anhappdev requested a review from a team as a code owner July 4, 2023 07:52
@freedomtan
Copy link
Contributor

freedomtan commented Jul 11, 2023

this PR worked for MediaTek internal devices except imagenet accuracy. dunno why yet.

@anhappdev
Copy link
Collaborator Author

this PR worked for MediaTek internal devices except imagenet accuracy. dunno why yet.

Did you rename the file imagenet_val_full.txt to imagenet_val_full.txt.pseudo.png?

@freedomtan
Copy link
Contributor

this PR worked for MediaTek internal devices except imagenet accuracy. dunno why yet.

Did you rename the file imagenet_val_full.txt to imagenet_val_full.txt.pseudo.png?

surely I did. For mobiledet + coco, it ran well.

I tried it on my Pixel 7a, the app also crashed. See the attached logcat log mobilenet_crash.txt

@freedomtan
Copy link
Contributor

If I use only the first 1000 ILSVRC2012_val_000*.JPEG, it works

@anhappdev
Copy link
Collaborator Author

anhappdev commented Jul 18, 2023

Looking at the crash log, I guess maybe an image file is corrupted.

@freedomtan
Copy link
Contributor

Looking at the crash log, I guess maybe an image file is corrupted.

with binary search, it shows ILSVRC2012_val_00001644.JPEG is incompatible with Android Exif related functions.
I am not sure if it's corrupted. It displayed well on both Android (with File app) and macOS Preview.

07-18 09:27:20.497  3254  5045 W System.err: java.lang.NumberFormatException: For input string: "????"
07-18 09:27:20.498  3254  5045 W System.err:    at java.lang.Integer.parseInt(Integer.java:747)
07-18 09:27:20.498  3254  5045 W System.err:    at java.lang.Integer.parseInt(Integer.java:865)
07-18 09:27:20.498  3254  5045 W System.err:    at android.media.ExifInterface$ExifAttribute.getIntValue(ExifInterface.java:1010)
07-18 09:27:20.498  3254  5045 W System.err:    at android.media.ExifInterface.handleThumbnailFromJfif(ExifInterface.java:4328)
07-18 09:27:20.498  3254  5045 W System.err:    at android.media.ExifInterface.setThumbnailData(ExifInterface.java:4301)
07-18 09:27:20.498  3254  5045 W System.err:    at android.media.ExifInterface.loadAttributes(ExifInterface.java:2033)
07-18 09:27:20.498  3254  5045 W System.err:    at android.media.ExifInterface.<init>(ExifInterface.java:1568)
07-18 09:27:20.498  3254  5045 W System.err:    at com.android.providers.media.MediaProvider.getRedactionRanges(MediaProvider.java:9050)
07-18 09:27:20.498  3254  5045 W System.err:    at com.android.providers.media.MediaProvider.getRedactionRanges(MediaProvider.java:9023)
07-18 09:27:20.498  3254  5045 W System.err:    at com.android.providers.media.MediaProvider.getRedactionRangesForFuse(MediaProvider.java:9005)
07-18 09:27:20.498  3254  5045 W System.err:    at com.android.providers.media.MediaProvider.onFileOpenForFuse(MediaProvider.java:9260)

I stripped EXIF information from the ILSVRC2012_val_00001644.JPEG file with exiftool, https://exiftool.org

exiftool -EXIF=  ILSVRC2012_val_00001644.JPEG 

and push it back to Android, then it went well.

I am not sure if there are other problematic ones.

@freedomtan
Copy link
Contributor

freedomtan commented Jul 18, 2023

@freedomtan to try to remove EXIF information from all the jpeg files which have EXIF to if we can finish reading all the 50, 000 imagenet validation files. < --- this doesn't look elegant.

How MS office apps work on Android (do they use all file permission?) @freedomtan

@freedomtan
Copy link
Contributor

for a in *.JPEG
  do exiftool -EXIF=  $a
done

@freedomtan
Copy link
Contributor

@freedomtan to try to remove EXIF information from all the jpeg files which have EXIF to if we can finish reading all the 50, 000 imagenet validation files. < --- this doesn't look elegant.

How MS office apps work on Android (do they use all file permission?) @freedomtan

Confirmed that

  • if I remove all the EXIF in jpeg files, I can get expected accuracy number on my Pixel 7a
  • MS 365 apps DO need the "all file permission"

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@freedomtan
Copy link
Contributor

Let's try to see if we can get the apk accepted to Play Store with the "all file permission" option there. If that doesn't work, then we can to use this one.

@anhappdev anhappdev marked this pull request as draft July 25, 2023 05:13
@anhappdev anhappdev force-pushed the 702/remove-access-all-file-permission branch from b9e4e4b to 0a6e2b7 Compare May 28, 2024 08:02
@anhappdev anhappdev marked this pull request as ready for review May 28, 2024 11:30
@anhappdev
Copy link
Collaborator Author

The app is now accepted by Google for public testing at
https://play.google.com/store/apps/details?id=org.mlcommons.android.mlperfbench

@freedomtan
Copy link
Contributor

@anhappdev I didn't realize it's in "public testing" now. Could we back to "internal testing" because we don't have the EULA fixed and all the backends tested.

@anhappdev
Copy link
Collaborator Author

@anhappdev I didn't realize it's in "public testing" now. Could we back to "internal testing" because we don't have the EULA fixed and all the backends tested.

Ok. Done.

@mohitmundhragithub
Copy link
Contributor

I tried to run the app on my galaxy s23... but it crashes. Do we know of any known issues?

@anhappdev
Copy link
Collaborator Author

anhappdev commented Jun 6, 2024

I tried to run the app on my galaxy s23... but it crashes. Do we know of any known issues?

Can you test both the

  • build 136 (compileSdkVersion 34) and
  • build 134 (compileSdkVersion 33)
    The compileSdkVersion was changed from 33 to 34. Maybe that is the issue.

@freedomtan
Copy link
Contributor

@mohitmundhragithub to test build 136 and build 134

Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@mohitmundhragithub
Copy link
Contributor

Hi @anhappdev @freedomtan, I tried both build 134 and build 136 on my galaxy S23 ultra. Both of them are able to run the testcases just fine.

@anhappdev
Copy link
Collaborator Author

I tried to run the app on my galaxy s23... but it crashes. Do we know of any known issues?

@mohitmundhragithub Can you share the crash log?

@mohitmundhragithub
Copy link
Contributor

I tried to run the app on my galaxy s23... but it crashes. Do we know of any known issues?

@mohitmundhragithub Can you share the crash log?

Looks like the app is not available in playstore anymore.

@anhappdev
Copy link
Collaborator Author

anhappdev commented Jun 17, 2024

I tried to run the app on my galaxy s23... but it crashes. Do we know of any known issues?

@mohitmundhragithub Can you share the crash log?

Looks like the app is not available in playstore anymore.

@mohitmundhragithub Can you test the APK here in the CI?

@mohitmundhragithub
Copy link
Contributor

mohitmundhragithub commented Jun 17, 2024

I tried to run the app on my galaxy s23... but it crashes. Do we know of any known issues?

@mohitmundhragithub Can you share the crash log?

Looks like the app is not available in playstore anymore.

@mohitmundhragithub Can you test the APK here in the CI?

I tried this apk: https://github.com/mlcommons/mobile_app_open/actions/runs/9476794795/artifacts/1592456513

which i got from here (this PR's CI): https://github.com/mlcommons/mobile_app_open/actions/runs/9476794795/job/26110387649?pr=745

This also works fine.
Could play store put some restrictions which makes the app to fail?

@anhappdev
Copy link
Collaborator Author

Could play store put some restrictions which makes the app to fail?

I don’t know yet. But if the crash is not related to this PR. Let’s merge this, then we will have a new build in Play Store and we can test the Play Store build again.

@mohitmundhragithub
Copy link
Contributor

Could play store put some restrictions which makes the app to fail?

I don’t know yet. But if the crash is not related to this PR. Let’s merge this, then we will have a new build in Play Store and we can test the Play Store build again.

I am fine with it.
does it work for everyone else as well?

@anhappdev anhappdev merged commit 09e4b41 into master Jun 18, 2024
22 checks passed
@anhappdev anhappdev deleted the 702/remove-access-all-file-permission branch June 18, 2024 05:08
@github-actions github-actions bot locked and limited conversation to collaborators Jun 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check if we can get rid of manage all file permission
3 participants