Skip to content

Commit f92e8a5

Browse files
committed
feat: initial commit
0 parents  commit f92e8a5

File tree

79 files changed

+2054
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+2054
-0
lines changed

.gitignore

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/caches
5+
/.idea/libraries
6+
/.idea/modules.xml
7+
/.idea/workspace.xml
8+
/.idea/navEditor.xml
9+
/.idea/assetWizardSettings.xml
10+
.DS_Store
11+
/build
12+
/captures
13+
.externalNativeBuild
14+
.cxx
15+
local.properties
16+
17+
# Gradle files
18+
.gradle/
19+
build/
20+
21+
# Log/OS Files
22+
*.log
23+
24+
# Android Studio generated files and folders
25+
captures/
26+
.externalNativeBuild/
27+
.cxx/
28+
*.apk
29+
output.json
30+
31+
# IntelliJ
32+
.idea/
33+
misc.xml
34+
deploymentTargetDropDown.xml
35+
render.experimental.xml
36+
37+
# Keystore files
38+
*.jks
39+
*.keystore
40+
41+
# Google Services (e.g. APIs or Firebase)
42+
google-services.json
43+
44+
# Android Profiling
45+
*.hprof

README.md

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
## Advanced PassGen (Android)
2+
3+
![GitHub release (latest by date)](https://img.shields.io/github/v/release/CodeDead/advanced-passgen-android)
4+
![GitHub](https://img.shields.io/badge/language-Java-green)
5+
![GitHub](https://img.shields.io/github/license/CodeDead/advanced-passgen-android)
6+
7+
[<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png" alt="Get it on F-Droid" height="80">](https://f-droid.org/packages/com.codedead.advancedpassgen/)
8+
[<img src="https://play.google.com/intl/en_us/badges/images/generic/en-play-badge.png" alt="Get it on Google Play" height="80">](https://play.google.com/store/apps/details?id=com.codedead.advancedpassgen)
9+
10+
11+
This is a simple Android application that generates passwords based on the user's preferences.
12+
The user can choose the length of the password, the number of passwords to generate, and the characters to include in the password. The application also has a feature to copy the generated password to the clipboard.
13+
14+
### Features
15+
16+
- [x] Generate passwords based on user preferences
17+
- [x] Copy generated password to clipboard
18+
- [x] Dark mode support
19+
- [x] Material design
20+
- [x] Open-source
21+
- [x] Free
22+
- [x] No ads
23+
- [x] No unnecessary permissions
24+
- [x] No internet connection required
25+
- [x] No analytics
26+
- [x] No data collection
27+
- [x] No in-app purchases
28+
- [x] No subscriptions
29+
- [x] No premium features
30+
- [x] No hidden features
31+
32+
## About
33+
34+
This library is maintained by CodeDead. You can find more about us using the following links:
35+
* [Website](https://codedead.com)
36+
* [Bluesky](https://bsky.app/profile/codedead.com)
37+
* [Facebook](https://facebook.com/deadlinecodedead)
38+
39+
Copyright © 2025 CodeDead

app/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
plugins {
2+
alias(libs.plugins.android.application)
3+
}
4+
5+
android {
6+
namespace 'com.codedead.advancedpassgen'
7+
compileSdk 35
8+
9+
defaultConfig {
10+
applicationId "com.codedead.advancedpassgen"
11+
minSdk 29
12+
targetSdk 35
13+
versionCode 1
14+
versionName "1.0"
15+
16+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
17+
}
18+
19+
buildTypes {
20+
release {
21+
minifyEnabled true
22+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
23+
}
24+
}
25+
compileOptions {
26+
sourceCompatibility JavaVersion.VERSION_17
27+
targetCompatibility JavaVersion.VERSION_17
28+
}
29+
buildFeatures {
30+
viewBinding true
31+
}
32+
buildToolsVersion '36.0.0'
33+
}
34+
35+
dependencies {
36+
implementation libs.appcompat
37+
implementation libs.material
38+
implementation libs.constraintlayout
39+
implementation libs.lifecycle.livedata.ktx
40+
implementation libs.lifecycle.viewmodel.ktx
41+
implementation libs.navigation.fragment
42+
implementation libs.navigation.ui
43+
implementation libs.preference
44+
implementation libs.recyclerview
45+
testImplementation libs.junit
46+
androidTestImplementation libs.ext.junit
47+
androidTestImplementation libs.espresso.core
48+
}

app/proguard-rules.pro

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.codedead.advancedpassgen;
2+
3+
import android.content.Context;
4+
5+
import androidx.test.platform.app.InstrumentationRegistry;
6+
import androidx.test.ext.junit.runners.AndroidJUnit4;
7+
8+
import org.junit.Test;
9+
import org.junit.runner.RunWith;
10+
11+
import static org.junit.Assert.*;
12+
13+
/**
14+
* Instrumented test, which will execute on an Android device.
15+
*
16+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
17+
*/
18+
@RunWith(AndroidJUnit4.class)
19+
public class ExampleInstrumentedTest {
20+
@Test
21+
public void useAppContext() {
22+
// Context of the app under test.
23+
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24+
assertEquals("com.codedead.advancedpassgen", appContext.getPackageName());
25+
}
26+
}

app/src/main/AndroidManifest.xml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools">
4+
5+
<application
6+
android:allowBackup="true"
7+
android:dataExtractionRules="@xml/data_extraction_rules"
8+
android:fullBackupContent="@xml/backup_rules"
9+
android:icon="@mipmap/ic_launcher"
10+
android:label="@string/app_name"
11+
android:roundIcon="@mipmap/ic_launcher_round"
12+
android:supportsRtl="true"
13+
android:theme="@style/Theme.AdvancedPassGen"
14+
tools:targetApi="31">
15+
<activity
16+
android:name=".MainActivity"
17+
android:exported="true"
18+
android:theme="@style/Theme.AdvancedPassGen.NoActionBar">
19+
<intent-filter>
20+
<action android:name="android.intent.action.MAIN" />
21+
22+
<category android:name="android.intent.category.LAUNCHER" />
23+
</intent-filter>
24+
</activity>
25+
<activity
26+
android:name=".SettingsActivity"
27+
android:exported="false"
28+
android:label="@string/title_activity_settings" />
29+
</application>
30+
</manifest>
12.6 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
package com.codedead.advancedpassgen;
2+
3+
import android.content.Intent;
4+
import android.os.Bundle;
5+
import android.view.Menu;
6+
import android.view.MenuItem;
7+
import android.view.SubMenu;
8+
9+
import com.google.android.material.navigation.NavigationView;
10+
11+
import androidx.activity.EdgeToEdge;
12+
import androidx.annotation.NonNull;
13+
import androidx.navigation.NavController;
14+
import androidx.navigation.Navigation;
15+
import androidx.navigation.fragment.NavHostFragment;
16+
import androidx.navigation.ui.AppBarConfiguration;
17+
import androidx.navigation.ui.NavigationUI;
18+
import androidx.drawerlayout.widget.DrawerLayout;
19+
import androidx.appcompat.app.AppCompatActivity;
20+
21+
import com.codedead.advancedpassgen.databinding.ActivityMainBinding;
22+
23+
public class MainActivity extends AppCompatActivity {
24+
25+
private AppBarConfiguration mAppBarConfiguration;
26+
private ActivityMainBinding binding;
27+
private int flipperPosition = 0;
28+
29+
@Override
30+
protected void onCreate(Bundle savedInstanceState) {
31+
super.onCreate(savedInstanceState);
32+
EdgeToEdge.enable(this);
33+
34+
binding = ActivityMainBinding.inflate(getLayoutInflater());
35+
setContentView(binding.getRoot());
36+
37+
setSupportActionBar(binding.appBarMain.toolbar);
38+
39+
final DrawerLayout drawer = binding.drawerLayout;
40+
final NavigationView navigationView = binding.navView;
41+
// Passing each menu ID as a set of Ids because each
42+
// menu should be considered as top level destinations.
43+
mAppBarConfiguration = new AppBarConfiguration.Builder(
44+
R.id.nav_home, R.id.nav_info, R.id.nav_support)
45+
.setOpenableLayout(drawer)
46+
.build();
47+
48+
final NavHostFragment navHostFragment =
49+
(NavHostFragment) getSupportFragmentManager()
50+
.findFragmentById(R.id.nav_host_fragment_content_main);
51+
52+
assert navHostFragment != null;
53+
final NavController navController = navHostFragment.getNavController();
54+
55+
NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration);
56+
NavigationUI.setupWithNavController(navigationView, navController);
57+
58+
// Switch the selected item in the drawer
59+
setSelectedDrawerItem();
60+
61+
navigationView.setNavigationItemSelectedListener(item -> {
62+
final int id = item.getItemId();
63+
64+
if (id == R.id.nav_home) {
65+
flipperPosition = 0;
66+
navController.navigate(R.id.nav_home);
67+
} else if (id == R.id.nav_info) {
68+
flipperPosition = 1;
69+
navController.navigate(R.id.nav_info);
70+
} else if (id == R.id.nav_support) {
71+
flipperPosition = 2;
72+
navController.navigate(R.id.nav_support);
73+
}
74+
75+
drawer.closeDrawers();
76+
return true;
77+
});
78+
79+
navController.addOnDestinationChangedListener((controller, destination, arguments) -> {
80+
if (destination.getId() == R.id.nav_home) {
81+
flipperPosition = 0;
82+
setSelectedDrawerItem();
83+
} else if (destination.getId() == R.id.nav_info) {
84+
flipperPosition = 1;
85+
setSelectedDrawerItem();
86+
} else if (destination.getId() == R.id.nav_support) {
87+
flipperPosition = 2;
88+
setSelectedDrawerItem();
89+
}
90+
});
91+
}
92+
93+
/**
94+
* Set the selected item in the drawer
95+
*/
96+
private void setSelectedDrawerItem() {
97+
final SubMenu m0 = binding.navView.getMenu().getItem(0).getSubMenu();
98+
final SubMenu m1 = binding.navView.getMenu().getItem(1).getSubMenu();
99+
100+
assert m0 != null;
101+
assert m1 != null;
102+
103+
switch (flipperPosition) {
104+
case 0:
105+
binding.navView.setCheckedItem(m0.getItem(0).getItemId());
106+
break;
107+
case 1:
108+
binding.navView.setCheckedItem(m1.getItem(0).getItemId());
109+
break;
110+
case 2:
111+
binding.navView.setCheckedItem(m1.getItem(1).getItemId());
112+
break;
113+
114+
}
115+
}
116+
117+
@Override
118+
public boolean onCreateOptionsMenu(final Menu menu) {
119+
getMenuInflater().inflate(R.menu.main, menu);
120+
return true;
121+
}
122+
123+
@Override
124+
public boolean onOptionsItemSelected(@NonNull final MenuItem item) {
125+
if (item.getItemId() == R.id.action_settings) {
126+
final Intent i = new Intent(this, SettingsActivity.class);
127+
this.startActivity(i);
128+
129+
return true;
130+
}
131+
return super.onOptionsItemSelected(item);
132+
}
133+
134+
@Override
135+
public boolean onSupportNavigateUp() {
136+
final NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_content_main);
137+
return NavigationUI.navigateUp(navController, mAppBarConfiguration)
138+
|| super.onSupportNavigateUp();
139+
}
140+
}

0 commit comments

Comments
 (0)