[Service] Make correctly smack label for some special service app 57/258357/5 submit/tizen/20210517.160019
authorChunling Ye <chunling.ye@samsung.com>
Fri, 14 May 2021 03:44:46 +0000 (11:44 +0800)
committerChunling Ye <chunling.ye@samsung.com>
Mon, 17 May 2021 02:30:31 +0000 (10:30 +0800)
For some app like 111399000136, it's packagid is 'obxi69OqU7' which same with UI app's
package ID, but the service id is 'obxi69OqU4.service', if get packagid from service
name, 'obxi69OqU4' will get which is not 'obxi69OqU7'. So set smack label by service
app name, issue will happen.

Now get the packagid from webapis.getPackageId.

Change-Id: If7d0a53bc56bd7f002b4406ba78bc25176bbec60
Signed-off-by: Chunling Ye <chunling.ye@samsung.com>
wrt_app/common/service_runner.ts

index f4a9228..3b5c308 100644 (file)
@@ -93,7 +93,7 @@ export function start(id: string, filename: string) {
   try {
     let ids = id.split(':');
     let serviceId = ids[0];
-    let packageId = serviceId.split('.')[0];
+    let packageId = global.webapis.getPackageId();
     wrt.security?.dropThreadPrivilege(packageId, serviceId);
 
     app = require(filename);