This story has been updated.

Just a few weeks ago you might have been forgiven for thinking these four words: Who is A$AP Rocky? But that was before President Trump became the Harlem rapper’s biggest champion and Twitter booster. Now the 30-year-old’s plight — he had been sitting in a Swedish jail for a month awaiting trial after a street fight in Stockholm and was subsequently found guilty of assault — is not only international news, but proof that Trump truly, madly, deeply cares about black people. (Insert eye roll here.)

The president coming to the aid of a detained American abroad on charges that seem excessive at best and racially motivated at worst is the obvious right thing to do. But Trump’s political motivations are rarely (forgive me) black and white. He isn’t calling the prime minister of Sweden and vouching for a young man he’s never met out of the kindness of his heart. As he said, he’s doing it because Kanye West and “many, many” African Americans asked him. Plus, helping this young black man looks good on Trump’s race report card. Consider the events of the past month:

July 14: Trump attacked four nonwhite first-term congresswomen, known as “the Squad,” telling them to “go back and help fix the totally broken and crime infested places from which they came.”

July 19: He said in an Oval Office presser that he and the first lady were working with the State Department to get Rocky, real name Rakim Mayers, released while awaiting trial. “I personally don’t know A$AP Rocky, but I can tell you he has tremendous support from the African American community in this country,” Trump said.

July 25: After a call with the Swedish prime minister didn’t yield Rocky’s release, the president threw a tantrum ... on behalf of black people. “Sweden has let our African American Community down in the United States,” he tweeted.

July 27: Trump ranted about Rep. Elijah Cummings (D-Md.), calling his district, specifically Baltimore, so crime-ridden and “rat and rodent infested” that “no human being would want to live” there. About 63 percent of Baltimore’s population is African American, according to the U.S. Census Bureau.

“It’s not a case where we should feel that this makes up for [Trump’s] remarks. It’s actually in kind with those remarks,” says A.D. Carson, an assistant professor of hip-hop at the University of Virginia. In a recent interview with TMZ, rapper Lil Yachty put it this way: “He knows this is some points. ‘Oh man, I could really win a lot of black people over.’ ” Points, scoreboards and winning are Trump’s main motivators — and by ringing the bell loudly, Trump is attempting to drown out all the criticism of his otherwise racist behavior. But isn’t using a black man as a pawn in a racist political game inherently, well, racist?

It’s tempting to label the president’s behavior as merely thoughtless. But Trump is more aware than many give him credit for, theorizes Anthony Nownes, a professor at the University of Tennessee who has examined the influence of celebrity on presidential popularity. Trump has to know that amplifying a rapper’s case will play well with his base. “For his supporters, it is a strong enough indicator that he isn’t a racist,” says Nownes. Trump’s logic, argues Nownes, goes like this: “I like black people who like me, like any normal person.”

Rocky’s mother said in an interview with a CNN Swedish affiliate that she was “very grateful” for Trump’s help. Carson says of course she is — who wouldn’t be? — and it’s the president’s duty to help. But that doesn’t mean there’s not an ulterior motive — “like an alibi” for racism — behind all of these public protestations. “He should be advocating for the folks unknown and known,” argues Carson. The fact that Trump more or less made his A$AP Rocky intervention on behalf of African Americans as a whole? That, says Carson, “is the weird part to me.”

Helena Andrews-Dyer is co-author of The Post’s Reliable Source column.