What about transit airports(France) and airport of departure(Ukraine)? Do I need to go through customs in these two countries too?
No, there is no need to declare a laptop or phone in Japan if they are yours and you intend to take them out of the country when you leave.
Your departure and transit airports will not care either, since Customs is focused on importing goods into a country. (With some exceptions for things like antiques and weaponry, neither of which applies here.)