What are some Ethics of doing business in countries with a totalitarian government?

There is no meaningful code of ethics when doing business with a totalitarian government, because it is in itself unethical to do so. When google and yahoo assisted the Chinese government in censoring the internet and identifying(and imprisoning) political dissidents, they were publicly condemned for a while,and accused of being unamerican, and then it was business as usual.It was a bit like a showtrial. Everybody knew that the Chinese IT market was far too lucrative to let ethics get in the way. The executives at google and yahoo are not necessarily immoral people, but are obligated to look after shareholders and had little choice but to do as the Chinese said.It may be unethical to do business with dictators, but it's also profitable. Citizens in a democracy don't tolerate their recources being pillaged and their environment polluted by foreign corporations, and that's why dictators are helped into power by western governments, and kept there with a steady supply of arms. Most people are against human rights abuses, but many of the same people have money invested in companies dealing with repressive governments, either as direct shares or indirectly as pension funds.