Skip to content

Commit 56c1471

Browse files
committed
QuickPass 2.3.0
- Sorting -- By date and alphabet - Search by tags -- Tags under in password list are now clickable -- "2fa" included in search list - Fixes -- Reserve email fixed - Critical bug with password length fixed - Critical bug with app crushes fixed - Critical bug with "fantom" favorite fixed - Import/Export -- You can now choose location and filename - Removed all deprecated constructions - Resources optimizes
1 parent 342a10e commit 56c1471

File tree

4 files changed

+92
-35
lines changed

4 files changed

+92
-35
lines changed

app/src/main/java/com/mikhailgrigorev/quickpass/NewPasswordActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ class NewPasswordActivity : AppCompatActivity() {
420420
} else if (login2 != null) {
421421
if (login2.isEmpty() || login2.length < 2) {
422422
newName.error = getString(R.string.errNumOfText)
423-
} else if (genPasswordIdField.text.toString() == "" || genPasswordIdField.text.toString().length < 3) {
423+
} else if (genPasswordIdField.text.toString() == "" || genPasswordIdField.text.toString().length < 4) {
424424
genPasswordId.error = getString(R.string.errPass)
425425
} else {
426426
contentValues.put(pdbHelper.KEY_ID, Random.nextInt(0, 10000))

app/src/main/java/com/mikhailgrigorev/quickpass/PassGenActivity.kt

Lines changed: 58 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,22 @@ class PassGenActivity : AppCompatActivity() {
337337
}
338338
j++
339339

340-
if((pCursor.getString(groupIndex) != null) &&
341-
(pCursor.getString(groupIndex).contains("favorite"))) {
340+
var groupNone = false
341+
var groupFavorite = false
342+
if (pCursor.getString(groupIndex) == null)
343+
groupNone = true
344+
if (!groupNone)
345+
if (pCursor.getString(groupIndex) == "null")
346+
groupNone = true
347+
if (!groupNone)
348+
if (pCursor.getString(groupIndex) == "none")
349+
groupNone = true
350+
if(!groupNone){
351+
if(pCursor.getString(groupIndex).contains("favorite"))
352+
groupFavorite = true
353+
}
354+
355+
if(groupFavorite) {
342356
Log.d("favorite - ", pCursor.getString(groupIndex))
343357
dbLogin = pCursor.getString(nameIndex).toString()
344358
val fa = pCursor.getString(aIndex).toString()
@@ -2468,9 +2482,22 @@ class PassGenActivity : AppCompatActivity() {
24682482
"2"
24692483
}
24702484
j++
2471-
if((pCursor.getString(groupIndex) == null || pCursor.getString(groupIndex) == "none"|| pCursor.getString(
2472-
groupIndex
2473-
) == "null")and !(pCursor.getString(groupIndex).contains("favorite"))) {
2485+
var groupNone = false
2486+
var groupFavorite = false
2487+
if (pCursor.getString(groupIndex) == null)
2488+
groupNone = true
2489+
if (!groupNone)
2490+
if (pCursor.getString(groupIndex) == "null")
2491+
groupNone = true
2492+
if (!groupNone)
2493+
if (pCursor.getString(groupIndex) == "none")
2494+
groupNone = true
2495+
if(!groupNone){
2496+
if(pCursor.getString(groupIndex).contains("favorite"))
2497+
groupFavorite = true
2498+
}
2499+
2500+
if(!groupFavorite) {
24742501
val dbLogin = pCursor.getString(nameIndex).toString()
24752502
val fa = pCursor.getString(aIndex).toString()
24762503
passwords.add(Pair(dbLogin, fa))
@@ -2710,20 +2737,22 @@ class PassGenActivity : AppCompatActivity() {
27102737
"2"
27112738
}
27122739
j++
2713-
if((pCursor.getString(groupIndex) == null || pCursor.getString(groupIndex) == "none"|| pCursor.getString(
2714-
groupIndex
2715-
) == "null")and !(pCursor.getString(groupIndex).contains("favorite"))) {
2716-
val dbLogin = pCursor.getString(nameIndex).toString()
2717-
val fa = pCursor.getString(aIndex).toString()
2718-
passwords.add(Pair(dbLogin, fa))
2719-
quality.add(qualityNum)
2720-
val dbTag = pCursor.getString(tagsIndex).toString()
2721-
tags.add(dbTag)
2722-
group.add("none")
2723-
desc.add(dbdescIndex)
2724-
dates.add(pCursor.getString(timeIndex).toString())
2740+
var groupNone = false
2741+
var groupFavorite = false
2742+
if (pCursor.getString(groupIndex) == null)
2743+
groupNone = true
2744+
if (!groupNone)
2745+
if (pCursor.getString(groupIndex) == "null")
2746+
groupNone = true
2747+
if (!groupNone)
2748+
if (pCursor.getString(groupIndex) == "none")
2749+
groupNone = true
2750+
if(!groupNone){
2751+
if(pCursor.getString(groupIndex).contains("favorite"))
2752+
groupFavorite = true
27252753
}
2726-
else {
2754+
2755+
if(groupFavorite) {
27272756
val dbLogin = pCursor.getString(nameIndex).toString()
27282757
val fa = pCursor.getString(aIndex).toString()
27292758
passwords.add(0, Pair(dbLogin, fa))
@@ -2734,6 +2763,17 @@ class PassGenActivity : AppCompatActivity() {
27342763
desc.add(0, dbdescIndex)
27352764
dates.add(0, pCursor.getString(timeIndex).toString())
27362765
}
2766+
else {
2767+
val dbLogin = pCursor.getString(nameIndex).toString()
2768+
val fa = pCursor.getString(aIndex).toString()
2769+
passwords.add(Pair(dbLogin, fa))
2770+
quality.add(qualityNum)
2771+
val dbTag = pCursor.getString(tagsIndex).toString()
2772+
tags.add(dbTag)
2773+
group.add("none")
2774+
desc.add(dbdescIndex)
2775+
dates.add(pCursor.getString(timeIndex).toString())
2776+
}
27372777

27382778

27392779
when (qualityNum) {

app/src/main/java/com/mikhailgrigorev/quickpass/PasswordAdapter.kt

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,19 @@ class PasswordAdapter(
3232
return items.size
3333
}
3434

35+
override fun getItemViewType(position: Int): Int {
36+
return position
37+
}
38+
3539
// Inflates the item views
3640
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
37-
return ViewHolder(LayoutInflater.from(context).inflate(R.layout.pass_fragment, parent, false))
41+
return ViewHolder(
42+
LayoutInflater.from(context).inflate(
43+
R.layout.pass_fragment,
44+
parent,
45+
false
46+
)
47+
)
3848
}
3949

4050
// Binds each animal in the ArrayList to a view
@@ -114,12 +124,16 @@ class PasswordAdapter(
114124

115125
if(cardRadius != null)
116126
if(cardRadius != "none") {
117-
holder.clickableView.radius = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, cardRadius.toFloat(), metrics)
127+
holder.clickableView.radius = TypedValue.applyDimension(
128+
TypedValue.COMPLEX_UNIT_DIP,
129+
cardRadius.toFloat(),
130+
metrics
131+
)
118132
}
119133
}
120134
}
121135

122-
class ViewHolder (view: View) : RecyclerView.ViewHolder(view) {
136+
class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
123137
val passText = view.list_title!!
124138
val passDesc = view.list_desc!!
125139
val chip = view.chip!!

app/src/main/java/com/mikhailgrigorev/quickpass/PasswordManager.kt

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -127,19 +127,22 @@ class PasswordManager {
127127

128128
fun popularPin(passwordToTest: String) : Boolean {
129129
var popular = false
130-
131-
if(((abs(passwordToTest[0].toInt() - passwordToTest[1].toInt()) < 2 )
132-
and (abs(passwordToTest[1].toInt() - passwordToTest[2].toInt()) < 2))
133-
or
134-
((abs(passwordToTest[1].toInt() - passwordToTest[2].toInt()) < 2 )
135-
and (abs(passwordToTest[2].toInt() - passwordToTest [3].toInt()) < 2 ))
136-
or
137-
((abs(passwordToTest[0].toInt() - passwordToTest[3].toInt()) < 2 )
138-
and (abs(passwordToTest[2].toInt() - passwordToTest [3].toInt()) < 2 ))
139-
or
140-
((abs(passwordToTest[0].toInt() - passwordToTest[1].toInt()) < 2 )
141-
and (abs(passwordToTest[1].toInt() - passwordToTest [3].toInt()) < 2 )))
142-
popular = true
130+
if (passwordToTest.length == 4) {
131+
132+
if (((abs(passwordToTest[0].toInt() - passwordToTest[1].toInt()) < 2)
133+
and (abs(passwordToTest[1].toInt() - passwordToTest[2].toInt()) < 2))
134+
or
135+
((abs(passwordToTest[1].toInt() - passwordToTest[2].toInt()) < 2)
136+
and (abs(passwordToTest[2].toInt() - passwordToTest[3].toInt()) < 2))
137+
or
138+
((abs(passwordToTest[0].toInt() - passwordToTest[3].toInt()) < 2)
139+
and (abs(passwordToTest[2].toInt() - passwordToTest[3].toInt()) < 2))
140+
or
141+
((abs(passwordToTest[0].toInt() - passwordToTest[1].toInt()) < 2)
142+
and (abs(passwordToTest[1].toInt() - passwordToTest[3].toInt()) < 2))
143+
)
144+
popular = true
145+
}
143146

144147
return popular
145148
}

0 commit comments

Comments
 (0)