Skip to content
This repository has been archived by the owner on Jun 4, 2018. It is now read-only.

Commit

Permalink
Added Touch ID Verification, changed colors to the passy colors.
Browse files Browse the repository at this point in the history
Added Loaders
  • Loading branch information
liz3 committed Sep 6, 2017
1 parent d611d4a commit 362f6c8
Show file tree
Hide file tree
Showing 15 changed files with 310 additions and 126 deletions.
12 changes: 7 additions & 5 deletions config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="de.liz3.passy" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget id="pw.passy.ionic" version="0.1.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Passy</name>
<description>The mobile App for the Passy Password Manager</description>
<author email="[email protected]" href="https://passy.pw">Passy Team</author>
Expand Down Expand Up @@ -79,11 +79,13 @@
</platform>
<engine name="android" spec="^6.2.3" />
<engine name="ios" spec="^4.4.0" />
<plugin name="cordova-plugin-console" spec="^1.0.5" />
<plugin name="cordova-plugin-device" spec="^1.1.4" />
<plugin name="cordova-plugin-console" spec="^1.0.7" />
<plugin name="cordova-plugin-device" spec="^1.1.6" />
<plugin name="cordova-plugin-http" spec="^1.2.0" />
<plugin name="cordova-plugin-splashscreen" spec="^4.0.3" />
<plugin name="cordova-plugin-statusbar" spec="^2.2.2" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.1" />
<plugin name="cordova-plugin-statusbar" spec="^2.2.3" />
<plugin name="cordova-plugin-touch-id" spec="^3.2.0" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.2" />
<plugin name="cordova-sqlite-storage" spec="^2.0.4" />
<plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
</widget>
5 changes: 4 additions & 1 deletion ionic.config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"name": "Passy",
"app_id": "",
"type": "ionic-angular"
"type": "ionic-angular",
"integrations": {
"cordova": {}
}
}
137 changes: 71 additions & 66 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,68 +1,73 @@
{
"name": "passy",
"version": "0.0.1",
"author": "Liz3",
"homepage": "https://passy.pw",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
"@angular/common": "4.1.2",
"@angular/compiler": "4.1.2",
"@angular/compiler-cli": "4.1.2",
"@angular/core": "4.1.2",
"@angular/forms": "4.1.2",
"@angular/http": "4.1.2",
"@angular/platform-browser": "4.1.2",
"@angular/platform-browser-dynamic": "4.1.2",
"@ionic-native/clipboard": "^3.12.1",
"@ionic-native/core": "3.10.2",
"@ionic-native/http": "^3.11.0",
"@ionic-native/splash-screen": "3.10.2",
"@ionic-native/status-bar": "3.10.2",
"@ionic/storage": "2.0.1",
"cordova-android": "^6.2.3",
"cordova-ios": "^4.4.0",
"cordova-plugin-compat": "^1.1.0",
"cordova-plugin-console": "^1.0.5",
"cordova-plugin-device": "^1.1.4",
"cordova-plugin-file": "^4.3.3",
"cordova-plugin-http": "^1.2.0",
"cordova-plugin-splashscreen": "^4.0.3",
"cordova-plugin-statusbar": "^2.2.2",
"cordova-plugin-whitelist": "^1.3.1",
"ionic-angular": "3.3.0",
"ionic-plugin-keyboard": "^2.2.1",
"ionicons": "3.0.0",
"rxjs": "5.1.1",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.11"
},
"devDependencies": {
"@ionic/app-scripts": "1.3.7",
"@ionic/cli-plugin-cordova": "1.3.0",
"@ionic/cli-plugin-ionic-angular": "1.3.0",
"typescript": "2.3.3"
},
"description": "The mobile App for the Passy Password Manager",
"cordova": {
"plugins": {
"cordova-plugin-http": {},
"cordova-plugin-console": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-whitelist": {},
"ionic-plugin-keyboard": {}
"name": "passy",
"version": "0.0.1",
"author": "Liz3",
"homepage": "https://passy.pw",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"platforms": [
"android",
"ios"
]
}
}
"dependencies": {
"@angular/common": "^4.1.2",
"@angular/compiler": "^4.1.2",
"@angular/compiler-cli": "^4.1.2",
"@angular/core": "^4.1.2",
"@angular/forms": "^4.1.2",
"@angular/http": "^4.1.2",
"@angular/platform-browser": "^4.1.2",
"@angular/platform-browser-dynamic": "^4.1.2",
"@ionic-native/clipboard": "^3.14.0",
"@ionic-native/core": "^3.10.2",
"@ionic-native/http": "^3.14.0",
"@ionic-native/splash-screen": "^3.10.2",
"@ionic-native/status-bar": "^3.10.2",
"@ionic-native/touch-id": "^4.2.1",
"@ionic/storage": "^2.0.1",
"cordova-android": "^6.2.3",
"cordova-ios": "^4.4.0",
"cordova-plugin-compat": "^1.1.0",
"cordova-plugin-console": "^1.0.7",
"cordova-plugin-device": "^1.1.6",
"cordova-plugin-file": "^4.3.3",
"cordova-plugin-http": "^1.2.0",
"cordova-plugin-splashscreen": "^4.0.3",
"cordova-plugin-statusbar": "^2.2.3",
"cordova-plugin-touch-id": "^3.2.0",
"cordova-plugin-whitelist": "^1.3.2",
"cordova-sqlite-storage": "^2.0.4",
"ionic-angular": "^3.3.0",
"ionic-plugin-keyboard": "^2.2.1",
"ionicons": "^3.0.0",
"rxjs": "^5.1.1",
"sw-toolbox": "^3.6.0",
"zone.js": "^0.8.11"
},
"devDependencies": {
"@ionic/app-scripts": "1.3.7",
"@ionic/cli-plugin-cordova": "1.3.0",
"@ionic/cli-plugin-ionic-angular": "1.3.0",
"typescript": "2.3.3"
},
"description": "The mobile App for the Passy Password Manager",
"cordova": {
"plugins": {
"cordova-plugin-http": {},
"cordova-plugin-console": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-whitelist": {},
"ionic-plugin-keyboard": {},
"cordova-plugin-touch-id": {},
"cordova-sqlite-storage": {}
},
"platforms": [
"android",
"ios"
]
}
}
64 changes: 53 additions & 11 deletions src/app/Passy.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,58 @@
import {Http, Headers, RequestOptions} from "@angular/http";
import {loginScreen, popAlert} from "../pages/tabs/tabs";

