Validate and save packaged app origin (bug 878101, 878103)