Skip to content

Commit

Permalink
Res-develop PswGenDroid from scratch
Browse files Browse the repository at this point in the history
  • Loading branch information
uwe authored and uwe committed Oct 26, 2018
1 parent fc3bb68 commit 9a033a3
Show file tree
Hide file tree
Showing 80 changed files with 878 additions and 2,954 deletions.
5 changes: 3 additions & 2 deletions PswGenDroid/.gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/caches/build_file_checksums.ser
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
.DS_Store
/build
/captures
.externalNativeBuild
/bin/
Binary file modified PswGenDroid/.idea/caches/build_file_checksums.ser
Binary file not shown.
6 changes: 6 additions & 0 deletions PswGenDroid/.idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion PswGenDroid/.idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 0 additions & 36 deletions PswGenDroid/.idea/inspectionProfiles/Project_Default.xml

This file was deleted.

40 changes: 16 additions & 24 deletions PswGenDroid/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 28
defaultConfig {
applicationId "de.dknapps.pswgendroid"
minSdkVersion 25
targetSdkVersion 27
targetSdkVersion 28
versionCode 20000
versionName "2.0.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
Expand All @@ -17,30 +21,18 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
// https://stackoverflow.com/a/37888400/2532583 looks like what I want but messes with en arrays.xml?!
// https://stackoverflow.com/a/32676398 is the bypass for not having all translations
lintOptions{
disable 'MissingTranslation'
}
// https://sites.google.com/a/android.com/tools/tech-docs/unit-testing-support#TOC-Method-...-not-mocked.-
testOptions {
unitTests.returnDefaultValues = true
}
defaultConfig {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

// Espresso
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.1.0'

// JUnit
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha2'
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
testImplementation 'junit:junit:4.12'

// ViewModel and LiveData
implementation "androidx.lifecycle:lifecycle-extensions:2.0.0"
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
// Enable Kotlin Extensions
apply plugin: 'kotlin-android-extensions'
implementation files('libs/PswGenCore.jar')
}
16 changes: 10 additions & 6 deletions PswGenDroid/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /opt/android-sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package de.dknapps.pswgendroid

import androidx.test.InstrumentationRegistry
import androidx.test.runner.AndroidJUnit4

import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getTargetContext()
assertEquals("de.dknapps.pswgendroid", appContext.packageName)
}
}
87 changes: 32 additions & 55 deletions PswGenDroid/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,69 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
PswGenDesktop - Manages your websites and repeatably generates passwords for them
PswGenDroid - Generates your passwords managed by PswGenDesktop on your mobile
Copyright (C) 2005-2018 Uwe Damken
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.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.dknapps.pswgendroid">

<!-- Benötigt zum Lesen der zu importierenden Dienste-Datei, z.B. von einer SD-Karte -->
<!-- Needed to read services files -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

<!-- Benötigt zum Löschen der importierten Dienste-Datei, z.B. von der SD-Karte -->
<!-- Needed to rename or write services files -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">

<activity
android:name="de.dknapps.pswgendroid.StartupActivity"
android:label="@string/title_startup" >
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">

<activity android:name=".ServiceMaintenanceActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.MAIN"/>

<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>

<activity
android:name="de.dknapps.pswgendroid.ServiceMaintenanceActivity"
android:label="@string/title_service_list"
android:parentActivityName="de.dknapps.pswgendroid.StartupActivity" >
<!-- Parent activity meta-data to support 4.0 and lower -->
<!-- <meta-data -->
<!-- android:name="android.support.PARENT_ACTIVITY" -->
<!-- android:value="de.dknapps.pswgendroid.StartupActivity" /> -->
</activity>

<activity
android:name="de.dknapps.pswgendroid.AboutActivity"
android:label="@string/title_activity_about"
android:parentActivityName="de.dknapps.pswgendroid.StartupActivity" >
<!-- Parent activity meta-data to support 4.0 and lower -->
<!-- <meta-data -->
<!-- android:name="android.support.PARENT_ACTIVITY" -->
<!-- android:value="de.dknapps.pswgendroid.StartupActivity" /> -->
</activity>

<!--
Manche Intents müssen im Code registiert werden, für PswGenDroid geschieht das
in StartupActivity#onCreate(), und zwar für die folgenden:
SCREEN_OFF
-->

<!-- Input Method Editor Service to provide a virtual keyboard -->
<service
android:name="de.dknapps.pswgendroid.PswGenInputMethodEditor"
android:label="@string/title_input_method_editor"
android:permission="android.permission.BIND_INPUT_METHOD">
<intent-filter>
<action android:name="android.view.InputMethod"/>
</intent-filter>
<meta-data
android:name="android.view.im"
android:resource="@xml/method"/>
</service>

</application>

</manifest>
</manifest>
Binary file removed PswGenDroid/app/src/main/assets/PswGen-64x64.png
Binary file not shown.
Loading

0 comments on commit 9a033a3

Please sign in to comment.