export var passwords = [];
export var archived = [];
export var loggedIn = false;

export class Passy {

accessToken;
public loggedIn = false;
private _baseURL = "https://dev.liz3.net/passy-api/index.php";
private _baseURL = "https://passy-api.herokuapp.com";
private _target = "https://app.passy.pw/action.php";
public isFingerPrint = false;
public timer;

constructor(target: string) {


let toMod = target;

if (target != null) {
if (toMod.indexOf("action.php") != -1) {
this._target = toMod;
} else {
if (toMod.endsWith("/")) {
this._target = toMod + "action.php";
} else {
this._target = toMod + "/action.php";
}
}
}

constructor() {


}

public logOut() {

passwords = [];
archived = [];
this.accessToken = "";
loginScreen();
clearInterval(this.timer);

}
private request(http: Http, vals, callback) {

let opt: RequestOptions
let myHeaders: Headers = new Headers
let opt: RequestOptions;
let myHeaders: Headers = new Headers;
myHeaders.set('Content-type', 'application/x-www-form-urlencoded');
opt = new RequestOptions({
headers: myHeaders
});

vals.push({name: "target", value: this._target});
http.post(this._baseURL, this.buildRequestString(vals), opt).subscribe(response => {
callback(response);
})
Expand Down Expand Up @@ -81,7 +111,7 @@ export class Passy {

}

public tryLogin(name: string, pass: string, http: Http, callBack) {
public tryLogin(name: string, pass: string, http: Http, callBack, loader) {

if (this.loggedIn) return;

Expand All @@ -102,22 +132,26 @@ export class Passy {
loggedIn = true;
callBack(true);

const timer = setInterval(function () {
me.request(http, [{name: "access_token", value: me.accessToken}, {name: "a", value: "status"}], function (response) {
me.timer = setInterval(function () {
me.request(http, [{name: "access_token", value: me.accessToken}, {
name: "a",
value: "status"
}], function (response) {

const json = JSON.parse(response.text());
if(!json.data.logged_in) {
if (!json.data.logged_in) {
passwords = [];
archived = [];
me.accessToken = "";
loginScreen()
clearInterval(timer);
loginScreen();
clearInterval(me.timer);
}

})

}, 2000);
} else {
loader.dismissAll();
popAlert("Failed", "Failed to login");
}

Expand Down Expand Up @@ -217,6 +251,7 @@ export class Passy {
const archive = [];
for (let i = 0; i != json.data.length; i++) {
const current = json.data[i];
current.vis = true;

if (current.archived) {
archive.push(current);
Expand Down Expand Up @@ -259,3 +294,10 @@ export class Password {
return this._username;
}
}

export let isCordovaAvailable = () => {
if (!(<any>window).cordova) {
return false;
}
return true;
};
9 changes: 6 additions & 3 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,19 @@ import { TabsPage } from '../pages/tabs/tabs';
import {Passy} from "./Passy";
export var passy = null;
import {HomePage} from "../pages/home/home";

export function stPassy(it) {
passy = it;
}
@Component({
templateUrl: 'app.html'
})
export class MyApp {
rootPage:any = TabsPage;
public passy = new Passy();

constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {

platform.ready().then(() => {
passy = this.passy;

// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
statusBar.styleDefault();
Expand Down
9 changes: 8 additions & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import {PassShow} from "../pages/pass-show/pass-show";
import {NewPassPage} from "../pages/new-password/new-pass";
import {EditPassPage} from "../pages/edit-password/edit-pass";
import {ArchivePage} from "../pages/archived/archive";
import {TouchID} from "@ionic-native/touch-id";
import {IonicStorageModule} from "@ionic/storage";


@NgModule({
declarations: [
Expand All @@ -29,6 +32,7 @@ import {ArchivePage} from "../pages/archived/archive";
],
imports: [
BrowserModule,
IonicStorageModule.forRoot(),
IonicModule.forRoot(MyApp),
HttpModule
],
Expand All @@ -47,7 +51,10 @@ import {ArchivePage} from "../pages/archived/archive";
providers: [
StatusBar,
SplashScreen,
{provide: ErrorHandler, useClass: IonicErrorHandler}
{provide: ErrorHandler, useClass: IonicErrorHandler},
TouchID


]
})
export class AppModule {
Expand Down
1 change: 1 addition & 0 deletions src/pages/edit-password/edit-pass.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
</ion-list>
<div padding>
<button ion-button (click)="save()">Save</button>
<button ion-button (click)="cancel()">Cancel</button>
</div>
</ion-content>
4 changes: 4 additions & 0 deletions src/pages/edit-password/edit-pass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ export class EditPassPage {
this.description = navParams.data.password.data.description;


}
cancel() {
this.viewCtrl.dismiss();

}
save() {

Expand Down
8 changes: 7 additions & 1 deletion src/pages/home/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
<ion-toolbar>
<ion-title>Passwords</ion-title>
<ion-buttons end>
<button (click)="logout()" ion-button icon-only color="royal">
<ion-icon name="log-out"></ion-icon>
</button>
<button (click)="addPass()" ion-button icon-only color="royal">
<ion-icon name="add"></ion-icon>
</button>
Expand All @@ -21,9 +24,12 @@
<p>{{current.description || "None"}}</p>
<br />
<ion-buttons start>
<button (click)="showPass(current.password_id, current)" ion-button icon-only>
<button *ngIf="current.vis" (click)="showPass(current.password_id, current)" ion-button icon-only>
<ion-icon name="eye"></ion-icon>
</button>
<button *ngIf="!current.vis" ion-button icon-only>
<ion-spinner item-start></ion-spinner>
</button>
<button (click)="more(current)" ion-button icon-only color="transparent">
<ion-icon name="add"></ion-icon>
</button>
Expand Down
Loading

0 comments on commit 362f6c8

Please sign in to comment.