Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
com.ccwangluo.accelerator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sheteng
com.ccwangluo.accelerator
Commits
8335a580
Commit
8335a580
authored
Dec 26, 2018
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Take user to fallback QR code scanner if Google's scanner is not operational
Fixes #1970, #2032.
parent
3f14c9c8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
.github/faq.md
.github/faq.md
+0
-6
mobile/src/main/java/com/github/shadowsocks/ScannerActivity.kt
...e/src/main/java/com/github/shadowsocks/ScannerActivity.kt
+8
-2
No files found.
.github/faq.md
View file @
8335a580
...
@@ -56,12 +56,6 @@ More details: https://kb.adguard.com/en/android/solving-problems/battery
...
@@ -56,12 +56,6 @@ More details: https://kb.adguard.com/en/android/solving-problems/battery
Allow this app to consume background data in app settings.
Allow this app to consume background data in app settings.
### Why Camera permission is required on devices below Android 6.0?
To scan the QR code through the integrated QR scanner.
By the way, upgrade your Android system already.
### How to use Transproxy mode?
### How to use Transproxy mode?
1.
Install
[
AFWall+
](
https://github.com/ukanth/afwall
)
;
1.
Install
[
AFWall+
](
https://github.com/ukanth/afwall
)
;
...
...
mobile/src/main/java/com/github/shadowsocks/ScannerActivity.kt
View file @
8335a580
...
@@ -25,6 +25,7 @@ import android.content.Intent
...
@@ -25,6 +25,7 @@ import android.content.Intent
import
android.content.pm.ShortcutManager
import
android.content.pm.ShortcutManager
import
android.hardware.camera2.CameraAccessException
import
android.hardware.camera2.CameraAccessException
import
android.hardware.camera2.CameraManager
import
android.hardware.camera2.CameraManager
import
android.net.Uri
import
android.os.Build
import
android.os.Build
import
android.os.Bundle
import
android.os.Bundle
import
android.util.Log
import
android.util.Log
...
@@ -59,6 +60,11 @@ class ScannerActivity : AppCompatActivity(), BarcodeRetriever {
...
@@ -59,6 +60,11 @@ class ScannerActivity : AppCompatActivity(), BarcodeRetriever {
private
lateinit
var
detector
:
BarcodeDetector
private
lateinit
var
detector
:
BarcodeDetector
private
fun
fallback
()
{
startActivity
(
Intent
(
Intent
.
ACTION_VIEW
,
Uri
.
parse
(
"market://details?id=tw.com.quickmark"
)))
finish
()
}
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
super
.
onCreate
(
savedInstanceState
)
detector
=
BarcodeDetector
.
Builder
(
this
)
detector
=
BarcodeDetector
.
Builder
(
this
)
...
@@ -71,9 +77,9 @@ class ScannerActivity : AppCompatActivity(), BarcodeRetriever {
...
@@ -71,9 +77,9 @@ class ScannerActivity : AppCompatActivity(), BarcodeRetriever {
if
(
dialog
==
null
)
{
if
(
dialog
==
null
)
{
Toast
.
makeText
(
this
,
R
.
string
.
common_google_play_services_notification_ticker
,
Toast
.
LENGTH_SHORT
)
Toast
.
makeText
(
this
,
R
.
string
.
common_google_play_services_notification_ticker
,
Toast
.
LENGTH_SHORT
)
.
show
()
.
show
()
f
inish
()
f
allback
()
}
else
{
}
else
{
dialog
.
setOnDismissListener
{
f
inish
()
}
dialog
.
setOnDismissListener
{
f
allback
()
}
dialog
.
show
()
dialog
.
show
()
}
}
return
return
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment