The clear majority of Palestinian attacks are on civilian targets. They are not included in any definition of self defense. And even the atatcks on Israeli military are in no way productive and only serve to worsen the lives of Palestinians.
The role of the Israeli military, even before Israel existed has been to stop Arab attacks. If there were no attacks then there would have been no Haganah. The conquest of the West Bank and Gaza was because of endless attacks on Israeli towns and a declaration of war by the Arab leadership. Israel has since signed peace deals with two of those countries and the only reason Israel return the land is Jordan (and Egypt) didn't want the land back.
And the occupation will continue until there is someone amongst the Palestinians willing to accept a permanent peace deal.
p.s. Your 'transfer of population comments seem clueless in your claim that Israel, the occupying power, doesn't have the right to put Palestinian prisoners into jail.
I'm sure your opinions are interesting to you but they don't further any real progress unless they are based on documented evidence. These discussions would me much more productive and honest if you produce your sources.
I'll produce mine:
On the transfer of Palestinians out of the occupied territories:
"Individual or mass forcible transfers and deportations of the civilian
population from occupied territory are prohibited."
https://www.icrc.org/eng/assets/files/other/law9_final.pdf
On the transfer of Israeli's into the occupied territories:
"The occupying power must not deport or transfer parts of its own civilian
population into the territory it occupies."
https://www.icrc.org/eng/assets/files/other/law9_final.pdf
Both of these are violations of the Geneva Convention and as such are war crimes.
As to the right of resistance;
"After effective occupation of territory, members of the territory’s armed
forces who have not surrendered, organized resistance movements and
genuine national liberation movements may resist the occupation. If they
do so, they must distinguish themselves from the civilian population, or
on the basis of GP I, at least carry their weapons openly during attacks
and deployments."
https://www.icrc.org/eng/assets/files/other/law9_final.pdf
As you can see, the right of resistance is part of the Geneva Convention.