parent
							
								
									0519abab03
								
							
						
					
					
						commit
						b0a958e744
					
				@ -5,6 +5,10 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include <stdio.h>
 | 
					#include <stdio.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef ANDROID
 | 
				
			||||||
 | 
					#include <QtAndroidExtras/QtAndroid>
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
QString get_hdid();
 | 
					QString get_hdid();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif // HARDWARE_FUNCTIONS_H
 | 
					#endif // HARDWARE_FUNCTIONS_H
 | 
				
			||||||
 | 
				
			|||||||
@ -38,6 +38,16 @@ QString get_hdid()
 | 
				
			|||||||
    CloseHandle(hToken);
 | 
					    CloseHandle(hToken);
 | 
				
			||||||
    return returnHDID;
 | 
					    return returnHDID;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					#elif defined(ANDROID)
 | 
				
			||||||
 | 
					QString get_hdid()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    QAndroidJniObject appctx = QAndroidJniObject::callStaticObjectMethod("org/qtproject/qt5/android/QtNative", "activity", "()Landroid/app/Activity;").callObjectMethod("getApplicationContext","()Landroid/content/Context;");
 | 
				
			||||||
 | 
					    QAndroidJniObject androidId = QAndroidJniObject::callStaticObjectMethod("android/provider/Settings$Secure","getString",
 | 
				
			||||||
 | 
					                                                                            "(Landroid/content/ContentResolver;Ljava/lang/String;)Ljava/lang/String;",
 | 
				
			||||||
 | 
					                                                                            appctx.callObjectMethod("getContentResolver", "()Landroid/content/ContentResolver;").object<jobject>(),
 | 
				
			||||||
 | 
					                                                                            QAndroidJniObject::fromString("android_id").object<jstring>());
 | 
				
			||||||
 | 
					    return androidId.toString();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
#elif QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
 | 
					#elif QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
 | 
				
			||||||
#if (defined(LINUX) || defined(__linux__))
 | 
					#if (defined(LINUX) || defined(__linux__))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user