Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xabber-android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
xabber-android
Commits
5581d92e
Commit
5581d92e
authored
Jun 26, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
android-integration library included in gradle and removed from source. FingerprintViewer updated.
parent
747224c4
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
592 deletions
+11
-592
LICENSE
LICENSE
+0
-4
build.gradle
app/build.gradle
+1
-0
IntentIntegrator.java
...om/google/zxing/integration/android/IntentIntegrator.java
+0
-417
IntentResult.java
...va/com/google/zxing/integration/android/IntentResult.java
+0
-95
FingerprintViewer.java
...rc/main/java/com/xabber/android/ui/FingerprintViewer.java
+10
-74
fingerprint_viewer.xml
app/src/main/res/values/fingerprint_viewer.xml
+0
-2
No files found.
LICENSE
View file @
5581d92e
...
...
@@ -72,10 +72,6 @@ app/src/main/res/layout/preference.xml
Also source code of following components is included in repository (see the source code or official sites for license details):
ZXing
app/src/main/java/com/google/zxing/*
Apache License, Version 2.0 (the "License").
Novel sasl client
app/src/main/java/com/novell/sasl/*
The OpenLDAP Public License.
...
...
app/build.gradle
View file @
5581d92e
...
...
@@ -49,5 +49,6 @@ dependencies {
compile
'com.melnykov:floatingactionbutton:1.2.0'
compile
'dnsjava:dnsjava:2.1.7'
compile
'com.github.bumptech.glide:glide:3.6.0'
compile
'com.google.zxing:android-integration:3.1.0'
compile
project
(
'otr4j'
)
}
app/src/main/java/com/google/zxing/integration/android/IntentIntegrator.java
deleted
100644 → 0
View file @
747224c4
This diff is collapsed.
Click to expand it.
app/src/main/java/com/google/zxing/integration/android/IntentResult.java
deleted
100644 → 0
View file @
747224c4
/*
* Copyright 2009 ZXing authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
zxing
.
integration
.
android
;
/**
* <p>Encapsulates the result of a barcode scan invoked through {@link IntentIntegrator}.</p>
*
* @author Sean Owen
*/
public
final
class
IntentResult
{
private
final
String
contents
;
private
final
String
formatName
;
private
final
byte
[]
rawBytes
;
private
final
Integer
orientation
;
private
final
String
errorCorrectionLevel
;
IntentResult
()
{
this
(
null
,
null
,
null
,
null
,
null
);
}
IntentResult
(
String
contents
,
String
formatName
,
byte
[]
rawBytes
,
Integer
orientation
,
String
errorCorrectionLevel
)
{
this
.
contents
=
contents
;
this
.
formatName
=
formatName
;
this
.
rawBytes
=
rawBytes
;
this
.
orientation
=
orientation
;
this
.
errorCorrectionLevel
=
errorCorrectionLevel
;
}
/**
* @return raw content of barcode
*/
public
String
getContents
()
{
return
contents
;
}
/**
* @return name of format, like "QR_CODE", "UPC_A". See {@code BarcodeFormat} for more format names.
*/
public
String
getFormatName
()
{
return
formatName
;
}
/**
* @return raw bytes of the barcode content, if applicable, or null otherwise
*/
public
byte
[]
getRawBytes
()
{
return
rawBytes
;
}
/**
* @return rotation of the image, in degrees, which resulted in a successful scan. May be null.
*/
public
Integer
getOrientation
()
{
return
orientation
;
}
/**
* @return name of the error correction level used in the barcode, if applicable
*/
public
String
getErrorCorrectionLevel
()
{
return
errorCorrectionLevel
;
}
@Override
public
String
toString
()
{
StringBuilder
dialogText
=
new
StringBuilder
(
100
);
dialogText
.
append
(
"Format: "
).
append
(
formatName
).
append
(
'\n'
);
dialogText
.
append
(
"Contents: "
).
append
(
contents
).
append
(
'\n'
);
int
rawBytesLength
=
rawBytes
==
null
?
0
:
rawBytes
.
length
;
dialogText
.
append
(
"Raw bytes: ("
).
append
(
rawBytesLength
).
append
(
" bytes)\n"
);
dialogText
.
append
(
"Orientation: "
).
append
(
orientation
).
append
(
'\n'
);
dialogText
.
append
(
"EC level: "
).
append
(
errorCorrectionLevel
).
append
(
'\n'
);
return
dialogText
.
toString
();
}
}
app/src/main/java/com/xabber/android/ui/FingerprintViewer.java
View file @
5581d92e
...
...
@@ -15,11 +15,8 @@
package
com
.
xabber
.
android
.
ui
;
import
android.app.AlertDialog
;
import
android.app.Dialog
;
import
android.content.ActivityNotFoundException
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.net.Uri
;
import
android.os.Bundle
;
import
android.support.v7.widget.Toolbar
;
import
android.text.ClipboardManager
;
...
...
@@ -44,11 +41,6 @@ import com.xabber.android.data.intent.EntityIntentBuilder;
import
com.xabber.android.data.roster.AbstractContact
;
import
com.xabber.android.data.roster.OnContactChangedListener
;
import
com.xabber.android.data.roster.RosterManager
;
import
com.xabber.android.ui.dialog.ConfirmDialogBuilder
;
import
com.xabber.android.ui.dialog.ConfirmDialogListener
;
import
com.xabber.android.ui.dialog.DialogBuilder
;
import
com.xabber.android.ui.dialog.NotificationDialogBuilder
;
import
com.xabber.android.ui.dialog.NotificationDialogListener
;
import
com.xabber.android.ui.helper.ContactTitleActionBarInflater
;
import
com.xabber.android.ui.helper.ManagedActivity
;
import
com.xabber.xmpp.address.Jid
;
...
...
@@ -57,8 +49,7 @@ import java.util.Collection;
public
class
FingerprintViewer
extends
ManagedActivity
implements
OnCheckedChangeListener
,
OnAccountChangedListener
,
OnContactChangedListener
,
OnClickListener
,
ConfirmDialogListener
,
NotificationDialogListener
{
OnContactChangedListener
,
OnClickListener
{
private
static
final
String
SAVED_REMOTE_FINGERPRINT
=
"com.xabber.android.ui.FingerprintViewer.SAVED_REMOTE_FINGERPRINT"
;
private
static
final
String
SAVED_LOCAL_FINGERPRINT
=
"com.xabber.android.ui.FingerprintViewer.SAVED_LOCAL_FINGERPRINT"
;
...
...
@@ -170,11 +161,15 @@ public class FingerprintViewer extends ManagedActivity implements
String
code
=
scanResult
.
getContents
();
boolean
equals
=
code
!=
null
&&
code
.
equals
(
remoteFingerprint
);
verifiedView
.
setChecked
(
equals
);
int
dialogMessageId
;
if
(
equals
)
{
showDialog
(
R
.
string
.
action_otr_smp_verified
)
;
dialogMessageId
=
R
.
string
.
action_otr_smp_verified
;
}
else
{
showDialog
(
R
.
string
.
action_otr_smp_unverified
)
;
dialogMessageId
=
R
.
string
.
action_otr_smp_unverified
;
}
new
AlertDialog
.
Builder
(
this
).
setMessage
(
dialogMessageId
)
.
setNeutralButton
(
android
.
R
.
string
.
ok
,
null
).
show
();
}
}
...
...
@@ -209,27 +204,14 @@ public class FingerprintViewer extends ManagedActivity implements
}
}
/**
* Show native dialog instead of provided by ZXing.
*
* @param alertDialog
*/
private
void
wrapInstallDialog
(
AlertDialog
alertDialog
)
{
if
(
alertDialog
==
null
)
{
return
;
}
alertDialog
.
dismiss
();
showDialog
(
R
.
string
.
zxing_install_message
);
}
@Override
@Override
public
void
onClick
(
View
view
)
{
switch
(
view
.
getId
())
{
case
R
.
id
.
scan
:
wrapInstallDialog
(
integrator
.
initiateScan
(
IntentIntegrator
.
QR_CODE_TYPES
)
);
integrator
.
initiateScan
(
IntentIntegrator
.
QR_CODE_TYPES
);
break
;
case
R
.
id
.
show
:
wrapInstallDialog
(
integrator
.
shareText
(
localFingerprint
)
);
integrator
.
shareText
(
localFingerprint
);
break
;
case
R
.
id
.
copy
:
((
ClipboardManager
)
getSystemService
(
CLIPBOARD_SERVICE
))
...
...
@@ -240,52 +222,6 @@ public class FingerprintViewer extends ManagedActivity implements
}
}
@Override
protected
Dialog
onCreateDialog
(
int
id
)
{
switch
(
id
)
{
case
R
.
string
.
zxing_install_message
:
return
new
ConfirmDialogBuilder
(
this
,
id
,
this
)
.
setMessage
(
R
.
string
.
zxing_install_message
).
create
();
case
R
.
string
.
zxing_install_fail
:
return
new
NotificationDialogBuilder
(
this
,
id
,
this
)
.
setMessage
(
R
.
string
.
zxing_install_fail
).
create
();
case
R
.
string
.
action_otr_smp_verified
:
return
new
NotificationDialogBuilder
(
this
,
id
,
this
)
.
setMessage
(
R
.
string
.
action_otr_smp_verified
).
create
();
case
R
.
string
.
action_otr_smp_unverified
:
return
new
NotificationDialogBuilder
(
this
,
id
,
this
)
.
setMessage
(
R
.
string
.
action_otr_smp_unverified
).
create
();
default
:
return
super
.
onCreateDialog
(
id
);
}
}
@Override
public
void
onAccept
(
DialogBuilder
dialogBuilder
)
{
switch
(
dialogBuilder
.
getDialogId
())
{
case
R
.
string
.
zxing_install_message
:
Uri
uri
=
Uri
.
parse
(
"market://details?id="
+
IntentIntegrator
.
BS_PACKAGE
);
Intent
intent
=
new
Intent
(
Intent
.
ACTION_VIEW
,
uri
);
try
{
startActivity
(
intent
);
}
catch
(
ActivityNotFoundException
anfe
)
{
showDialog
(
R
.
string
.
zxing_install_fail
);
break
;
}
break
;
default
:
break
;
}
}
@Override
public
void
onDecline
(
DialogBuilder
dialogBuilder
)
{
}
@Override
public
void
onCancel
(
DialogBuilder
dialogBuilder
)
{
}
private
void
update
()
{
isUpdating
=
true
;
AbstractContact
abstractContact
=
RosterManager
.
getInstance
().
getBestContact
(
account
,
user
);
...
...
app/src/main/res/values/fingerprint_viewer.xml
View file @
5581d92e
...
...
@@ -6,7 +6,5 @@
<string
name=
"otr_remote_fingerprint"
>
Your opponent\'s fingerprint:
</string>
<string
name=
"otr_scan_fingerprint"
>
Scan QR code with opponent\'s fingerprint
</string>
<string
name=
"otr_show_fingerprint"
>
Show QR code with your fingerprint
</string>
<string
name=
"zxing_install_fail"
>
There is no Google Play installed. Please install Barcode Scanner manually.
</string>
<string
name=
"zxing_install_message"
>
This application requires Barcode Scanner. Would you like to install it?
</string>
<string
name=
"otr_copy_fingerprint"
>
Copy your fingerprint to clipboard
</string>
</resources>
\ No newline at end of file
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