Giter Site home page Giter Site logo

czlucius / code-scanner Goto Github PK

View Code? Open in Web Editor NEW
38.0 5.0 24.0 12.37 MB

An Android app to scan and generate codes(barcodes/QR codes)

License: GNU Affero General Public License v3.0

Java 90.93% HTML 9.07%
android qrcode-scanner qrcode-generator scanner java barcode barcode-scanner barcode-reader barcodes galaxy-store

code-scanner's Introduction

code-scanner

GitHub license GitHub release (latest by date) Lines of code Translation status
An Android app to scan and generate codes(barcodes/QR codes)
🌟Star/watch this repo!🌟

Get it on the Google Play Store, Galaxy Store, F-Droid or on GitHub Releases.

Play Store Galaxy Store
Get it on Google Play Available on Galaxy Store

Using this project

This project is stable for release.

Download it through these platforms (or share it with others):

The following platforms will not be updated:

If you'd like to be notified about updates through GitHub Releases, you can watch this repository(releases only) by clicking Watch -> Custom -> Releases and then saving your preferences.

You may also run this code on your machine by opening this project in Android Studio, and compiling it to your Android device. Do note that this project is protected by the GNU Affero General Public License, hence usage of this project would have to be compliant to the GNU AGPL.

Contributing

View CONTRIBUTING.md for more info.
This repo is participating in Hacktoberfest 2022, feel free to contribute!

Translations

Feel free to contribute/translate this project!
Translations are done on Weblate, translate the project here: https://hosted.weblate.org/engage/code-scanner/ Thanks!

License

This project is licensed with the GNU Affero General Public License. View the license file for more info.

Open-source dependencies

This app uses the following open-source libraries:

Notes

  1. Tag EXPM is used for experimental features.
    Use Ctrl+Shift+F to perform project-wide search in Android Studio.
  2. See foss branch for development for a build free of ML Kit, a proprietary Google library.
  3. Crash reporting is optional.
  4. For security vulnerabilities, send an email to [email protected] to arrange for encrypted communication before disclosing the vulnerability.

Please feel free to file an issue if you notice any bugs while using the app. Pull Requests for current issues are also welcome.

Thanks!

Hope you enjoy this app!

code-scanner's People

Contributors

atilluf avatar azhar241 avatar bardock88 avatar bokachsi avatar coding-young avatar comradekingu avatar creepen123 avatar czlucius avatar exbu avatar frankie-mceyes avatar hhugoac avatar kevinytttt2 avatar lalit-patel avatar pat0191 avatar poipoipoipoipoipoipoipoipoi avatar sal0max avatar samhy147 avatar tsaqibfs avatar weblate avatar zouhirdehbi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

code-scanner's Issues

Share and Save button appears when no code is created

The Share and Save buttons appear even when no code is created, after "OK" is pressed in the dialog

How to reproduce:

  • Open the app.
  • Go to "Create"
  • Press "Contents"
  • Press "OK" without entering anything

Expected result:

  • Share and Save buttons are hidden
    Actual result:
  • Share and Save buttons are still visible, and pressing them results in a crash

Fix:

  • Adding a simple isEmpty check in regenerateQRImage in CreateFragment solves the issue, as when "OK" is pressed, an empty(but non-null) QR is created.

Screenshot:
image

Re-integrate LeakCanary for debug versions

Is your feature request related to a problem? Please describe.

LeakCanary was disabled (library commented out) as the library was not adapted to target Android 12 (API 31) (to use android:exported value)

Describe the solution you'd like

Re-integrate the library as this issue is fixed.
square/leakcanary#2076

Describe alternatives you've considered

N/A

Additional context
Add any other context or screenshots about the feature request here.
Version > 2.7

[Crash]: RuntimeException after onboarding

Steps to reproduce

  1. Clear data
  2. Open the app in portrait
  3. In the onboarding, rotate the screen several times
  4. Rotate to landscape
  5. Complete the onboarding

Expected behaviour

App opens without issue

Actual behaviour

App crashes

Device name

Samsung Galaxy S20 FE 5G

Android version/API Level

Android 12

App version

Built from source

Device/crash logs

