Fix search android package in non-owner users

This commit is contained in:
世界 2022-08-29 12:02:29 +08:00
parent d440a01792
commit e0f7387dff
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -22,13 +22,13 @@ func (s *androidSearcher) FindProcessInfo(ctx context.Context, network string, s
if err != nil { if err != nil {
return nil, err return nil, err
} }
if sharedPackage, loaded := s.packageManager.SharedPackageByID(uid); loaded { if sharedPackage, loaded := s.packageManager.SharedPackageByID(uid % 100000); loaded {
return &Info{ return &Info{
UserId: int32(uid), UserId: int32(uid),
PackageName: sharedPackage, PackageName: sharedPackage,
}, nil }, nil
} }
if packageName, loaded := s.packageManager.PackageByID(uid); loaded { if packageName, loaded := s.packageManager.PackageByID(uid % 100000); loaded {
return &Info{ return &Info{
UserId: int32(uid), UserId: int32(uid),
PackageName: packageName, PackageName: packageName,