Did Poland know Germany was going to invade before they actually did in WW2?
If so did they try to do anything about it?
While Polish cryptographers had broken the German engima cipher in the early 1930s, Germany added additional complexities to their encryption cipher in the year just before outbreak WWII which re-enabled their communication secrecy. Thus, Poland could not know an attack was incoming by attempting to listen into German communications. However, in the late 1930s, Germany had made a series of aggressive gestures towards Eastern Europe, including Poland (ie abrupt cancellation of Non-Aggression Treaty in early 1939, demands that Poland give up the key port city of Gdansk), which convinced the Polish High Command that war was almost but inevitable, they just didn't know when. Poland was actively preparing for a war with Germany as early as mid 1930s, however, their military was so woefully inadequate and underequipped (Polish army was severely deficient in mechanization, modern communications, and air power), that it wouldn't be a match for Germany until well after the war was underway. Therefore, the Poland tried to diplomatically surround herself with allies to deter a potential invasion from Germany, (she made mutual protection pacts with France and UK) and unsuccessfully tried to initiate alliances with her Eastern European neighbors. These mutual protection pacts, as we know, were worth little more than mere scraps of paper as Poland again becomes the victim of neighboring powers as history repeated itself on Sept 1, 1939
Drzewieniecki, Walter. "The Polish Army on the Eve of World War II" The Polish Revew