import { UniEntryAbility } from "@normalized:N&&&@dcloudio/uni-app-runtime/Index&2.3.15";
import { initUniModules } from "@normalized:N&&&entry/src/main/ets/uni_modules/index.generated&";
import BuildProfile from "@normalized:N&&&entry/build/default/generated/profile/default/BuildProfile&";
import url from "@ohos:url";
import type AbilityConstant from "@ohos:app.ability.AbilityConstant";
import type Want from "@ohos:app.ability.Want";
initUniModules();
export default class EntryAbility extends UniEntryAbility {
    constructor() {
        super("HBuilder", {
            debug: BuildProfile.DEBUG,
        });
        console.log("AuthorizationUrlListener EntryAbility tmp.");
    }
    onNewWant(want: Want, launchParam: AbilityConstant.LaunchParam): void {
        if (want?.uri) {
            let urlObject = url.URL.parseURL(want?.uri);
            let action = urlObject.protocol;
            if (action.indexOf('net.rj.appauth') === 0) {
                this.context.eventHub.emit('event_appauth_auth_', want?.uri);
            }
        }
        console.log("AuthorizationUrlListener EntryAbility want: Want.");
        console.log("AuthorizationUrlListener EntryAbility want: Want." + want?.uri);
    }
}
