Browse Source

Code clearing and updating apk in app/src/hybrid-osn-encryption.apk

rohit.gowda 4 years ago
parent
commit
3fce74fc00

BIN
app/apk/app-debug.apk → app/apk/hybrid-osn-encryption.apk


+ 6 - 6
app/package-lock.json

@@ -4656,9 +4656,9 @@
       }
     },
     "node-version-compare": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/node-version-compare/-/node-version-compare-1.0.1.tgz",
-      "integrity": "sha1-2Fv9IPCsreM1d/VmgscQnDTFUM0="
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/node-version-compare/-/node-version-compare-1.0.2.tgz",
+      "integrity": "sha512-OVcHSPS3nROlBQXcALptOR0j2lOabC9wE2S+y+Fvr7nSDqoO/LCNzRdVGVovipeHUXs5jAqq7GelWE1X4J1sEw=="
     },
     "node-webcrypto-ossl": {
       "version": "1.0.42",
@@ -13787,9 +13787,9 @@
       "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0="
     },
     "xmldom": {
-      "version": "0.1.27",
-      "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.27.tgz",
-      "integrity": "sha1-1QH5ezvbQDr4757MIFcxh6rawOk="
+      "version": "0.1.31",
+      "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.31.tgz",
+      "integrity": "sha512-yS2uJflVQs6n+CyjHoaBmVSqIDevTAWrzMmjG1Gc7h1qQ7uVozNhEPJAwZXWyGQ/Gafo3fCwrcaokezLPupVyQ=="
     },
     "xmlhttprequest": {
       "version": "1.8.0",

+ 0 - 1
app/src/pages/home/home.ts

@@ -49,7 +49,6 @@ export class HomePage {
       .then(tweets => {
           this.tweets=[];
           Object.assign(this.tweets, tweets);
-          console.log("HOME tweets are: ", tweets);
          })
       .catch(err => {
         console.error("err is:", err);

+ 0 - 1
app/src/pages/settings/settings.ts

@@ -108,7 +108,6 @@ export class SettingsPage {
   }
 
   async publishPrivateKey() {
-    console.log("publishing pvt key");
     await this.cryptoUtils.publishPrivateKey(this.privateKey);
   }
 

+ 0 - 9
app/src/pages/write-tweet/write-tweet.ts

@@ -63,7 +63,6 @@ export class WriteTweetPage {
     });
 
     this.addValidators();
-    // this.testPvtKeySaveFlow();
    }
 
    private async testPvtKeySaveFlow(){
@@ -71,18 +70,11 @@ export class WriteTweetPage {
     let a = await this.storage.get("privateKey");
     const privKeyObj = (await openpgp.key.readArmored(a)).keys[0];
 
-    //publish pvt key 
-    // await this.cryptoUtils.publishPrivateKey(privKeyObj);
-
     //retireve private key from Gun
     let user = await  this.storage.get("userId");
     let pvtKey = await this.gun.getPvtKeyHistory(user);
-    console.log("pvr key received is:",pvtKey.key);
     //fetch data from ipfs link
     let keyHistory = await this.ipfs.fetchJson(pvtKey.key);
-    console.log("Key history is:",keyHistory);
-    //decrypt the pvt key with passphrase
-    // await privKeyObj.decrypt(this.passphrase);
 
    }
 
@@ -189,7 +181,6 @@ export class WriteTweetPage {
   private async tweetPrivate() {
     const tweet = await this.buildPrivateTweet();
     const privateKey = await this.storage.get("privateKey");
-    //fetch followers and their public keys
     //encrypting for self
     let email = await this.storage.get("email");
     await this.opnpgp.lookupKeys(email);

+ 0 - 1
app/src/providers/auth/auth.ts

@@ -27,7 +27,6 @@ export class AuthProvider {
     this.authProvider.setCustomParameters({
       lang: "de"
     });
-    console.log('this.authProvider',this.authProvider);
 
   }
 

+ 0 - 6
app/src/providers/crypto/crypto.ts

@@ -29,7 +29,6 @@ export class CryptoProvider {
    */
 
   public async publishPrivateKey(key: string) {
-    // console.log("this.ownuserid:", this.ownUserId,"key",key);
     let privateKeyHistory = await this.getKeyHistory(this.ownUserId);
     // Todo: avoid publishing the same public key twice - check if new key equals newest key in history
     if ( privateKeyHistory && (key === privateKeyHistory.keys[0].key)) return;
@@ -48,7 +47,6 @@ export class CryptoProvider {
             keys: [newKey]
           };
         }
-          // console.log("new pvtkeyhstry :",privateKeyHistory)
     }
 
     if(privateKeyHistory){
@@ -59,7 +57,6 @@ export class CryptoProvider {
       const res = await this.ipfs.storePrivateKey(encryptedPrivateKeyHistory);
 
       // store ipfs link Of private tweet in gundb
-      // let ipfsLink = "ipfs://" + res["Hash"];
 
       await this.gun.storePrivateKeyHistory(this.ownUserId, this.email, res["Hash"]);
     }
@@ -69,13 +66,10 @@ export class CryptoProvider {
   private async getKeyHistory(userId: string) {
     //get private key history from gun
     let link = await this.gun.getPvtKeyHistory(userId);
-    // console.log("ipfs link = ", link);
     // Fetch public key history
     if (link) {
       const encryptedKeyHistory = await this.ipfs.fetchJson(link.key);
       // Decrypt key history
-      // const keyHistory = await this.aesDecrypt(encryptedKeyHistory.toString());
-      // console.log("encryptedKeyHistory:",encryptedKeyHistory);
       return JSON.parse(encryptedKeyHistory.toString());
       // return null;
     } else {

+ 0 - 4
app/src/providers/p2p-database-gun/p2p-database-gun.ts

@@ -8,7 +8,6 @@ export class P2pDatabaseGunProvider {
   osnPrefix: string = "hybridOSN-v2.0.0";
 
   constructor() {
-    // this.gun = Gun(["https://hybrid-osn.herokuapp.com/gun'/gun"]);
     this.gun = Gun(["https://hosn-twitter-app.herokuapp.com/gun"]);
   }
 
@@ -178,7 +177,6 @@ export class P2pDatabaseGunProvider {
   }
 
   public async getPvtKeyHistory(userId) {
-    // console.log("user id looking for key hsitory",userId);
     let entry = await this.gun
       .get(this.osnPrefix)
       .get("privateKey");
@@ -189,8 +187,6 @@ export class P2pDatabaseGunProvider {
       .get("privateKey")
       .get(userId)
       .then();
-
-    // console.log("private key entry:", pvtKeyEntry);
     if (pvtKeyEntry === undefined) {
       return null;
     } else {

+ 2 - 8
app/src/providers/pgp-key-server/pgp-key-server.ts

@@ -25,12 +25,10 @@ export class PgpKeyServerProvider {
 
   public async publishPubKey(pubkey) {
     this.hkp.upload(pubkey).then(function(result) {
-      // console.log('public key successfully uploaded', result);
     });
   }
 
   public async lookupKeys(email: string) {
-    // console.log('looking up keys for',email);
     let pubkey;
      let myEmail = await this.storage.get("email");
      if(email === myEmail){
@@ -46,7 +44,6 @@ export class PgpKeyServerProvider {
         try {
           let armoredPubkey = await this.hkp.lookup(options);
           pubkey = (await openpgp.key.readArmored(armoredPubkey)).keys[0];
-          // console.log("pubkey from server:",pubkey);
           this.pk.push(pubkey);  
           return pubkey;
         } catch (err) {
@@ -70,7 +67,6 @@ export class PgpKeyServerProvider {
     const options = {
       message: openpgp.message.fromText(plainText), // input as Message object
       publicKeys: await Promise.all(this.pk), // for encryption
-      // privateKey s: [privKeyObj] // for signing (optional)
     }
     const ciphertext = await openpgp.encrypt(options);
     return ciphertext.data;
@@ -84,7 +80,7 @@ export class PgpKeyServerProvider {
     }
     try {
       let plaintext = await openpgp.decrypt(options2);
-      return plaintext.data // 'Hello, World!'
+      return plaintext.data
     } catch (err) {
       console.log('Error thrown:', err);
     }
@@ -107,18 +103,16 @@ export class PgpKeyServerProvider {
       });
 
     } catch (e) {
-      console.log('revoke failed1', e);
+      console.log('revoke failed', e);
     }
 
   }
 
   async getArmoredPrivateKey(key:string){
     const privKeyObj = (await openpgp.key.readArmored(key)).keys[0];
-    // console.log("key is:",key,'amd',privKeyObj);
 
     if(privKeyObj){
       await privKeyObj.decrypt(this.passphrase);
-      // console.log("Key:",key , "Armored key ",privKeyObj);
       return privKeyObj;
     }
     else

+ 0 - 2
app/src/providers/twitter-api/twitter-api.ts

@@ -19,7 +19,6 @@ export class TwitterApiProvider {
     const access_token_key = await this.storage.get("accessTokenKey");
     const access_token_secret = await this.storage.get("accessTokenSecret");
     console.log('inside twitter initapi access_token_key:', access_token_key, 'access_token_secret', access_token_secret);
-    // if (access_token_key && access_token_secret) {
     if (1) {
       this.client = new Twit({
         consumer_key: "ewAyFOepelB1Dgczl7LReD3pN",
@@ -49,7 +48,6 @@ export class TwitterApiProvider {
       tweet_mode: "extended",
       max_id: maxId
     })
-    console.log('res is:', res);
     return res.data;
   }
 

BIN
rohit-master-apk/app-release-unsigned.apk