public static Package fromLegacy(@NonNull Object legacy) {
        Package res = new Package();
        Class<Package> packageClass = Package.class;
        for (Field field : packageClass.getDeclaredFields()) {
            try {
                if (field.isAnnotationPresent(Ignore.class)) {
                    continue;
                }
                String fieldName = field.getName();
                if (fieldName == null || fieldName.equals("_globalPatchRedirect")) {
                    continue;
                }
                Object fieldValueFromLegacy = XposedHelpers.getObjectField(legacy, fieldName);
                XLog.v("fieldValueFromLegacy: %s %s", fieldName, fieldValueFromLegacy);
                field.set(res, fieldValueFromLegacy);
            } catch (Throwable e) {
                XLog.e(e, "Fail retrieve field from legacy: " + field);
            }
        }
        XLog.v("Package fromLegacy: %s", res);
        return res;
    }
Filtered set of {@link #getAllCodePaths()} that excludes
resource-only APKs.
android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/pm/Package.java