FATAL EXCEPTION: main
Process: com.czlucius.scan.debug, PID: 24287
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.czlucius.scan.debug/com.czlucius.scan.ui.MainActivity}: android.view.InflateException: Binary XML file line #26 in com.czlucius.scan.debug:layout/activity_main: Binary XML file line #26 in com.czlucius.scan.debug:layout/activity_main: Error inflating class fragment
	at [android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4037)](http://android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4037))
	at [android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4203)](http://android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4203))
	at [android.app.ActivityThread.handleRelaunchActivityInner(ActivityThread.java:6340)](http://android.app.ActivityThread.handleRelaunchActivityInner(ActivityThread.java:6340))
	at [android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:6205)](http://android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:6205))
	at [android.app.servertransaction.ActivityRelaunchItem.execute(ActivityRelaunchItem.java:71)](http://android.app.servertransaction.ActivityRelaunchItem.execute(ActivityRelaunchItem.java:71))
	at [android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)](http://android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45))
	at [android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)](http://android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135))
	at [android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)](http://android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95))
	at [android.app.ActivityThread$H.handleMessage(ActivityThread.java:2440)](http://android.app.ActivityThread$H.handleMessage(ActivityThread.java:2440))
	at [android.os.Handler.dispatchMessage(Handler.java:106)](http://android.os.Handler.dispatchMessage(Handler.java:106))
	at [android.os.Looper.loopOnce(Looper.java:226)](http://android.os.Looper.loopOnce(Looper.java:226))
	at [android.os.Looper.loop(Looper.java:313)](http://android.os.Looper.loop(Looper.java:313))
	at [android.app.ActivityThread.main(ActivityThread.java:8641)](http://android.app.ActivityThread.main(ActivityThread.java:8641))
	at java.lang.reflect.Method.invoke(Native Method)
	at [com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567)](http://com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567))
	at [com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1133)](http://com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1133))
Caused by: android.view.InflateException: Binary XML file line #26 in com.czlucius.scan.debug:layout/activity_main: Binary XML file line #26 in com.czlucius.scan.debug:layout/activity_main: Error inflating class fragment
Caused by: android.view.InflateException: Binary XML file line #26 in com.czlucius.scan.debug:layout/activity_main: Error inflating class fragment
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.view.View.getHeight()' on a null object reference
	at [com.czlucius.scan.ui.ScannerFragment.setMargins(ScannerFragment.java:421)](http://com.czlucius.scan.ui.ScannerFragment.setMargins(ScannerFragment.java:421))
	at [com.czlucius.scan.ui.ScannerFragment.permissionDeniedPermanently(ScannerFragment.java:415)](http://com.czlucius.scan.ui.ScannerFragment.permissionDeniedPermanently(ScannerFragment.java:415))
	at [com.czlucius.scan.ui.ScannerFragment.onRequestPermissionsResult(ScannerFragment.java:294)](http://com.czlucius.scan.ui.ScannerFragment.onRequestPermissionsResult(ScannerFragment.java:294))
	at [androidx.fragment.app.FragmentManager$11.onActivityResult(FragmentManager.java:2967)](http://androidx.fragment.app.FragmentManager$11.onActivityResult(FragmentManager.java:2967))
	at [androidx.fragment.app.FragmentManager$11.onActivityResult(FragmentManager.java:2939)](http://androidx.fragment.app.FragmentManager$11.onActivityResult(FragmentManager.java:2939))
	at [androidx.activity.result.ActivityResultRegistry.doDispatch(ActivityResultRegistry.java:392)](http://androidx.activity.result.ActivityResultRegistry.doDispatch(ActivityResultRegistry.java:392))
	at [androidx.activity.result.ActivityResultRegistry.dispatchResult(ActivityResultRegistry.java:351)](http://androidx.activity.result.ActivityResultRegistry.dispatchResult(ActivityResultRegistry.java:351))
	at [androidx.activity.ComponentActivity.onRequestPermissionsResult(ComponentActivity.java:667)](http://androidx.activity.ComponentActivity.onRequestPermissionsResult(ComponentActivity.java:667))
	at [androidx.fragment.app.FragmentActivity.onRequestPermissionsResult(FragmentActivity.java:636)](http://androidx.fragment.app.FragmentActivity.onRequestPermissionsResult(FragmentActivity.java:636))
	at [android.app.Activity.requestPermissions(Activity.java:5355)](http://android.app.Activity.requestPermissions(Activity.java:5355))
	at [androidx.core.app.ActivityCompat.requestPermissions(ActivityCompat.java:518)](http://androidx.core.app.ActivityCompat.requestPermissions(ActivityCompat.java:518))
	at [androidx.activity.ComponentActivity$2.onLaunch(ComponentActivity.java:189)](http://androidx.activity.ComponentActivity$2.onLaunch(ComponentActivity.java:189))
	at [androidx.activity.result.ActivityResultRegistry$3.launch(ActivityResultRegistry.java:226)](http://androidx.activity.result.ActivityResultRegistry$3.launch(ActivityResultRegistry.java:226))
	at [androidx.activity.result.ActivityResultLauncher.launch(ActivityResultLauncher.java:47)](http://androidx.activity.result.ActivityResultLauncher.launch(ActivityResultLauncher.java:47))
	at [androidx.fragment.app.FragmentManager.launchRequestPermissions(FragmentManager.java:3044)](http://androidx.fragment.app.FragmentManager.launchRequestPermissions(FragmentManager.java:3044))
	at [androidx.fragment.app.Fragment.requestPermissions(Fragment.java:1561)](http://androidx.fragment.app.Fragment.requestPermissions(Fragment.java:1561))
	at [com.czlucius.scan.ui.ScannerFragment.requestPm(ScannerFragment.java:380)](http://com.czlucius.scan.ui.ScannerFragment.requestPm(ScannerFragment.java:380))
	at [com.czlucius.scan.ui.ScannerFragment.onViewCreated(ScannerFragment.java:242)](http://com.czlucius.scan.ui.ScannerFragment.onViewCreated(ScannerFragment.java:242))
	at [androidx.fragment.app.Fragment.performViewCreated(Fragment.java:2987)](http://androidx.fragment.app.Fragment.performViewCreated(Fragment.java:2987))
	at [androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:546)](http://androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:546))
	at [androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:282)](http://androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:282))
	at [androidx.fragment.app.FragmentStore.moveToExpectedState(FragmentStore.java:112)](http://androidx.fragment.app.FragmentStore.moveToExpectedState(FragmentStore.java:112))
	at [androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1647)](http://androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1647))
	at [androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3128)](http://androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3128))
	at [androidx.fragment.app.FragmentManager.dispatchViewCreated(FragmentManager.java:3065)](http://androidx.fragment.app.FragmentManager.dispatchViewCreated(FragmentManager.java:3065))
	at [androidx.fragment.app.Fragment.performViewCreated(Fragment.java:2988)](http://androidx.fragment.app.Fragment.performViewCreated(Fragment.java:2988))
	at [androidx.fragment.app.FragmentStateManager.ensureInflatedView(FragmentStateManager.java:392)](http://androidx.fragment.app.FragmentStateManager.ensureInflatedView(FragmentStateManager.java:392))
	at [androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:281)](http://androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:281))
	at [androidx.fragment.app.FragmentLayoutInflaterFactory.onCreateView(FragmentLayoutInflaterFactory.java:140)](http://androidx.fragment.app.FragmentLayoutInflaterFactory.onCreateView(FragmentLayoutInflaterFactory.java:140))
	at [androidx.fragment.app.FragmentController.onCreateView(FragmentController.java:135)](http://androidx.fragment.app.FragmentController.onCreateView(FragmentController.java:135))
	at [androidx.fragment.app.FragmentActivity.dispatchFragmentsOnCreateView(FragmentActivity.java:319)](http://androidx.fragment.app.FragmentActivity.dispatchFragmentsOnCreateView(FragmentActivity.java:319))
	at [androidx.fragment.app.FragmentActivity.onCreateView(FragmentActivity.java:298)](http://androidx.fragment.app.FragmentActivity.onCreateView(FragmentActivity.java:298))
	at [android.view.LayoutInflater.tryCreateView(LayoutInflater.java:1073)](http://android.view.LayoutInflater.tryCreateView(LayoutInflater.java:1073))
	at [android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1001)](http://android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1001))
	at [android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:965)](http://android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:965))
	at [android.view.LayoutInflater.rInflate(LayoutInflater.java:1127)](http://android.view.LayoutInflater.rInflate(LayoutInflater.java:1127))
	at [android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1088)](http://android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1088))
	at [android.view.LayoutInflater.inflate(LayoutInflater.java:686)](http://android.view.LayoutInflater.inflate(LayoutInflater.java:686))
	at [android.view.LayoutInflater.inflate(LayoutInflater.java:538)](http://android.view.LayoutInflater.inflate(LayoutInflater.java:538))
	at [com.czlucius.scan.databinding.ActivityMainBinding.inflate(ActivityMainBinding.java:44)](http://com.czlucius.scan.databinding.ActivityMainBinding.inflate(ActivityMainBinding.java:44))
	at [com.czlucius.scan.databinding.ActivityMainBinding.inflate(ActivityMainBinding.java:38)](http://com.czlucius.scan.databinding.ActivityMainBinding.inflate(ActivityMainBinding.java:38))
	at [com.czlucius.scan.ui.MainActivity.onCreate(MainActivity.java:46)](http://com.czlucius.scan.ui.MainActivity.onCreate(MainActivity.java:46))
	at [android.app.Activity.performCreate(Activity.java:8282)](http://android.app.Activity.performCreate(Activity.java:8282))
	at [android.app.Activity.performCreate(Activity.java:8262)](http://android.app.Activity.performCreate(Activity.java:8262))
	at [android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1329)](http://android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1329))
	at [android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4011)](http://android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4011))
	at [android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4203)](http://android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4203))
	at [android.app.ActivityThread.handleRelaunchActivityInner(ActivityThread.java:6340)](http://android.app.ActivityThread.handleRelaunchActivityInner(ActivityThread.java:6340))
	at [android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:6205)](http://android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:6205))
	at [android.app.servertransaction.ActivityRelaunchItem.execute(ActivityRelaunchItem.java:71)](http://android.app.servertransaction.ActivityRelaunchItem.execute(ActivityRelaunchItem.java:71))
	at [android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)](http://android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45))
	at [android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)](http://android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135))
	at [android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)](http://android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95))
	at [android.app.ActivityThread$H.handleMessage(ActivityThread.java:2440)](http://android.app.ActivityThread$H.handleMessage(ActivityThread.java:2440))
	at [android.os.Handler.dispatchMessage(Handler.java:106)](http://android.os.Handler.dispatchMessage(Handler.java:106))
	at [android.os.Looper.loopOnce(Looper.java:226)](http://android.os.Looper.loopOnce(Looper.java:226))
	at [android.os.Looper.loop(Looper.java:313)](http://android.os.Looper.loop(Looper.java:313))
	at [android.app.ActivityThread.main(ActivityThread.java:8641)](http://android.app.ActivityThread.main(ActivityThread.java:8641))
	at java.lang.reflect.Method.invoke(Native Method)
	at [com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567)](http://com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567))
	at [com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1133)](http://com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1133))

Additional information

No response

Add contact action does not include phone number, URL, email

When a contact code is scanned, and "Add Contact" is pressed, the contact's phone number, URL, and emails are always blank. This is because intent.putParcelableArrayListExtra(DATA, dataList); as seen below, called after populating the intent to add a contact, for every data type (phone number, URL, email, address), resulting in overriding this data, hence only address gets filled up.

Fix:
use intent.putParcelableArrayListExtra(DATA, dataList); only at the last line.

intent.putParcelableArrayListExtra(DATA, dataList);
intent.putExtra(ContactsContract.Intents.Insert.COMPANY, contactInfo.getOrganization());
Email[] emailList = contactInfo.getEmails();
dataList = new ArrayList<>();
for (Email email : emailList) {
ContentValues row = new ContentValues();
row.put(ContactsContract.Data.MIMETYPE, ContactsContract.CommonDataKinds.Email.CONTENT_ITEM_TYPE);
row.put(ContactsContract.CommonDataKinds.Email.ADDRESS, email.getAddress());
row.put(ContactsContract.CommonDataKinds.Email.TYPE, Utils.convertEmailType(email.getType()));
dataList.add(row);
}
intent.putParcelableArrayListExtra(DATA, dataList);
String[] urlList = contactInfo.getUrls();
dataList = new ArrayList<>();
for (String url: urlList) {
ContentValues row = new ContentValues();
row.put(ContactsContract.Data.MIMETYPE, ContactsContract.CommonDataKinds.Website.CONTENT_ITEM_TYPE);
row.put(ContactsContract.CommonDataKinds.Website.URL, url);
dataList.add(row);
}
intent.putParcelableArrayListExtra(DATA, dataList);
Address[] addresses = contactInfo.getAddresses();
dataList = new ArrayList<>();
for (Address address: addresses) {
ContentValues row = new ContentValues();
row.put(ContactsContract.Data.MIMETYPE, ContactsContract.CommonDataKinds.StructuredPostal.CONTENT_ITEM_TYPE);
row.put(ContactsContract.CommonDataKinds.StructuredPostal.FORMATTED_ADDRESS, address.getStringRepresentation());
dataList.add(row);
}
intent.putParcelableArrayListExtra(DATA, dataList);

History not saved

Codes scanned are not saved in history.

How to reproduce:

  • Open the app.
  • Scan a code(barcode, qr code, etc.)
  • Navigate to History tab

Expected result:

  • History item added
    Actual result:
  • Code not added in history

URL without http(s) schema cannot be opened

Describe the bug
A URL code without the HTTP(S) schema (e.g. www.google.com) cannot be opened by Open URL chip.

To Reproduce
Steps to reproduce the behavior:

  1. Scan a QR code with a URL text without the HTTP(S) schema, e.g. www.google.com (QR code provided below)
  2. Click on the "Open URL" chip.

Expected behavior
Link opens in browser.

Actual behavior
"No browsers found." toast appears.

Screenshots
If applicable, add screenshots to help explain your problem.

Device information

  • Device: Samsung Galaxy S20 FE
  • OS: Android 11 (API 30)
  • App version: 1.7 beta (built from source)

Additional context
Add any other context about the problem here.

QR @ 3 Jan 2022 17_11_13.png
This is a sample code that will trigger the said bug.

[Bug]: ACRA with R8 shrinking causes app to crash

Steps to reproduce

  1. Build the app with release, so that r8 is on
  2. Open the app

Expected behaviour

App crashes.

Actual behaviour

App functions normally

Device name

Google Pixel 3

Android version/API Level

Android 9

App version

1.8 (alpha)

Device/crash logs

FATAL EXCEPTION: main
Process: com.czlucius.scan, PID: 20507
java.lang.RuntimeException: Unable to create application com.czlucius.scan.App: java.lang.NoSuchMethodException: [boolean, class java.lang.String, boolean, class java.lang.String, class java.lang.String, class java.lang.String, int, class e.e.c.f]
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5925)
at android.app.ActivityThread.access$1100(ActivityThread.java:200)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6718)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.NoSuchMethodException: [boolean, class java.lang.String, boolean, class java.lang.String, class java.lang.String, class java.lang.String, int, class e.e.c.f]
at java.lang.Class.getConstructor0(Class.java:2327)
at java.lang.Class.getConstructor(Class.java:1725)
at com.czlucius.scan.App.onCreate(App.java:72)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1154)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5920)
... 8 more

Additional information

https://stackoverflow.com/questions/25776116/android-acra-and-proguard

Backport app to lower Android versions

Is your feature request related to a problem? Please describe.

Current minimum Android version is about Android 6. Other users may have older versions and hence cannot use this app.

Describe the solution you'd like

Backport to lowest Android 4.4(support for Storage Access Framework) (and Google dropped support for 4.1 few months ago...)

Describe alternatives you've considered

N/A

Additional context
Add any other context or screenshots about the feature request here.

Distribution

This app needs to be distributed to platforms and app stores to increase its reach

Suggested app stores:

  • Samsung Galaxy Store
  • Aptoide(via Catappult)
  • Apkpure
  • Uptodown

Other app stores (requires decoupling of ML Kit):

  • Amazon App Store
  • Huawei AppGallery
  • F-Droid

Intent persists after screen rotate, relaunching fragment.

When an intent is shared with the app (images, text), the intent persists throughout the lifecycle of the app, hence relaunching the action on every screen rotate.

Video of the bug:

video_2021-06-09_13-07-14.mp4

This bug is caused by setIntent not properly clearing the intent, hence the activity uses the intent in the next launch.

The dark mode in the OnBoardingActivity does not show the dark colors

Steps to reproduce

  1. Open the app
  2. After open the first time, when the system is in dark mode enable, it shows
198999118-66b27475-09fa-4305-bfd0-c8dd106a1c39.mov

Expected behaviour

The behavior expected is to change into dark mode

Actual behaviour

The actual Behavior is showed in the video

Device name

Pixel 3a

Android version/API Level

Android 13

App version

1.9

Device/crash logs

No response

Additional information

No response

Edge-to-edge

Is your feature request related to a problem? Please describe.

Enable edge-to-edge to layout the app in full screen, so the bottom bar will blend in with the navigation bar/gesture bar

Describe the solution you'd like

Implement Edge to Edge
https://developer.android.com/training/gestures/edge-to-edge

Describe alternatives you've considered

N/A

Additional context
Add any other context or screenshots about the feature request here.

Creating contact crashes app

Steps to reproduce

  1. Open app
  2. Go to "Create"
  3. Create a contact

Expected behaviour

Contact QR Code is created

Actual behaviour

App crashes.

Device name

Samsung Galaxy S20 FE 5G

Android version/API Level

12

App version

1.85 (play)

Device/crash logs

FATAL EXCEPTION: main
Process: com.czlucius.scan, PID: 16791
java.lang.ExceptionInInitializerError
at d.a.a(Ezvcard.java:1)
at c.c.a.g.s.l.a.a(CreatedContact.java:39)
at c.c.a.g.o.a(QR.java:5)
at com.czlucius.scan.ui.CreateFragment.k1(CreateFragment.java:6)
at com.czlucius.scan.ui.CreateFragment.f1(CreateFragment.java:1)
at c.c.a.i.g.a(Unknown Source:4)
at androidx.lifecycle.LiveData.b(LiveData.java:6)
at androidx.lifecycle.LiveData.c(LiveData.java:8)
at b.q.t.j(MutableLiveData.java:4)
at c.c.a.i.t0.a(Unknown Source:4)
at c.c.a.g.o.b(QR.java:2)
at com.czlucius.scan.ui.CreateFragment.b1(CreateFragment.java:5)
at c.c.a.i.b.onClick(Unknown Source:4)
at androidx.appcompat.app.AlertController$c.handleMessage(AlertController.java:3)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8641)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1133)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.Reader.read(char[])' on a null object reference
at java.util.Properties$LineReader.readLine(Properties.java:434)
at java.util.Properties.load0(Properties.java:349)
at java.util.Properties.load(Properties.java:337)
at d.a.(Ezvcard.java:3)
... 21 more

Additional information

Should be because of Ezvcard minification
Urgent.

[Feature]: Add crash handling library

Is your feature request related to a problem? Please describe.

Crashes are not logged and the developer (me) does not know about them. Hence, unknown crashes may appear in the app which needs to be fixed.

Describe the solution you'd like

Use a crash handling library to upload crashes to the developer(me)

Describe alternatives you've considered

No alternatives available

Additional context
Add any other context or screenshots about the feature request here.
ACRA (https://github.com/ACRA/acra/)
Acrarium (https://github.com/F43nd1r/Acrarium)

[Bug]: Unusual icon in Dark Mode (splash screen)

Steps to reproduce

  1. Build from source
  2. Open the app on Android 12
  3. Turn on dark mode
  4. Observe the icon that appears on splash scren

Expected behaviour

Icon to conform to Code Scanner standard icon

Actual behaviour

Icon background is black

Device name

Samsung Galaxy S20 FE 5G

Android version/API Level

Android 12

App version

f63f9de

Device/crash logs

No response

Additional information

No response

Text in Bottom Sheet Dialog overflows when too long

How to reproduce:

  • Scan a QR Code that contains a lot of newlines

Expected result:

  • Text will be constrained between the info and action panels.

Actual result:

  • Text overflows into the BottomSheetDialog.

Screenshot:
Screenshot_20210809-165400_Code Scanner

Material You

Google released Material You earlier this year
Material You is an update of Material Design Components
To implement Material You, we need to ensure that

  • UI still looks coherent
  • No illegible parts of app
  • On Android 12, the app adapts to wallpaper color scheme.

Will ship by late Nov 2021.

F-Droid and FOSS

Refactoring of codebase to be compatible to F-Droid, to have a build flavor that does not have proprietary libraries.
See #2, #5.

Challenges

  • Detecting of data types(e.g. URL, E-mail) -> may create a library for that
    ZXing does not detect type of data, and returns it as a raw string. Code needs to be written to parse this data.
  • Type Integers
  • Generic classes so that general and foss can extend
  • Others

Code will be pushed to the foss branch soon

Wi-Fi suggestion: ask for permission

Is your feature request related to a problem? Please describe.

When adding Wi-Fi networks, for android 10+ permission needs to be granted. Currently its prompted at usage time once, but if user declines, they have to find their way through Settings and toggle it back on.
Settings.ACTION_WIFI_ADD_NETWORKS seems like the most likely intent to launch this prompt, but this is not very well documented.

Describe the solution you'd like

If denied, ask user again and redirect to perms screen.

Describe alternatives you've considered

N/A

Additional context

https://developer.android.com/guide/topics/connectivity/wifi-suggest#change-approval
https://developer.android.com/reference/android/provider/Settings#ACTION_WIFI_ADD_NETWORKS

Dark theme

Dark theme to be implemented.
Adapt app to use color palettes.
Variants of light theme colors need to be used, as the colors will be too bright for dark theme.
Colors in dark theme are desaturated, and background is #121212.

Decouple Google ML Kit from codebase

Code, ScanningWrapper, and many other classes have been coupled to Google's ML Kit in one way or another (using Barcode, or ML Kit's type constants).

One suggestion is to use a Translator to "translate" the data from an abstract source(zxing, Google/Huawei ML Kit, etc.) into a general format in Code (e.g. Code's constructor accepting Barcodes will be replaced by a Translator which helps to convert them into a Code.) to decouple Google ML Kit from the codebase.

Not discovering browsers on Android 11 when they are available.

On Android 11, due to a package query limitation, the app cannot scan for other apps(e.g. browsers) that can open the URL, when the browsers are indeed on the device.
This is due to <queries> declaration in AndroidManifest.xml not implemented properly, hence the app is not given permissions to scan for packages; intent.resolveActivity always returns null.

Steps to reproduce:

  1. Open the app
  2. Point the camera at a QR code/barcode which contains a web URL.
  3. Click the associated action, "Open link"

Expected behaviour:
App redirects to browser, or displays a chooser dialog if multiple browsers are available, or displays a toast "No browsers found" when no browsers to open the QR code are found.

Actual behaviour:
"No browsers found" displayed even when browsers are found. (see video attached)

Affected devices:
All devices running Android 11 (API 30) and above.

Possible solutions

  1. Remove the queries tag and add a try-catch block, catching ActivityNotFoundException, when no browsers are found.
  2. Properly implement the queries tag, so that app has the proper permissions to scan for browsers (or apps with intent filter Intent.ACTION_VIEW)
1_Code.Scanner_20210525_.mp4

[Feature]: Add share button to bottom sheet

Is your feature request related to a problem? Please describe.

Users cannot share the scanned text and have to copy and paste in their desired app

Describe the solution you'd like

Add a share chip to the action bar on the bottom sheet dialog.

Describe alternatives you've considered

Copy and paste the text scanned.

Additional context

[Bug]: Android CI keeps on failing

Steps to reproduce

  1. Push to the repo/trigger Android CI

Expected behaviour

The build should pass

Actual behaviour

The build fails with errors e.g. cannot find symbol

Device name

N/A

Android version/API Level

N/A

App version

1.7

Device/crash logs

Will add in later comment if needed

Additional information

No response

Localisation

Is your feature request related to a problem? Please describe.

Users from other countries where English is not the native language may prefer the app in their native language

Describe the solution you'd like

Localise the app to other languages (e.g. Chinese, German)

Describe alternatives you've considered

N/A

Additional context
Add any other context or screenshots about the feature request here.
values/strings.xml

Write shared QR images into cache instead of storage

QR photos are persisted to user storage when sharing. This uses storage, and is not ideal on devices with low storage.
Screenshot_20211205-165227_Files.jpg

Fix: write to cache dir instead of files directory, this will use user storage.
(.ui.CreateFragment)

Currently, the images are stored in
(Internal Storage)/Android/data/com.czlucius.scan/Pictures. You may clear this directory if you wish. (On Android 11+, only the native Storage Access Framework can access it)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.