Browse Source

Updated readme and fixed bug related to tviz in the app list page

apprausch 6 years ago
parent
commit
47111cd271

+ 13 - 0
README.md

@@ -0,0 +1,13 @@
+# Introduction 
+This project contains the Server, client as well as the Mobile app of the Trust4App framework. Trust4App calculates the trustworthiness of a mobile application considering the public information available on the Play Store as well as the security health of that app. 
+
+#Prerequisites
+Node.js(https://nodejs.org/en/)
+nodemon(http://nodemon.io/)
+
+#Installation
+npm install
+
+#running the server and the client
+nodemon
+url: http://localhost:3000/

+ 8 - 1
client/controllers/apps.js

@@ -13,6 +13,9 @@ myApp.controller('AppsController', ['$scope', '$http', '$location', '$routeParam
 	$scope.finalHTI = false;
 
 	$scope.getApps = function(){
+
+		angular.element('*[id^="tviz"]').remove();
+
 		var genre = $routeParams.genre;
 		var query = "";
 		if(genre) {
@@ -24,6 +27,9 @@ myApp.controller('AppsController', ['$scope', '$http', '$location', '$routeParam
 	}
 
 	$scope.getApp = function(){
+
+		angular.element('*[id^="tviz"]').remove();
+
 		var id = $routeParams.id;
 		var posture = $routeParams.posture;
 		var query = "";
@@ -78,11 +84,12 @@ myApp.controller('AppsController', ['$scope', '$http', '$location', '$routeParam
 	}
 
 	$scope.getApp2 = function(app, $index){
+		angular.element('*[id^="tviz"]').remove();
 		if(app.reviews.length && app.permissions.length) {
 			$http.get('/crawler/downloadedapps/'+app.appId).then(function(response) {
 				//$scope.app = response.data;
 				$scope.appResultList[$index] = response.data;
-				$scope.showTviz(response.data, $index);
+				//$scope.showTviz(response.data, $index);
 				$scope.securityRisksTC = [		
 					"Client communication used?",
 					"SSL/TLS used?",

+ 1 - 0
client/controllers/download.js

@@ -5,6 +5,7 @@ myApp.controller('DownloadController', ['$scope', '$http', '$location', '$routeP
 	$scope.loading = false;
 
 	$scope.getDownloadInfo = function(){
+		angular.element('*[id^="tviz"]').remove();
 		var id = $routeParams.id;
 		$scope.loading = true;
 		$http.get('/crawler/getDownloadInfo/'+id).then(function(response){

+ 2 - 2
client/controllers/search.js

@@ -10,8 +10,8 @@ myApp.controller('SearchController', ['$scope', '$http', '$location', '$routePar
 
 	$scope.searchResults = [];
 
-	$scope.search = function(){
-		
+	$scope.search = function(){		
+		angular.element('*[id^="tviz"]').remove();
 		var extraParams = "&num=30";
 		extraParams += ($scope.data.countryCheck) ? "&country=de" : "";
 		$http.get('/crawler/apps/?q='+ $scope.data.searchTerm + extraParams).then(function(response){

+ 3 - 3
client/views/apps.html

@@ -10,14 +10,14 @@
             <th># of Permissions</th> -->
             <th>Reputation</th>
             <th>S&P Quality</th>
-            <th>Trust Score</th>
+            <!-- <th>Trust Score</th> -->
             <!-- <th>Trust+ score</th> -->
             <th></th>
             <th></th>
         </tr> 
     </thead> 
     <tbody> 
-        <tr ng-repeat="app in apps"  ng-init="getApp2(app, $index)"> 
+        <tr ng-repeat="app in apps" ng-init="getApp2(app, $index)">
             <th scope="row">{{$index+1}}</th>
             <td>{{app.title}}</td>
             <!-- <td>{{app.genre}}</td>
@@ -36,7 +36,7 @@
                 <br/>
                 <span>Privacy Risks(t,c,f) = {{appResultList[$index] ? getPrivacyRisksTCF(appResultList[$index]) : "(NA,NA,NA)" }}</span>
             </td>
-            <td><div id="{{ 'tviz' + $index }}"></div></td>
+            <!-- <td><div id="{{ 'tviz' + $index }}"></div></td> -->
             <!-- <td>{{appResultList[$index] ? getTrustPlusFrameworkScore(appResultList[$index]) : "NA" }}</td> -->
             <td><a href="#!/apps/{{app.appId}}">Details</a></td>
             <td><a href="#!/download/{{app.appId}}">Download Info</a></td>

+ 3 - 1
package-lock.json

@@ -1158,7 +1158,9 @@
       "integrity": "sha1-ddpKkn7liH45BliABltzNkE7MQ0="
     },
     "node-paginate-anything": {
-      "version": "git+https://github.com/polo2ro/node-paginate-anything.git#c2d25b9e8df121d3a2b563ae1ef3f70d30634a26"
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/node-paginate-anything/-/node-paginate-anything-1.0.0.tgz",
+      "integrity": "sha1-WR/jCw1r8J/7yrl9ETt2z6mdHZs="
     },
     "node-restful": {
       "version": "0.2.6",

+ 1 - 0
package.json

@@ -15,6 +15,7 @@
     "lodash": "^4.16.6",
     "method-override": "^2.3.6",
     "mongoose": "^4.6.6",
+    "node-paginate-anything": "^1.0.0",
     "node-restful": "^0.2.5",
     "request": "^2.78.0",
     "resourcejs": "^1.5.0",