MCPcopy Create free account
hub / github.com/BombusMod/BombusMod / compute

Method compute

src/main/java/Client/Config.java:715–734  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

713
714//#if android
715 public static final String compute(){
716 final String manufact = System.getProperty("device.manufacturer");
717 final String model = System.getProperty("device.model");
718 final String manufact_ = manufact.trim().toLowerCase();
719 final String model_ = model.trim().toLowerCase();
720 String result = "";
721 int total = manufact_.length();
722 if(total>model_.length()) total = model_.length();
723 int matches = 0;
724 for(int i=0; i<total; i++){
725 if(manufact_.charAt(i) == model_.charAt(i)) matches++;
726 }
727 final int percentage = matches*100/total;
728 if(percentage > 20){
729 result = model;
730 }else{
731 result = manufact+" "+model;
732 }
733 return result;
734 }
735//#endif
736 public static String getPlatformName() {
737 String device = System.getProperty("device.model");

Callers 1

getPlatformNameMethod · 0.95

Calls 2

getPropertyMethod · 0.80
toLowerCaseMethod · 0.80

Tested by

no test coverage detected