The Verdict: Not eligible
Time in Portugal without a permit does not count towards citizenship, and there is no longer a general way to get a permit from inside the country. Check whether descent or marriage gives you a route instead.
Citizenship by residence counts only time spent legally, under a visa, permit or other authorisation, however long you have lived in Portugal.
The in-country route, the "manifestação de interesse", was repealed in 2024, and the permit for nationals of Portuguese-speaking countries now assumes you arrived on a consular visa. The usual way forward is the right visa from a Portuguese consulate, which normally means applying from abroad. Asylum and humanitarian protection are a separate system; take advice before acting.
A Portuguese parent or grandparent, or three years of marriage to a Portuguese citizen, gives you a route whatever your immigration status.